IoT Viva Theory from Scratch | Complete Internet of Things in 42 Min | SPPU TE AI&DS 2024 Pattern — Transcript
Full transcript
- 0:01Hello Pranav [music] and welcome to your
- 0:03complete internet of things viva
- 0:04revision. This video follows [music]
- 0:06your SPU syllabus for third year AI and
- 0:10data science 2024 [music]
- 0:11pattern course MDM331.
- 0:14We will cover every [music] theory
- 0:16topic, every sensor, all 12 lab
- 0:18assignments and the questions your
- 0:20[music] examiner is most likely to ask
- 0:22with crisp answers. Watch it once end to
- 0:25end with full attention and [music] you
- 0:27will walk into your orals confident.
- 0:29Let's begin.
- 0:32[music]
- 0:32Chapter one, the fundamentals of the
- 0:34internet of things.
- 0:37So what [music] exactly is IoT? Remember
- 0:40this one line definition for your Viva.
- 0:43The internet of things is a network
- 0:45[music] of physical objects fitted with
- 0:47sensors, software, and connectivity. So
- 0:49they can collect and [music] exchange
- 0:51data. These things sense their
- 0:54environment, communicate over a network,
- 0:56take decisions, and even [music] act
- 0:58with minimal human intervention. Each
- 1:01device has a unique identity [music]
- 1:03such as an IP address or a device ID, so
- 1:07it can be addressed on the network.
- 1:09Think of a smart electricity meter,
- 1:11[music] a fitness band, or a smart
- 1:13irrigation system that waters the field
- 1:16only when the soil is dry.
- 1:19Every IoT system is built from six
- 1:22[music] components. Learn them in order
- 1:24from the physical world to the user.
- 1:27First, sensors. [music]
- 1:28They measure physical quantities like
- 1:30temperature, light or gas and convert
- 1:32them into electrical signals. They are
- 1:34[music] the input side. Second,
- 1:37actuators. They do the opposite. They
- 1:39convert an electrical [music] signal
- 1:41into physical action like an LED
- 1:44glowing, a motor rotating or a [music]
- 1:46relay switching. Third, the processing
- 1:48unit such as Arduino Uno, Raspberry
- 1:51[music] Pi or ESP32 which reads sensors
- 1:55and runs our logic. [music] Fourth,
- 1:57connectivity, Wi-Fi, Bluetooth, low
- 2:00energy, Laura [music] or cellular
- 2:02networks carry the data. Fifth, the
- 2:04cloud or server where data [music] is
- 2:06stored and analyzed. And sixth, the
- 2:09application, a dashboard or mobile app
- 2:12where the [music] user finally sees the
- 2:14information and controls devices.
- 2:18A [music] very common Viva question.
- 2:20What is the difference between physical
- 2:22design and logical design of IoT?
- 2:26Physical [music] design talks about the
- 2:28actual things and the protocols they
- 2:30use. Logical design is an abstract view
- 2:33of functions [music] without going into
- 2:35hardware details. Physical design
- 2:37includes devices, [music]
- 2:39sensors, interfaces and protocols.
- 2:42Logical design includes [music]
- 2:43functional blocks, communication models
- 2:46and communication a PIS [music]
- 2:48like rest and websocket. For example, a
- 2:51Raspberry Pi with a DHT11 over Wi-Fi is
- 2:55a physical design. [music] The chain of
- 2:57device communication services management
- 3:00security [music] and application is the
- 3:02logical design. In short, physical
- 3:05design answers what is used. Logical
- 3:08design answers how [music] does it work?
- 3:11Why do we need the cloud in IoT? Because
- 3:14small devices have very [music] limited
- 3:17memory and processing power. The cloud
- 3:20gives almost unlimited storage for
- 3:22sensor data [music] that keeps coming 24
- 3:24by7. It provides scalable computing so
- 3:28we can run analytics [music] and machine
- 3:30learning on huge data sets. It gives
- 3:33remote access so a user can monitor the
- 3:36home or the factory from anywhere
- 3:38[music] in the world. It also handles
- 3:40device management overthe-air [music]
- 3:42firmware updates and rules that trigger
- 3:45alerts. Popular platforms are a [music]
- 3:48WSOT core, Microsoft Azure IoT hub and
- 3:52things speak for students.
- 3:55Always [music] be ready with a few
- 3:57applications and connect them to a
- 3:59sensor. Smart homes [music] with
- 4:01automatic lights, smart locks and energy
- 4:04monitoring. Smart agriculture where soil
- 4:07moisture sensors switch irrigation pumps
- 4:10automatically.
- 4:12Healthcare [music] with wearables and
- 4:13remote patient monitoring of heart rate
- 4:16and oxygen level. [music] Industrial IoT
- 4:20where vibration and temperature sensors
- 4:22predict [music] machine failure before
- 4:23it happens. This is called predictive
- 4:26maintenance.
- 4:27Smart [music] cities with smart parking,
- 4:29adaptive traffic signals and smart
- 4:31street lights and environmental
- 4:34monitoring [music] like air quality
- 4:36indexes and flood warning systems.
- 4:40[music]
- 4:41Chapter 2, IoT architecture.
- 4:45Let's start [music] with M2M which means
- 4:47machine to machine communication.
- 4:50M2M [music]
- 4:51is direct communication between two
- 4:53machines without any human involvement.
- 4:57It is usually pointto-point [music]
- 4:59often over a cellular or wired link. M2M
- 5:03solutions are generally proprietary and
- 5:05closed built for one specific purpose.
- 5:08Classic examples are in a [music] TM
- 5:11talking to the bank server or a vending
- 5:13machine reporting low stock to the
- 5:15supplier.
- 5:18Now [music] compare M2M with IoT. This
- 5:21table is a favorite of examiners.
- 5:23[music] Communication. M2M is
- 5:26pointtooint. IoT is many [music] to many
- 5:28over the internet using IP protocols.
- 5:32M2M [music] often uses proprietary nonIP
- 5:35protocols. IoT uses open IP based
- 5:39protocols like MQTT, co-op and [music]
- 5:41HTTP.
- 5:43Focus M2M focuses on hardware. [music]
- 5:46IoT focuses on software data and cloud
- 5:49analytics.
- 5:51Scale [music] M2M is limited. IoT is
- 5:54massive and scalable. Billions of
- 5:56devices [music] and data. In M2M, it
- 5:59stays local. In IoT, it goes to [music]
- 6:02the cloud. One line to remember, M2M is
- 6:05a subset of IoT.
- 6:08The simplified IoT [music] architecture
- 6:11is explained in layers. Three layer and
- 6:13five layer models are [music] both
- 6:15popular. Let's do the five layer one,
- 6:17which includes the three layer one. At
- 6:20the bottom [music] is the perception
- 6:22layer. the sensors and actuators that
- 6:24touch the physical world. [music] Above
- 6:26it, the network layer which transmits
- 6:28data using Wi-Fi, Laura, cellular
- 6:31networks and gateways. Then the
- 6:34processing or middleware layer where
- 6:36data [music] is stored and processed in
- 6:38the cloud at the edge and in databases.
- 6:41Then the application layer which
- 6:43delivers services to [music] the user
- 6:45like a smartarthome dashboard. And at
- 6:48the top the business layer which manages
- 6:50the whole system business models and
- 6:52decisions. For the three layer model
- 6:55simply say perception, [music] network
- 6:57and application.
- 6:59The IoT protocol stack maps protocols to
- 7:03[music] layers. Remember it from top to
- 7:05bottom. Application layer MQTT co-op
- 7:09HTTP [music]
- 7:10a MQP XMPPP and websocket.
- 7:14Transport [music] layer TCP and UDP.
- 7:17Security sits here too. TLS [music] runs
- 7:20over TCP and DTLS runs over UDP. [music]
- 7:25Network layer IP version 4 IP version 6
- 7:29low WPNEN and [music] RPL the routing
- 7:32protocol for low power networks. Link
- 7:35and physical layer [music] Wi-Fi
- 7:37Ethernet Bluetooth low energy ziggb on
- 7:40802.15.4 [music]
- 7:42Four, Lara and NB IoT.
- 7:47[music] Chapter 3, how IoT devices
- 7:49communicate.
- 7:51There are four communication models in
- 7:54[music] IoT. This is a guaranteed
- 7:56question. One, request response. The
- 7:59client sends a request. The server sends
- 8:01a response. [music] It is stateless.
- 8:04HTTP is the best example. Two, [music]
- 8:07publish subscribe. Publishers send data
- 8:09to a topic on a broker and the broker
- 8:11[music] forwards it to all subscribers
- 8:13of that topic. Publishers and
- 8:15subscribers do not know each other.
- 8:17[music] MQTT is the best example. Three,
- 8:21pushpull data producers push data into a
- 8:24queue and consumers pull data from
- 8:26[music] it. The queue acts as a buffer
- 8:28so producers and consumers can work at
- 8:30different speeds. Four, exclusive
- 8:32[music] pair. A full duplex birectional
- 8:35connection that stays open between
- 8:37client and server. [music] Web socket is
- 8:39the example.
- 8:42Next, the communication patterns [music]
- 8:44named by who talks to whom. Device to
- 8:48device, two devices communicate [music]
- 8:50directly, usually over short range
- 8:52protocols like Bluetooth or Ziggb, a
- 8:55smart bulb and a smart [music] switch,
- 8:57for example. Device to cloud. The device
- 9:00connects directly to a cloud service
- 9:02over Wi-Fi [music]
- 9:03or Ethernet like a smart thermostat
- 9:06sending readings to its cloud. [music]
- 9:08Device to gateway. Devices connect to a
- 9:11local gateway like a smartphone or a
- 9:13Raspberry [music] Pi hub which
- 9:15translates protocols and forwards data
- 9:17to the cloud. Useful when devices cannot
- 9:20[music] speak IP. Back-end data sharing.
- 9:23Data from one cloud is [music] shared
- 9:25with other cloud services or third
- 9:27parties through a PIS. So it can be
- 9:29combined and analyzed. [music]
- 9:33Chapter four, networks and connectivity
- 9:36protocols.
- 9:38The TCP IP model [music] has four
- 9:41layers. Application layer which gives
- 9:44services to the user like HTTP, MQTT and
- 9:48DNS.
- 9:49Transport [music] layer which gives end
- 9:51toend delivery between processes using
- 9:54port numbers [music] TCP and UDP live.
- 9:57here internet layer which handles
- 10:00logical addressing and routing [music]
- 10:02of packets that is IP and the network
- 10:05access layer which physically sends bits
- 10:08over Ethernet or Wi-Fi.
- 10:11TCP versus UDP. [music]
- 10:14TCP is connection oriented. It first
- 10:17sets up a connection with a three-way
- 10:19[music] handshake. SIN sin arc UDP is
- 10:23connectionless.
- 10:24TCP is reliable. It uses sequence
- 10:27numbers, acknowledgements [music] and
- 10:29retransmission. UDP gives no guarantee
- 10:32of delivery. Because of this, TCP is
- 10:35slower with more overhead while UDP is
- 10:38fast and lightweight. [music]
- 10:40In IoT, MQTT and HTTP run on TCP while
- 10:45co-op runs on UDP.
- 10:49Why does IoT need [music] IP version 6?
- 10:52Look at this table. IP version 4 uses
- 10:5532bit [music]
- 10:56addresses about 4.3 billion. That is not
- 10:59enough for billions of IoT [music]
- 11:01devices. IP version 6 uses 128 bit
- 11:05addresses [music] practically unlimited.
- 11:08IP version 4 is written in dotted
- 11:11decimal. IP version 6 is written in
- 11:13hexadimal separated by [music] colons.
- 11:16IP version 6 supports stateless address
- 11:19auto configuration so devices configure
- 11:22[music] themselves.
- 11:24IP6 security is optional in version 4
- 11:27and was [music] designed into version 6
- 11:30and version 6 removes the need for n so
- 11:33every device can have its own global
- 11:35address that is exactly what IoT needs.
- 11:40Six low W pan is an important topic. It
- 11:44stands [music] for IP version 6 over low
- 11:47power wireless personal area networks.
- 11:49[music]
- 11:50It allows IP version 6 packets to travel
- 11:53over it E82.15.4
- 11:57radios [music]
- 11:57whose frame size is only 127 bytes while
- 12:01[music] an IP version 6 packet can be
- 12:041280 bytes. So six low W pen adds an
- 12:08adaptation layer that compresses [music]
- 12:10the large IP version 6 header and
- 12:13fragments packets into smaller pieces.
- 12:16This gives [music] even tiny battery
- 12:18powered sensors a real IP address. It is
- 12:21used in the thread smarthome protocol.
- 12:25Communication protocols [music] are
- 12:27divided by range. RFID and NFC work at a
- 12:32few centimeters [music]
- 12:33used for identification and payments.
- 12:36Bluetooth low energy works up to [music]
- 12:39about 10 m for wearables. ZigGB works
- 12:42from 10 to 100 m in a mesh used for home
- 12:46automation.
- 12:47Wi-Fi [music] covers 50 to 100 meters
- 12:50with high data rate and long range low
- 12:54power wide area networks [music] called
- 12:56LPWN like Laura WAN and NBOT cover
- 13:00several kilometers with very [music] low
- 13:02power. Remember the trade-off longer
- 13:04range and lower power means lower data
- 13:06rate.
- 13:09RFID [music]
- 13:10radio frequency identification
- 13:12identifies objects using radio [music]
- 13:14waves without contact or line of sight.
- 13:18An RFID system [music] has three parts.
- 13:21The tag which is a chip with an antenna,
- 13:23the reader and [music] the host system
- 13:25with a database. Passive tags have no
- 13:28battery. They get energy from the
- 13:30reader's electromagnetic [music]
- 13:31field by induction and reply with their
- 13:34ID. Active tags have their own battery
- 13:37and can transmit over much longer
- 13:39distances [music] like vehicle tracking.
- 13:42Frequency bands are low frequency 125
- 13:45kohertz [music]
- 13:46high frequency 13.56 MHz which is what
- 13:50[music] our MFRC522
- 13:52uses and ultra high frequency [music]
- 13:55860 to 960 MGHertz.
- 13:59Laura [music] and Laura WAN. Students
- 14:01often confuse these two so be clear.
- 14:04Laura meaning long range is [music] the
- 14:06physical layer. It uses chirp spread
- 14:08spectrum modulation which makes signals
- 14:11robust over long [music] distances.
- 14:13Laura one is the protocol on top of it.
- 14:16It defines the [music] M a C layer and
- 14:18the network architecture. The topology
- 14:22is a star of stars. [music] Nodes talk
- 14:24the gateways and gateways forward to a
- 14:26network server over the internet. It
- 14:29reaches 2 [music] to 5 km in cities and
- 14:32over 15 in open areas and a sensor can
- 14:34run for years on a battery. [music] The
- 14:36trade-off is a very low data rate.
- 14:39Loroan devices have three classes.
- 14:41[music] Class A has the lowest power and
- 14:44listens only briefly after it transmits.
- 14:46Class B adds scheduled receive windows.
- 14:48[music] Class C listens almost all the
- 14:51time and uses the most power. In India,
- 14:54Laura uses the unlicensed [music]
- 14:56865 to 867 megahertz band.
- 15:02Now, cellular [music] IoT, which uses
- 15:04licensed mobile networks, NB IoT,
- 15:08narrowband IoT, [music] uses very little
- 15:10bandwidth, penetrates deep indoors, and
- 15:13uses very low power. Perfect for smart
- 15:16water and gas meters. LTEM [music]
- 15:19also called CATM M1 supports mobility
- 15:22and even voice. So it suits [music]
- 15:24vehicle trackers and wearables and 5G
- 15:27brings massive machine type
- 15:29communication supporting [music] up to a
- 15:31million devices per square kilometer.
- 15:34Wi-Fi defined by Ile E2.11 [music]
- 15:38has variants B, G, and N work at 2.4
- 15:42GHz. A C works at 5 GHz. [music]
- 15:45A X is Wi-Fi 6 which handles many
- 15:48devices efficiently. An 802.11H [music]
- 15:52called Wi-Fi hollow works below 1 GHz,
- 15:55[music] reaches about a kilometer and
- 15:57was designed specially for IoT.
- 16:01Your syllabus [music] also mentions a I
- 16:04enabled networking. It means using
- 16:06machine learning to [music] manage the
- 16:08network itself. A I can predict traffic
- 16:11patterns and allocate bandwidth
- 16:13dynamically. [music]
- 16:14It enables self-healing networks that
- 16:17detect faults and reroute automatically.
- 16:20It detects [music] intrusions and
- 16:21anomalies in network traffic, improving
- 16:24security. And it does energy [music]
- 16:26aware routing so battery powered nodes
- 16:29last longer.
- 16:32Chapter [music] 5, the hardware and how
- 16:35data is acquired.
- 16:37Let's look [music] at the two boards in
- 16:39your lab. First, the Arduino Uno.
- 16:42Arduino [music]
- 16:43Uno is a microcontroller board based on
- 16:46the AT mega 328P running at 16 MGHertz.
- 16:50[music] It has 14 digital input output
- 16:53pins, six of which support PWM and six
- 16:57analog input [music] pins, a 0 to a 5.
- 17:00Its analog to digital converter is 10
- 17:03bit. [music] So analog readings range
- 17:05from 0 to 1,023.
- 17:07It works at 5 Vs. It has 32 [music]
- 17:11kilobytes of flash and only 2 kilobytes
- 17:13of SRM and it runs no operating system.
- 17:16[music] It runs one program forever. It
- 17:19is programmed in C and C++ using the
- 17:22Arduino IDE. [music] Every sketch has
- 17:25two functions. Setup runs once and loop
- 17:28runs again and again.
- 17:31Next, the Raspberry [music] Pi.
- 17:33Raspberry Pi is a full single board
- 17:36computer with [music] a quad core RM
- 17:38processor running Raspberry Pi OS which
- 17:41is Linux. It has a [music] 40pin GPIO
- 17:44header. Very important. Its pins work at
- 17:473.3 [music] volts and are not 5V
- 17:50tolerant. Connecting 5 volts directly
- 17:53can damage the Pi. It has built-in
- 17:55[music] Wi-Fi, Bluetooth, Ethernet, USB
- 17:58and HDMI. So, it [music] is perfect as
- 18:01an IoT gateway or edge device. A classic
- 18:05[music] Viva trap. The Raspberry Pi has
- 18:07no built-in analog to digital converter.
- 18:10To read an [music] analog sensor like
- 18:11MQ2, we use an external ADC chip such as
- 18:15the MCP 3008 connected [music] over SPI.
- 18:20We program it in Python using libraries
- 18:22like [music] RPI.GPIO
- 18:25or GPIO.
- 18:28Arduino versus Raspberry Pi. [music]
- 18:31Expect this one. Arduino is a
- 18:34microcontroller. Raspberry Pi is a
- 18:36microprocessor based [music] single
- 18:38board computer. Arduino has no operating
- 18:42system. [music] Raspberry Pi runs Linux.
- 18:45Arduino works at 5V [music] logic.
- 18:47Raspberry Pi at 3.3 volts. Arduino has
- 18:52analog [music] inputs with a 10 bit ADC.
- 18:54Raspberry Pi has none. So Arduino is
- 18:58best for simple realtime control of
- 19:00sensors and actuators [music] while
- 19:02Raspberry Pi is best for edge computing,
- 19:04machine learning, cameras and
- 19:06networking. In many projects both are
- 19:08used together.
- 19:11Now the hardware interfaces in your
- 19:13syllabus [music]
- 19:14start with GPIO a DC and DSC. [music]
- 19:18GPIO generalpurpose input output is a
- 19:21pin you can program as input [music] to
- 19:23read a sensor or as output to drive an
- 19:26LED. It has only two states high and low
- 19:30[music] and a DC analog to digital
- 19:32converter converts a continuously
- 19:35varying voltage [music] into a digital
- 19:37number that the processor can
- 19:38understand. The resolution decides the
- 19:42number of levels and n bit [music] a DC
- 19:44gives 2 to the power n levels. Arduino's
- 19:4710 bit a DC [music] gives 1,024 levels.
- 19:51So each step is 5 volts divided by 1,024
- 19:56about 4.9 m volts. If [music] the
- 19:58reading is 512 the voltage is about 2.5
- 20:02volt. A DSC digital to [music] analog
- 20:05converter does the reverse. Arduino Uno
- 20:08has no true DSC. So it uses [music] PWM
- 20:11pulse width modulation to imitate an
- 20:14analog output like dimming and LED.
- 20:19The three serial protocols UR, SPI and I
- 20:23squared C [music] are very important.
- 20:25Learn this table well. Wires URes
- 20:28[music] two wires transmit and receive.
- 20:30SPI uses four M OSI MISO [music]
- 20:34the clock seck and slave select. I
- 20:37squared C uses only two. The data line
- 20:40SD [music] and the clock line Sccl
- 20:43clock UR is a synchronous. There is no
- 20:46clock wire. So both sides must agree on
- 20:48a B rate like 9,600. [music] SPI and I
- 20:52squared C are synchronous with a shared
- 20:54clock devices. U RT is pointtooint.
- 20:57[music]
- 20:58SPI has one master and many slaves each
- 21:01needing its own slave select line.
- 21:03[music] I squared C connects many
- 21:05devices on the same two wires using
- 21:08seven bit addresses. Speed [music] SPI
- 21:11is the fastest in megahertz. I squared C
- 21:14is medium 100 or 400 kilohertz. [music]
- 21:17UR is typically slow. Examples. The
- 21:21serial monitor uses UR. [music] Our RFID
- 21:24reader MFRC522
- 21:27uses SPI. OLED displays often use I
- 21:31squared C.
- 21:32>> [music]
- 21:33>> Data acquisition does not end at reading
- 21:36a sensor. Realtime [music] streaming
- 21:39means sensor readings flow continuously
- 21:42each with a time stamp. A buffer or Q
- 21:45[music] temporarily stores data when the
- 21:47network is slow or down. So readings are
- 21:50not lost. That is exactly the pushpull
- 21:52idea. Sampling rate [music] matters.
- 21:55According to the Nyquis theorem, we must
- 21:57sample at least twice the highest
- 21:59frequency in the signal. The [music]
- 22:01challenges in IoT data acquisition are
- 22:04noise, missing values, sensor drift
- 22:07[music] over time, and the need for
- 22:08calibration,
- 22:10plus limited battery power, [music]
- 22:12limited bandwidth, latency, and
- 22:14heterogeneous data coming in different
- 22:16formats from different sensors.
- 22:20[music]
- 22:20Chapter 6, a gallery of every sensor and
- 22:23actuator you used in the lab.
- 22:27The [music] DHT11
- 22:28measures temperature and humidity.
- 22:31Inside it has a capacitive humidity
- 22:34sensor [music] and an NTC thermister
- 22:36whose resistance falls as temperature
- 22:38rises. An internal chip converts both
- 22:41[music] readings into a digital signal
- 22:43sent on a single data wire. Each reading
- 22:46is 40 bits. 16 bits of humidity, 16
- 22:50[music] bits of temperature and an 8 bit
- 22:52checksum to detect errors. It measures 0
- 22:55to 50° C, [music] accurate to plus -2°
- 22:59and 20 to 90% relative humidity. It
- 23:03should be read at most once every
- 23:05second. [music] Its big brother, the
- 23:07DHT22,
- 23:08is more accurate and has a wider range.
- 23:12The IR obstacle sensor detects [music]
- 23:15whether an object is present in front of
- 23:17it. It has an infrared LED [music] that
- 23:21transmits and a photo diode that
- 23:23receives. When an object is present,
- 23:25[music] infrared light reflects off it
- 23:28and reaches the photo diode. [music] An
- 23:30LM393
- 23:32comparator compares the received signal
- 23:34with a reference [music] set by the
- 23:36potentiometer. Turning the potentiometer
- 23:38changes the detection distance. The
- 23:41output is digital and usually active
- 23:43low. [music] LOW means obstacle
- 23:46detected. High means no obstacle. Always
- 23:48mention that it depends on the module.
- 23:51Its range is about 2 to [music] 30 cm.
- 23:54It can be fooled by sunlight and black
- 23:56surfaces absorb [music] infrared so they
- 23:59are harder to detect.
- 24:02The [music] MQ2 gas sensor is used for
- 24:04gas leakage detection. It detects LPG,
- 24:08methane, propane, smoke, and hydrogen.
- 24:12It contains a [music] thin dioxide
- 24:14semiconductor layer heated by an
- 24:16internal heater. [music] In clean air,
- 24:18its conductivity is low. When
- 24:20combustible gas is present, conductivity
- 24:23increases. So, resistance falls and the
- 24:26output [music] voltage rises. It has two
- 24:29outputs. A O the analog [music] output
- 24:31gives the gas concentration. Read by
- 24:34analog read from 0 to 1,023. [music] Do
- 24:38the digital output switches when the
- 24:40onboard threshold is crossed. It must be
- 24:42[music] preheated before readings are
- 24:44reliable and calibrated in clean air to
- 24:47[music] avoid false alarms.
- 24:50A few more sensors you may be asked
- 24:52[music] about. An LDR light dependent
- 24:56resistor has a resistance that falls as
- 24:58light increases. High resistance in
- 25:01darkness, [music]
- 25:01low resistance in bright light. We put
- 25:04it in a voltage divider with a 10 kilo
- 25:07ohm resistor and read the middle point
- 25:09[music] on pin as zero. LM35 is an
- 25:13analog temperature sensor. It gives 10
- 25:16molts per degree [music] C. So 300 m
- 25:19volts means 30°.
- 25:21The ultrasonic sensor [music] HCSR04
- 25:25sends a 40 kohertz sound pulse [music]
- 25:27and measures the time until the echo
- 25:30returns. Distance equals speed of sound
- 25:33multiplied by time divided by 2 because
- 25:36the sound travels to the object and
- 25:38back. In code it is time in microsconds
- 25:41[music] time 0.0343
- 25:44divided by 2 giving cm.
- 25:48Now [music] actuators an actuator
- 25:50converts an electrical control signal
- 25:52into [music] a physical action. An LE
- 25:56needs a resistor in series to limit
- 25:58current with a 5V supply. an LED drop of
- 26:01about 2 volts and 20 milliamps of
- 26:03current. [music] R is 3 volt divided by
- 26:06002 which is 150 ohms. So we use the
- 26:10next [music] safe value 220 ohms. A
- 26:14buzzer gives an audible alert and an LE
- 26:16[music]
- 26:17gives a visual alert. Using both is
- 26:19redundancy. So the alert is noticed
- 26:21either [music] way. A relay lets a small
- 26:245V pin safely switch a high voltage load
- 26:27[music] like a fan, a pump or a gas
- 26:30solenoid valve and servos, [music]
- 26:32DC motors and solenoid valves produce
- 26:35movement.
- 26:38[music] Chapter 7, cloud platforms and
- 26:41edge computing.
- 26:43Let's look [music] at the big IoT cloud
- 26:46platforms. A WSOT core from Amazon
- 26:50provides a managed MQTT [music] broker,
- 26:53device shadows that store the last known
- 26:55state of a device, and a rules engine
- 26:58that routes data to other AWS services.
- 27:01Microsoft [music] Azure IoT hub provides
- 27:04device twins, device to cloud and cloud
- 27:07to device messaging and the device
- 27:09provisioning service. Google Cloud IoT
- 27:12[music] core was retired in August 2023.
- 27:16That is a great point to impress your
- 27:18examiner. Google now relies on PubSub
- 27:20and partner platforms for [music] IoT.
- 27:23For student projects, things speak,
- 27:26Blink and Adafruit IO are simple and
- 27:28free to start. Common cloud [music]
- 27:30services include storage, analytics,
- 27:33machine learning, visualization, and
- 27:35alert [music] rules.
- 27:38Now, the compute stack from devices to
- 27:40the cloud. At the bottom, devices and
- 27:44sensors generate [music] data. Edge
- 27:46computing processes data right on the
- 27:49device or the gateway [music]
- 27:50where it is generated, giving responses
- 27:53in milliseconds. Our Raspberry Pi acts
- 27:55as the edge device. Vog computing is the
- 27:59layer in between. It uses local nodes,
- 28:02routers, and [music] servers in the
- 28:03local network to process data from many
- 28:06edge devices. The term was coined by
- 28:08Cisco. The cloud sits at the top with
- 28:11[music] massive storage and computing
- 28:13used for training models and long-term
- 28:15analysis. One line, edge is on the
- 28:17device, fog is near the device, cloud
- 28:20[music] is far away.
- 28:23Edge versus cloud, five points.
- 28:26Location, [music] edge is near the
- 28:28device. Cloud is in a remote data
- 28:30center. Latency edge is very low in
- 28:34[music] milliseconds because there is no
- 28:35round trip. Cloud is higher. Bandwidth
- 28:39edge sends only useful or summarized
- 28:41data. [music] Cloud receives all raw
- 28:43data. This is bandwidth optimization.
- 28:46Offline edge [music] keeps working even
- 28:49when the internet is down. Cloud needs
- 28:51connectivity.
- 28:52Privacy. With edge, raw data stays
- 28:55local, which enhances privacy. [music]
- 28:57These four benefits: latency, bandwidth,
- 29:00reliability, and privacy are exactly
- 29:02what your syllabus lists.
- 29:06>> [music]
- 29:06>> Chapter 8. Intelligent IoT or IoT.
- 29:11A IoT [music]
- 29:13means combining artificial intelligence
- 29:15with the internet of things. IoT [music]
- 29:18gives the senses. It collects data. I
- 29:21gives the brain. It learns from data and
- 29:23takes decisions. Why do we need
- 29:25intelligent [music] analytics? Because
- 29:27IoT generates data that is too large and
- 29:30too fast for humans to analyze manually.
- 29:34A I is used for [music] three main
- 29:35tasks. Prediction like future
- 29:38temperature. Classification like
- 29:40recognizing an activity [music] and
- 29:41anomaly detection like spotting a faulty
- 29:44machine. Examples include predictive
- 29:47[music] maintenance, smart traffic
- 29:49control and health alerts from
- 29:50wearables. And tiny [music] ML is the
- 29:54trend of running small machine learning
- 29:56models directly on microcontrollers.
- 29:58[music] The ultimate edgeri.
- 30:02The syllabus specifically lists three
- 30:04challenges of IoT [music] data. Noisy,
- 30:06incomplete and heterogeneous.
- 30:09Noisy data has random fluctuations
- 30:11[music] caused by electrical
- 30:13interference or cheap sensors. We handle
- 30:16it with smoothing [music] like a moving
- 30:17average filter. Incomplete data has
- 30:20missing values. When a sensor [music] or
- 30:22network drops out, we handle it by
- 30:24imputation like mean, median, [music]
- 30:27forward fill or interpolation.
- 30:30Heterogeneous data comes from different
- 30:32sensors in different formats, units
- 30:34[music] and sampling rates. We handle it
- 30:36by standardizing formats, converting
- 30:39units and aligning timestamps. [music]
- 30:41We also deal with outliers, duplicate
- 30:44records and misaligned timestamps.
- 30:48Predictive [music] analytics using
- 30:50machine learning follows a clear
- 30:52pipeline. Collect sensor data with
- 30:55timestamps. [music]
- 30:56Clean it by handling missing values,
- 30:59duplicates, and outliers.
- 31:01Engineer [music] features like previous
- 31:03values called lags, rolling averages,
- 31:06and time of day. Train a [music] model
- 31:08like linear regression, random forest,
- 31:11or an LSTM for time series. Evaluate it
- 31:15with metrics like [music] ME, RMS, and R
- 31:18squar, and deploy it [music] to make
- 31:21predictions and trigger alerts in real
- 31:23time.
- 31:26Chapter nine, [music]
- 31:27security in the internet of things.
- 31:31Security is a major part of part B.
- 31:33First three [music] terms, a threat is a
- 31:36possible attack. A vulnerability is a
- 31:39weakness [music] that the attack can
- 31:40exploit. And risk combines them. Risk
- 31:44equals [music] threat time vulnerability
- 31:46time impact. If any one of these is
- 31:48zero, risk is low. The most common
- 31:51vulnerability is [music] weak or default
- 31:53passwords. In 2016, the Marai botnet
- 31:57infected [music] hundreds of thousands
- 31:58of cameras and routers using default
- 32:01passwords and used them to take down
- 32:03major websites. Unencrypted [music]
- 32:05traffic allows sniffing and
- 32:07maninthe-middle attacks where the
- 32:09attacker secretly [music] sits between
- 32:11device and server. Other threats include
- 32:14denial of service, device spoofing,
- 32:17firmware [music] tampering, and physical
- 32:18attacks on devices and vulnerabilities
- 32:22like missing updates, [music]
- 32:23insecure a PIS and badly configured
- 32:26cloud storage.
- 32:29Security goals [music] are summarized by
- 32:31the CIA triad. Confidentiality only
- 32:35authorized parties can read the data
- 32:37achieved by encryption. Integrity data
- 32:41is not altered in transit. achieved by
- 32:43hashes and [music] message
- 32:44authentication codes. Availability. The
- 32:48system works when needed, [music]
- 32:49protected against denial of service.
- 32:52Now, a classic question. [music]
- 32:54Authentication answers, who are you? It
- 32:56verifies identity using a password,
- 32:59token or [music] certificate.
- 33:01Authorization answers, what are you
- 33:03allowed to do? [music] It happens after
- 33:05authentication using access control
- 33:08lists. For example, a sensor may publish
- 33:10to its own [music] topic but not to
- 33:12others. Authentication first, then
- 33:14authorization.
- 33:17Encryption converts readable [music]
- 33:19plain text into unreadable cipher text.
- 33:22There are four categories to know.
- 33:24Symmetric encryption uses [music] the
- 33:26same secret key to encrypt and decrypt.
- 33:29A ES is the standard. [music] It is
- 33:31fast, so it encrypts the actual data.
- 33:34Asymmetric encryption uses a key pair.
- 33:37Data encrypted with the public key can
- 33:39only be decrypted with the [music]
- 33:40private key. RS and elliptic curve
- 33:43cryptography are examples. ECC is
- 33:46preferred in IoT [music] because it
- 33:48gives the same security with much
- 33:50smaller keys. Hashing is one way. It
- 33:53produces [music] a fixed size digest
- 33:55like SH at 256. You cannot reverse it.
- 33:59[music] It is used for integrity checks
- 34:00and storing passwords. and lightweight
- 34:03cryptography like ASCAN [music]
- 34:05chosen by NIST in 2023 is designed for
- 34:09very constrained [music]
- 34:10devices.
- 34:13How does TLS transport layer security
- 34:16actually secure connection [music]
- 34:18through the handshake? The client sends
- 34:20a client hello with the cipher [music]
- 34:22suites it supports and a random number.
- 34:25The server replies with a server hello
- 34:28and its [music] digital certificate
- 34:29signed by a certificate authority. The
- 34:32client verifies it. This is server
- 34:34authentication. [music] Then both sides
- 34:37perform a key exchange, usually elliptic
- 34:39curve defy helman to agree on a shared
- 34:42secret without ever sending it on
- 34:44[music] the network. Both derive session
- 34:47keys and send finished messages. From
- 34:50now on, all data is encrypted with a
- 34:52[music] fast symmetric cipher like a ES.
- 34:55TLS thus gives confidentiality, [music]
- 34:58integrity, and authentication. In mutual
- 35:00TLS, the client also presents a
- 35:03certificate.
- 35:05What about UDP? TLS [music] needs the
- 35:08reliability of TCP. So for UDP, we use
- 35:12DTLS.
- 35:14DTLS [music]
- 35:15datagramgram transport layer security
- 35:18gives the same security as TLS but over
- 35:21UDP.
- 35:22It [music] adds its own sequence numbers
- 35:24and retransmission of handshake messages
- 35:27because UDP can lose or reorder [music]
- 35:30packets. It is used to secure co-ap.
- 35:33Secure co-ap runs on port [music] 5684.
- 35:37Memorize the ports. MQTT is 1883. Secure
- 35:41MQTT is 8883. [music]
- 35:44HTTP is 80. HTTPS is 443. And remember
- 35:49SSL [music] is the old insecure
- 35:52predecessor of TLS. Today we use TLS
- 35:55version 1.3.
- 35:58[music]
- 35:59Chapter 10. The application layer
- 36:02protocols.
- 36:04HTTP [music]
- 36:05is the protocol of the web and also used
- 36:08in IoT. It follows [music] the request
- 36:11response model over TCP. Its headers are
- 36:14text based which makes it heavy for tiny
- 36:17devices.
- 36:18>> [music]
- 36:19>> HTTPS is simply HTTP over TLS on port
- 36:24443.
- 36:25REST representational state transfer
- 36:27[music] is an architectural style. Every
- 36:30resource like a sensor has a URI and
- 36:33each request is stateless [music]
- 36:35carrying all the information needed.
- 36:37Rest uses HTTP methods. Get to read,
- 36:41post to create, put [music] to update,
- 36:43delete to delete. For example, get /
- 36:45sensors/ temperature and status codes.
- 36:49200 is okay, [music] 201 is created, 404
- 36:53is not found, 500 is server error.
- 36:58MQTT is the most [music] important
- 37:01protocol for your orals. It stands for
- 37:03message queuing telemetry transport
- 37:05[music] created by IBM in 1999.
- 37:09It follows publish subscribe [music]
- 37:11through a broker like MSquido, Hive MQ
- 37:14or EMQX.
- 37:16It runs on TCP [music] port 1883 or 8883
- 37:20with TLS. Its fixed header is just two
- 37:23bytes which is why it is so lightweight.
- 37:25[music]
- 37:26Topics are hierarchical strings
- 37:28separated by slashes like home/ room
- 37:311/mp. A [music] subscriber can use wild
- 37:34cards. Plus matches exactly one level
- 37:36and hash [music] matches all remaining
- 37:38levels. Quality of service has three
- 37:41levels. CO0 at most once, fire [music]
- 37:44and forget. Go S1 at least once
- 37:46acknowledge, but duplicates are
- 37:48possible. Go S2 exactly once using a
- 37:51four-step handshake. [music] The safest
- 37:53but slowest. A retained message is
- 37:56stored by the broker and given
- 37:57immediately to new [music] subscribers.
- 37:59The last will and testament is a message
- 38:02the broker publishes if a client
- 38:04disconnects unexpectedly and keep alive
- 38:06pings tell the broker the client is
- 38:08still alive. [music]
- 38:10Finally, a persistent session lets the
- 38:12broker remember subscriptions [music]
- 38:14and cued messages for a client that
- 38:16reconnects.
- 38:19Three [music] more protocols.
- 38:21Co-op the constrained application
- 38:23protocol is like rest for tiny devices.
- 38:26It runs on UDP port [music] 5683 with a
- 38:30four byte header and supports get, post,
- 38:32put, and delete. Co-op messages [music]
- 38:35can be confirmable, non-confirmable,
- 38:38acknowledgement, or reset. Its observe
- 38:40option lets [music] a client subscribe
- 38:42to changes of a resource. A MQP,
- 38:46advanced message queuing protocol, is
- 38:48for [music] enterprise messaging.
- 38:50producers send to exchanges which route
- 38:52messages into cues based on rules
- 38:54[music] port 5672.
- 38:57It is very reliable with routing and
- 38:59transactions. Rabbit MQ is the famous
- 39:02broker. XMPP [music]
- 39:05the extensible messaging and presence
- 39:07protocol is XMLbased. It was built for
- 39:10realtime chat and presence like whether
- 39:12a user is online. [music] It is heavier
- 39:14due to XML on port 5222.
- 39:19Let's compare all five in one table. A
- 39:22[music] screenshot of this in your mind
- 39:24is worth many marks. Transport only
- 39:27co-op uses UDP. All others use TCP.
- 39:31[music] Model MQTT is publish subscribe.
- 39:34Co-op and HTTP are request response.
- 39:38Co-op with observe. A MQP uses Q's.
- 39:40[music] XMPPP supports both publish
- 39:43subscribe and pointtooint.
- 39:46Wait. [music] MQTT and co-op are very
- 39:48lightweight. HTTP, A MQP and XMPPP are
- 39:52heavier. Security [music] co-op uses
- 39:55DTLS. The others use TLS with SSL for
- 40:00authentication in a MQP and [music]
- 40:02XMPP.
- 40:04and best use. MQTT for telemetry, co-op
- 40:08for highly constrained nodes, HTTP
- 40:10[music] for web, a PIS, a MQP for
- 40:13enterprise, XMPP for chat and presence.
- 40:18[music] Chapter 11. Privacy in IoT
- 40:21systems.
- 40:24Privacy [music] is different from
- 40:25security. Security protects data from
- 40:27attackers. Privacy protects people from
- 40:30misuse of their data even [music] by
- 40:32authorized parties.
- 40:34IoT devices collect identity, location,
- 40:37health data, behavior patterns, and even
- 40:40audio and video. The risks [music] are
- 40:43profiling, tracking, inference attacks,
- 40:45surveillance, and data leaks. For
- 40:47example, a smart meter's power pattern
- 40:49[music] can reveal when you are at home
- 40:51and even when you are sleeping. The
- 40:54challenges are that sensing is always on
- 40:56and many devices have no screen [music]
- 40:59to ask for consent. Laws protect us. The
- 41:02GDPR in Europe and in India. The digital
- 41:06personal data [music] protection act
- 41:072023.
- 41:10How do we preserve privacy? [music]
- 41:12Seven techniques. Data minimization.
- 41:15Collect only the data truly needed for
- 41:18the purpose. This is your assignment.
- 41:20Five. Anonymization removes identity
- 41:23completely. Pseudonymization replaces
- 41:26identity with a code [music] which can
- 41:28be reversed only with a separate key.
- 41:31Encryption both at rest in storage and
- 41:33in transit over the network. [music]
- 41:36Edge processing so raw data never leaves
- 41:38the device. Only results are sent.
- 41:41Differential [music] privacy adds
- 41:43carefully calibrated noise to data or
- 41:46results. So no individual can be
- 41:48identified [music]
- 41:49while overall patterns remain accurate.
- 41:52Federated learning trains a shared
- 41:53[music] model by sending model updates
- 41:56not raw data to the server. And finally,
- 41:59[music] consent, strict access control,
- 42:02and limited data retention. All of these
- 42:04together form privacy by design.
About this transcript
This page contains the full transcript of IoT Viva Theory from Scratch | Complete Internet of Things in 42 Min | SPPU TE AI&DS 2024 Pattern by Pranav Malshikhare, generated from the public captions YouTube serves with the video. The transcript has 5,640 words across 971 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.