Unit II Notes
Unit II Notes
Department of
Electronics and Communication Engineering
(NBA Accredited)
Y. JEEVAN
Assistant Professor
JEEVAN YANDA 1
Fundamentals of Internet of Things
JEEVAN YANDA 2
Fundamentals of Internet of Things
UNIT-II
Machine-to-Machine Communications:
JEEVAN YANDA 3
Fundamentals of Internet of Things
JEEVAN YANDA 4
Fundamentals of Internet of Things
JEEVAN YANDA 5
Fundamentals of Internet of Things
repairs and firmware upgrades to system diagnostics, data retrieval, and analysis.
Information will be delivered to users, engineers, data scientists, and key decision-makers
in real time, and it will eliminate the need for guesswork.
There are different M2M applications, environment monitoring, civil protection and public
safety, supply chain management, energy and utility distribution as in smart grid, smart grid
separately common. we have intelligent transportation systems, healthcare, automation of
buildings, military applications, agriculture, home networks all these are different applications
of M2M.
M2M features:
➢ Large number of nodes or devices
➢ Low cost
➢ Energy efficient
➢ Small traffic per device/machine
➢ M2M communication free from human intervention
General Architecture of M2M Systems:
➢ M2M device connects to the network domain via direct connectivity or M2M
gateway. In the first case, the M2M device connects to the network domain via the
access network, which performs the procedures such as registration, authentication,
authorization, management, and provisioning with the network domain. In the second
case, the M2M device connects to the M2M gateway using the M2M area network.
➢ M2M area network provides connectivity between M2M devices and M2M gateways.
➢ M2M gateway acts as a proxy between M2M devices and the network domain. As
an example, an M2M gateway can run an application that collects and treats various
information (e.g., contextual parameters) from sensors and meters.
➢ M2M communication network provides connection between the M2M
gateways/devices and theM2M servers. Usually it contains two parts: the access
network and the Internet.
➢ M2M server works as a middleware layer to pass data through various application
services.
JEEVAN YANDA 7
Fundamentals of Internet of Things
➢ The "Things" in IoT refers to physical objects that have unique identifiers and can
sense and communicate with their external environment (and user applications) or their
internal physical states.
➢ M2M systems, in contrast to IoT, typically have homogeneous machine types
within an M2M area network.
JEEVAN YANDA 8
Fundamentals of Internet of Things
JEEVAN YANDA 9
Fundamentals of Internet of Things
Arduinos are great devices that can be used for creating interactive projects. They can either
be used alone to create basic projects or they can be integrated with Arduino, Raspberry Pis,
NodeMCU, or nearly anything else using some programming in their software to create some
advanced level of projects. It is good to know the specifications of different Arduino so that
you can select the right Arduino for your project.
Arduino Hardware
Arduino hardware
➢ Microcontroller: The Microcontroller controls the execution of all the programs and
codes uploaded on Arduino. The microcontroller is equipped with components that
can perform different functions.
➢ USB port: This port is used to establish a connection between the computer and the
Arduino board.
➢ USB to Serial chip: The USB to Serial port is used for adding data from the computer
to the microcontroller. This is how the code is uploaded from the computer to the
Arduino board.
➢ Digital pins: These pins are used for turning the LEDs on and off by using digital
logic ('0' and '1').
➢ Analog pins: These pins are used for taking analog input.
➢ 5V / 3.3V pins: These pins are used for supplying power to devices.
➢ GND: This pin is used for setting a reference level.
Basic Operation
JEEVAN YANDA 10
Fundamentals of Internet of Things
Most of the Arduino can perform a single task using the help of a microcontroller. These
tasks can be performed in a cycle as defined by the variables. This basic task can be from
blinking an LED to rotating a motor. This is how the loop in the setup will be defined
➢ Set the sensor to read the input.
➢ Program the Arduino to turn on the light.
➢ Verify all the conditions.
➢ Depending on all the delays introduced, the program takes around microseconds to
execute.
Circuit Basics
Consider this basic LED circuit
JEEVAN YANDA 11
Fundamentals of Internet of Things
JEEVAN YANDA 12
Fundamentals of Internet of Things
void setup() {
//Programs like including libraries
}
loop() It includes the programs that will run when the board is in an "ON" state.
void loop() {
//main program here
}
delay() This is used to add a pause in the function for a certain millisecond as required. The
code snippet shows the use of the delay function.
void loop() {
void setup() {
// Any necessary setup can be done here
}
void loop() {
// Record the current time since the program started
unsigned long currentTime = millis();
// Check if it's time for the first event
if (currentTime - firstEventTime >= firstEventInterval) {
// Update the time of the first event
firstEventTime = millis();
// Execute code for the first event every 5 seconds
}
JEEVAN YANDA 13
Fundamentals of Internet of Things
Example Sketch
Sketch is the whole project you created in your IDE. Note that when you save your project,
it is saved with the extension of .ino.
sample sketch to turn on the LED.
int sensor in = A1; //analog pin at A1
int ledPin = 5; //digital pin at pin 5
int sensorValue;
//configurations the sketch
void setup() {
Serial.begin(9600); //initialize serial communication
pinMode(ledPin, OUTPUT); //define output pin
}
void loop() {
sensorValue = analogRead(sensorPin);
Serial.print("Sensor value is: "); //print a message
Serial.println(sensorValue); //print the value to the serial monitor
//conditional statements
if(sensorValue < 100) {
digitalWrite(ledPin, HIGH); //turn on the LED on pin 5.
}
else{
digitalWrite(ledPin, LOW);
}
}
Why choose Arduino? Advantages of Arduino.
➢ Arduino is the best choice for starting your programming journey in electronics. Its
easy-to-use interface allows users to build simple projects on their own.
➢ There is no need for experience or hands-on experience in electronics before starting
work on Arduino. Anyone with a genuine interest in Arduino can begin learning
through simple tutorials and some guidance. These tutorials are available free of cost
for creating some beginner-level and advanced projects.
➢ Arduinos offer a wide range of options. You can use Arduino alone to create some
projects or you can add some extra features by integrating it with other devices like
Raspberry Pie.
JEEVAN YANDA 14
Fundamentals of Internet of Things
➢ Arduino is an open-source tool that can be accessed from different locations and
platforms. Due to the inexpensive nature of Arduinos, they can be used on different
microcontrollers like Atmel's ATMEGA 16U2 microcontrollers.
➢ Depending on the need of your project, you can avail of any Arduino that satisfies
the needs. These Arduino are available in different designs that offer different size
ranges, power, and specifications.
What Can You Do With an Arduino? Applications:
➢ Arduinos are used in 3D printing where they perform the task of selecting how the
printing will be performed.
➢ Arduinos are used for creating basic designs by makers, designers, hackers, and
creators across the globe to create some great projects. Some of the projects are Laser
Turret Midi Controller, Retro Gaming With an OLED Display, and Traffic Light
Controller.
➢ Arduinos are used by college students to understand programmable electronics and
to explore their interest in programming.
➢ Arduinos are used in the field of robotics for programming robots and adding basic
features like sensing and responding to environmental conditions.
➢ Arduino is used in IoT(Internet of Things) since it can collect information using
sensors. The collected data is then processed and transmitted for developing various
smart devices.
Structure of Arduino
Different Arduino are designed to serve different purposes but some basic components are
needed in every Arduino. Note that Arduino Uno is the most used board and is the most
common choice for different users.
Internal structure of the Arduino Uno model.
➢ Processor: 16 Mhz ATmega16U2
➢ Flash memory: 32KB
➢ Ram: 2KB
➢ Voltage Needed: 5V
➢ Input Voltage: 7-12V
➢ Analog input pins: 6
➢ Number of digital I/O: 14 with 6 of them being PWM pins
➢ Components of Arduino
Basic components of Arduino:
Breadboard:
Breadboards are used to provide a base for setting up the connecting components together.
If you look at a breadboard, is a plastic block made up of holes that are left for making
connections using wires. The internal of the breadboard consists of different connections that
are hidden. They are generally used for smaller circuits
LEDs(Light Emitting Diode):
LEDs are small devices that illuminate when a small voltage is supplied to them. These
LEDs come in a variety of colors ranging from red to green. These LEDs can be used for
testing minimum voltages since they don't burn for a long period.
JEEVAN YANDA 15
Fundamentals of Internet of Things
Photo Resistor:
Many Arduinos contain a photoresistor that is used for measuring changes in light using
Arduino.
Tactile Switch:
This switch resembles a button that is used to open or close a circuit like any other switch.
When the button is turned on, the voltage of Arduino increases from 0V to +5V. This voltage
change acts as a trigger for the Arduino and an Arduino detects this change momentarily
since the switch is then turned off when the button is released.
Microcontroller:
An Arduino consists of a microcontroller that controls the whole functioning of the Arduino
by generating an apt output corresponding to the input code. Depending on the type of
Arduino board you are using, you can select a microcontroller that fits well.
Resistors:
Resistors are used to resist the flowing electricity. Resistors are often bought to set a limit to
the current flowing in the circuit thereby protecting the components of the circuit from
getting burnt due to excessive current.
Jumper Wires:
Jumper wires are thin wires covered with a plastic covering for insulation. These wires are
used for connecting different components in the breadboard.
Setting Up Your Arduino
This is an essential step since it allows your computer to communicate with Arduino. Make
sure you have a tested and working Arduino board before connecting it to your computer.
Any duplicate Arduino will need some modifications in the installation process. Let us see
how to connect the Arduino to the computer for the execution of the code.
Installing the Arduino Software Package
To install the Arduino software, you need to visit the official website and download the latest
version that is valid for your computer.
Steps to be followed for installing Arduino Integrated Development Environment (IDE).
Windows Setup
➢ Plug in your board to the computer and you will see a driver installation setup box
on the screen. You can grant access to connect the Arduino to the computer and case
it fails
➢ Go to the Start Menu and select Control Panel.
➢ Go to System and Security > System. After this open up the device manager.
➢ If you carefully observe the ports, there will be an open port associated with
the connected Arduino named Arduino UNO (COMxx).
➢ Right-click on the name (Arduino UNO (COMxx) in this case) and select
Update Driver Software.
➢ Search for Driver software by selecting Browse my computer.
➢ Search for the Uno's driver file, which will be named ArduinoUNO.inf,
located in the Drivers folder of the Arduino Software download.
Running the Arduino Software
JEEVAN YANDA 16
Fundamentals of Internet of Things
Since our software has been installed, it is our time to check whether the setup is correct and
that our Arduino is working well. To do this, we will use the "Blink" sample application
Once the Arduino application has been installed on your device, open the software for the
associated Arduino. Then follow these steps:
➢ Connect your Arduino board to your computer using some connecting cable.
➢ The software icon will appear at the location where you have installed the Arduino
application. Double-click it to open the interface.
➢ Follow the order File > Examples > Basics > Blink
➢ When you open the application, the screen will show the code written for your
Arduino. Now you have to get this code on the Arduino
➢ To upload code on Arduino select Tools-> Board and then choose the required
Arduino model like Arduino Uno.
➢ After this, you need to specify the serial port from which the board will take data. Go
to Tools-> Serial Port and then select the port. Windows users can select port COM3
or similar, and Mac or Linux users can select /dev/tty.usbmodem.
➢ Carefully look at the left portion of the screen and you will see the Upload button,
click on it.
➢ After a brief period you will observe receiving(RX) and transmitting(RX) LEDs on
the Arduino illuminating with a "Done uploading" message on the screen.
➢ If this doesn't appear, there must be some error so follow the steps carefully again.
JEEVAN YANDA 17