IoT Unit-3
IoT Unit-3
(IoT)
Internet of Things(IoT) - Syllabus
Lecture Details:
Fundamentals of IoT
Branch: CSE/CSM/CS
Semester: III-II
Cont..
• It ensures that the project is efficient, scalable, secure, and meets the
user’s requirements
• This method can then be used to plan your own projects and take
them to the next level.
Cont..
Step 1:
• Purpose & Requirements Specification: Define the purpose and requirements
of the system. In this step, the system purpose, behavior and requirements
(such as data collection requirements, data analysis requirements, system
management requirements, data privacy and security requirements, user
interface requirements, ...) are captured.
Step 2:
• Process Specification:. In this step, the use cases of the IoT system are formally
described based on and derived from the purpose and requirement
specifications are captured.
Cont..
Step 3:
• Domain Model Specification: Domain model defines the attributes of the objects
and relationships between objects. Domain model provides an abstract
representation of the concepts, objects and entities in the IoT domain,
independent of any specific technology or platform. With the domain model, the
IoT system designers can get an understanding of the IoT domain for which the
system is to be designed.
Step 4:
• Information Model Specification: Information Model defines the structure of all
the information in the IoT system, for example, attributes of Virtual Entities,
relations, etc. Information model does not describe the specifics of how the
information is represented or stored. To define the information model, we first
list the Virtual Entities defined in the Domain Model. Information model adds
more details to the Virtual Entities by defining their attributes and relations.
Cont..
Step 5:
• Service Specifications: Service specifications define the services in the IoT
system, service types, service inputs/output, service endpoints, service
schedules, service preconditions and service effects.
Step 6:
• IoT Level Specification: The sixth step in the IoT design methodology is to define
the IoT level for the system.
Step 7:
• Functional View Specification: The Functional View (FV) defines the functions of
the IoT systems grouped into various Functional Groups (FGs). Each Functional
Group either provides functionalities for interacting with instances of concepts
defined in the Domain Model or provides information related to these concepts.
Cont..
Step 8:
• Operational View Specification: In this step, various options pertaining to the IoT
system deployment and operation are defined, such as, service hosting options,
storage options, device options, application hosting options, etc.
Step 9:
• Device & Component Integration: The ninth step in the IoT design methodology
is the integration of the devices and components.
Step 10:
• Application Development: The final step in the IoT design methodology is to
develop the IoT application.
Cont..
• The embedded devices are the objects that build the unique
computing system. These systems may or may not connect
to the Internet.
• The most important factor that differentiates these microcontrollers with the
microprocessor like 8085 is their internal read and writable memory.
• The embedded system that uses the devices for the operating system is based
on the language platform, mainly where the real-time operation would be
performed.
MICROCONTROLLERS
MICROCONTROLLERS
Cont..
MICROCONTROLLERS
Cont..
MICROCONTROLLERS
Cont..
MICROCONTROLLERS
Cont..
MICROCONTROLLERS
Cont..
MICROCONTROLLERS
• Bit depth: The register and data path width impacts the speed and accuracy
with which microcontrollers can perform non-trivial computations.
MICROCONTROLLERS
• This IoT SoC supports WLAN, bluetooth and Zigbee systems on a single chip. It
also supports 2.4 and 5GHz radio frequencies.
• As we have seen in IoT tutorial any IoT compliant system will have two major
parts viz. front end and back end.
• Front end provides connectivity with physical world and consists of sensors while
backend consists of processing and network connectivity interfaces.
Cont..
• Typical IoT system on chip support more than one RATs (Radio Access
Technologies). It will have following modules.
• Transmit and receive switch.
• RF part mainly consists of Transmitter, receiver, oscillator and amplifiers.
• Memories i.e. Program memory, data memory to store the code and
data
• Physical layer(baseband processing) either on FPGA or on processor
based on complexity and latency requirement.
• MAC layer and upper protocol stacks TCP/IP etc. running on processor
• ADC and DAC to provide interface between digital baseband and analog
RF portions.
• Various interfaces such as SDIO, USB, SPI etc., to provide interface with
the host.
• Other peripherals such as UART, I2C, GPIO, WDT etc. to use the IoT SoC
for various connections.
Cont..
• Figure depicts one such IoT System on Chip model no. RS9113,which has been
designed and developed by Redpine Signals recently. It supports WLAN
(802.11n), Bluetooth version 4.0 and Zigbee (802.15.4-2006) in the same chip.
Hence the IoT device can be connected with any of the said wireless technology
based networks.
Cont..
• This IoT SoC (system on chip in IoT) can be used for numerous applications as
mentioned below:
• Mobile
• M2M-Communication
• Real time location finding tags
• Thermostats
• Smart meters
• Wireless sensor devices
• Serial to Wi-Fi converter
• Voice Over Wi-Fi compliant phones
• Home automation
• Health care devices and equipments
Cont..
1. Sensors,
2. Processors,
3. Gateways,
4. Applications.
Processors:
• Processors are the brain of the IoT system. Their main function is to
process the data captured by the sensors and process them so as to extract
the valuable data from the enormous amount of raw data collected. In a
word, we can say that it gives intelligence to the data.
Gateways:
• Gateways are responsible for routing the processed data
and send it to proper locations for its (data) proper utilization.
Applications:
• Applications form another end of an IoT system.
Applications are essential for proper utilization of all the data
collected.
ARDUINO
ARDUINO
Arduino UNO is a
microcontroller board based
on the ATmega328P.
• 14 digital input/output
pins (of which 6 can be
used as PWM outputs), 6
analog inputs, a 16 MHz
ceramic resonator, a USB
connection, a power jack,
an ICSP header and a reset
button.
AURDINO UNO R3 BOARDS Cont..
Power USB
Arduino board can be powered by using the USB cable from your
computer. All you need to do is connect the USB cable to the
USB connection
Power (Barrel Jack)
Arduino boards can be powered directly from the AC mains
power supply by connecting it to the Barrel Jack.
Voltage Regulator
The function of the voltage regulator is to control the voltage
given to the Arduino board and stabilize the DC voltages used by
the processor and other elements.
Cont..
AURDINO UNO R3
BOARDS-PIN OUT
DIAGRAM
Cont..
AURDINO UNO/ Example2
1 POWER USB
2 POWER (BARREL
JACK)
3 VOLTAGE
REGULATOR
4 CRYSTAL
OSCILLATOR
5 Arduino Reset
6,7,8,9 Pins (3.3, 5, GND,
Vin)
10 Analog pins
11 Main
microcontroller
12 ICSP pin
13 Power LED
indicator
14 TX and RX LEDs
Cont..
Description of Arduino Uno board
1: Power USB
Arduino board can be powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection
2: Power (Barrel Jack)
Arduino boards can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack.
3: Voltage Regulator
The function of the voltage regulator is to control the voltage given to the
Arduino board and stabilize the DC voltages used by the processor and other
elements.
4: Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. Arduino
calculate time by using the crystal oscillator. It uses 16MHz.
5, 17: Reset
You can reset your Arduino board, i.e., start your program from the
beginning(pin-17) and external reset button to the Arduino(pin-5)
Cont..
Description of Arduino Uno board
6: Supply 3.3V output Voltage
7: Supply 5V output Voltage
8: Ground(GND):There are several GND pins on the Arduino, any of which can be used
to ground your circuit.
9: Vin :This pin also can be used to power the Arduino board from an external power
source, like AC mains power supply.
10: Analog Pins: The Arduino UNO board has six analog input pins A0 through A5.
These pins can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.
11: Main Microcontroller: Each Arduino board has its own microcontroller, it as the
brain of your board. The microcontrollers are usually of the ATMEL Company
The information of an IC available on the top of the IC.
12: ICSP(in-circuit serial programming):a tiny programming header for the Arduino
consisting of MOSI (Master Output Slave Input):This signal is used to transfer the data
from master to slave MISO (Master Input Slave Output):
SCK, Serial Clock (SCK) - The clock pulses which synchronize data transmission
generated by the Controller, RESET, VCC, and GND. It is also referred as SPI (Serial
Peripheral Interface)
Cont..
Description of Arduino Uno board
13, 14: Power LED indicator, Tx and Rx LED’s : This LED should light up
when you plug your Arduino into a power source to indicate that your
board is powered up correctly.
TX (transmit) and RX (receive). They appear in two places on the Arduino
UNO board. First, at the digital pins 0 and 1, to indicate the pins responsible
for serial communication.
Second, the TX and RX led (13). The TX led flashes with different speed
while sending the serial data.
The speed of flashing depends on the baud rate used by the board.
RX flashes during the receiving process.
Pin-15: The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as input digital
pins to read logic values (0 or 1) or as digital output pins to drive different modules like
LEDs, relays, etc. The pins labeled “~” can be used to generate PWM.
Pin-16: AREF( Analog Reference: It is sometimes, used to set an external reference
voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
USB cable: The Arduino IDE on our computer and prepare the board to receive
the program via USB cable
Cont..
AURDINO BOARDS
• We can program the Arduino UNO using the Arduino IDE. The
Arduino IDE is the integral development program, which is
common to all the boards.
AURDINO BOARDS
Steps
• The steps to get started with Arduino UNO are listed below:
• But, if you have expanded or downloaded the zip package, follow the
below steps:
Cont..
AURDINO BOARDS
Cont..
AURDINO BOARDS
Cont..
AURDINO BOARDS
Cont..
AURDINO BOARDS
• The pin modes, libraries, variables, etc., are initialized in the setup section.
• It is executed only once during the uploading of the program and after reset
or power up of the Arduino board.
Cont..
AURDINO BOARDS
• The section of code inside the curly brackets is repeated depending on the
value of variables.
Cont..
AURDINO BOARDS
Time in Arduino
• The time in Arduino programming is measured in a
millisecond.
AURDINO BOARDS
Cont..
AURDINO BOARDS
Cont..
AURDINO BOARDS
• pinMode()
• The specific pin number is set as the INPUT or OUTPUT in the pinMode ()
function.
• The syntax is: pinMode(pin, mode) where,
• Pin: It is the pin number. We can select the pin number according to the
requirements.
• Mode: We can set the mode as INPUT or OUTPUT according to the
corresponding pin number.
• Example: We want to set the 13 pin number as the output pin.
• Code:
• pinMode (13, OUTPUT);
Cont..
AURDINO BOARDS
• digitalWrite()
• The digitalWrite () function is used to set the value of a pin as HIGH or LOW.
Where,
• HIGH: It sets the value of the voltage. For the 5V board, it will set the value
of 5V, while for 3.3V, it will set the value of 3.3V.
• LOW: It sets the value = 0(GND).
• If we do not set the pinMode as OUTPUT, the LED may light dim.
• The syntax is: digitalWrite(pin, value HIGH/LOW)
• Pin: We can specify the pin number or the declared variable.
Cont..
AURDINO BOARDS
• Example:
• The HIGH will ON the LED and LOW will OFF the LED connected to pin
number 13.
Cont..
AURDINO BOARDS
• delay()
• The delay () function is a blocking function to pause a program from doing a
task during the specified duration in milliseconds.
• For example, - delay (2000)
• Where, 1 sec = 1000 millisecond
Cont..
AURDINO BOARDS
Cont..
LED BLINK PROGRAM
// the setup function runs once when you press reset or power the board
AURDINO BOARDS
Cont..
Node MCU
An Arduino-like device
Low cost
Cont..
// Pin configuration
const int ledPin = 2; // GPIO2 (D2 on ESP8266, can be different
on ESP32)
SINGLE LED BLINK PROGRAM USING Cont..
WEB
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Connected to Wi-Fi!");
SINGLE LED BLINK PROGRAM USING Cont..
WEB
void loop() {
server.handleClient(); // Handle incoming web requests
}
IDE PROGRAMMING
• IoT programming in IDEs involves creating software for devices like sensors,
actuators, microcontrollers, and gateways. These devices are designed to
connect to the internet and communicate with other devices or cloud services.
IDE PROGRAMMING
2. Firmware Development
•Integrated tools to write firmware for microcontrollers like STM32, ESP32, or
Arduino boards.
•Compatibility with real-time operating systems (RTOS) like Free RTOS.
3. Hardware Integration
•Support for GPIO, I2C, SPI, UART, and PWM for interacting with IoT
peripherals.
•Device simulation for testing without hardware.
Cont..
IDE PROGRAMMING
5. Connectivity
•Tools for setting up Wi-Fi, Bluetooth, Zigbee, or LoRa WAN.
•Cloud SDKs for platforms like AWS IoT, Azure IoT Hub, and Google IoT Core.
Cont..
IDE PROGRAMMING
5. Connectivity
•Tools for setting up Wi-Fi, Bluetooth, Zigbee, or LoRa WAN.
•Cloud SDKs for platforms like AWS IoT, Azure IoT Hub, and Google IoT Core.
Cont..
IDE PROGRAMMING
2.Set Up IDE:
1. Install the IDE and necessary toolchains.
2. Configure board and port settings.
3.Write Firmware:
1. Use the code editor to write or import libraries.
2. Implement communication, data acquisition, and control logic.
Cont..
IDE PROGRAMMING
IDE PROGRAMMING
5.Set Up IDE:
3. Install the IDE and necessary toolchains.
4. Configure board and port settings.
6.Write Firmware:
5. Use the code editor to write or import libraries.
6. Implement communication, data acquisition, and control logic.
Cont..
IDE PROGRAMMING
IDE PROGRAMMING