Unit 2
Unit 2
INTERNET OF THINGS
(III-CSE, SEMESTER-II, R-22)
PREPARED BY-MAGANTI APPARAO
HEAD OF THE DEPARTMENT
ST. MARY’S ENGINEERING COLLEGE
UNIT – II
MACHINE-TO-MACHINE COMMUNICATIONS
Difference between IoT and M2M
Interoperability in IoT
Introduction to Arduino Programming
Integration of Sensors and Actuators with Arduino
INTRODUCTION
Machine to Machine: This is commonly known as Machine to
machine communication. It is a concept where two or more than
two machines communicate with each other without human
interaction using a wired or wireless mechanism.
M2M is a technology that helps the devices to connect between
devices without using internet.
Internet of Things: IOT is known as the Internet of Things
where things are said to be the communicating devices that can
interact with each other using a communication media.
Usually every day some new devices are being integrated which
uses IoT devices for its function.
These devices use various sensors and actuators for sending and
receiving data over the internet. It is an ecosystem where the
devices share data through a communication media known as the
internet.
MACHINE-TO-MACHINE (M2M)
Machine-to-Machine (M2M) refers to networking of machines
(or devices) for the purpose of remote monitoring and control and
data exchange. Term which is often synonymous with IoT is
Machine-to-Machine (M2M). IoT and M2M are often used
interchangeably.
M2M System Architecture
Feature Value
Operating Voltage 5V
Clock Speed 16MHz
Digital I/O 14
Analog Input 6
PWM 6
UART 1
Interface USB via ATMega16U2
Power Supply: USB or power barrel jack
Voltage Regulator
LED Power Indicator
Tx-Rx LED Indicator
Output power, Ground
Analog Input Pins
Digital I/O Pins
Programming with The Arduino IDE
The Arduino Integrated Development Environment - or Arduino
Software (IDE) - contains a text editor for writing code, a
message area, a text console, a toolbar with buttons for common
functions and a series of menus.
It connects to the Arduino and Genuino hardware to upload
programs and communicate with them.
Arduino IDE is an open source software that is used to program
the Arduino controller board It can be downloaded from
Arduino’s official website and installed into PC.
Set Up
1. Power the board by connecting it to a PC via USB cable
2. Launch the Arduino IDE
3. Set the board type and the port for the board
4. TOOLS -> BOARD -> select your board
5. TOOLS -> PORT -> select your port
Programs written using Arduino Software (IDE) are called
sketches.
1. These sketches are written in the text editor and are saved with
the file extension. ino
2. The editor has features for cutting/pasting and for
searching/replacing text.
3.The message area gives feedback while saving and exporting
and also displays errors.
4.The console displays text output by the Arduino Software
(IDE), including complete error messages and other information.
5.The bottom right-hand corner of the window displays the
configured board and serial port.
6.The toolbar buttons allow you to verify and upload programs,
create, open, and save sketches, and open the serial monitor.
Operators: An operator is a symbol that tells the compiler to
perform specific mathematical or logical functions
PROGRAMS WITH AURDINO
INTEGRATING SENSORS AND ACTUATORS WITH AURDINO
SENSORS
Basic electronic Device
Convert a physical quantity/ measurements into electrical
signals can be analog or digital
Types of Sensors
Some commonly used sensors:
Temperature
Humidity
Compass
Light
Sound
Accelerometer
Sensor Interface with Arduino
Digital Humidity and Temperature Sensor (DHT)
PIN 1,2,3,4 (from left to right)
Sketch: DHT_Sensor
Install the DHT Sensor Library
Go to sketch -> Include Library -> Manage Library
ACUTATORS
Types of Motor actuators
1.Servo Motor
2.Stepper Motor
3.Hydraulic Motor
4.Ac motor and so on
Servo Motor:
Servo Motor is a high Precision motor which provides rotary
motion 0 to 180 degree
The 3 wires in the servo motor are
Black or the darkest one is ground Red is power supply and
Yellow is for signal pin
Servo Library on Arduino
Arduino provides separate library SERVO to operate the servo
motor.
Create an instance of servo to use it in the sketch.
Syntax: Servo my servo