You are on page 1of 10

UNIT-II

2.1 M2M
Machine to machine (M2M) refers to networking of Machines for the purpose of remote
monitoring and control and data exchange. The end-to-end architecture for M2M systems
comprising of M2M area networks, Communications Network and application domain. An
M2M area network comprises of machines which have embedded hardware module for sensing
actuation and communication. Various Communication protocols can be used for M2M local
area network such as Zigbee , Bluetooth , Modbus M –bus, wireless, power LINE
Communication ,6LoWPAN.
These Communications protocols provide connectivity between M2M nodes within and M2M
area network. The Communications Network provides connectivity to remote m2m area
network. communication network can use wired or wireless network. The M2M area network
use either proprietary or non IP based protocol.
The communication between the M2M nodes and the M2M Gateway is based on the
communication protocol. M2M Gateway protocol translation to enable IP connectivity for
M2M . M2M Gateway act as a proxy performing translation from / to native protocol to M2M
area network.
M2M data is gathered into point solution such as enterprise applications, service
management application for remote monitoring applications. M2M has various application
domain such as smart metering, Home Automation , industrial Automation, smart grid.
2.2 DIFFERENCE BETWEEN IOT AND M2M
The difference between m2m and IoT are described as follows :
Communication protocols:
M2m and IoT can differ in how the communication between the machines are device
happens. M2M uses other proprietary or not IP based communication protocol for
communication with in the M2M area networks. Commonly uses M2m protocol include
zigbee, Bluetooth, ModBus, wireless M-Bus ,power line communication.
The focus of communication in M2M is usually on the protocols below the network layer.
Focus of communication in IoT is usually a protocol in network layer such as http web sockets,
MQTT, XMPP, DDS, AMQP.
Machines in M2M vs Things in IoT:
The " things " IoT refers to Physical objects that have unique identifier and can sense and
communicate with the external environment or their internal physical status. The unique
identifiers the things in IoT are the IP addresses. Things have software component for
accessing processing and storing sensor information on controlling actuator connector. IoT
system can include IoT devices of various types such as fire alarms , door alarms, lighting
control devices.
Hardware versus software emphasis:
while the emphasis of M2M is more on hardware with embedded modules, the emphasis
modules, the emphasis of IoT is more on software . IoT devices run specialist software sensor
Data Collection, data analysis and interfacing with cloud through IP based communication.
Data collection and analysis:
M2M data is collected in point solutions and often in on premises storage infrastructure. In
contrast to M2M,the data in IoT is connected in the cloud. The analytical component analysis
the data and stores the result in the cloud database. Data and analysis results are visualized with
the cloud based applications. The centralized controller is aware of the status of all the nodes
and send Control Commands to the nodes.
Applications:
M2M data is collected in point solutions and can be accessed by on premises application
diagnosis applications, service management applications , and on-premises enterprise
applications.

2.3 Interoperability in IoT


Interoperability can be defined as the ability of different technology systems, system
components or software applications to establish communication between them, exchange data,
and interpret properly the received information for its use. This property applies to interactions
within a system, regarding which comprises the internal communication of its different
components, but also to the interaction between two or more systems.
There is a strong link between interoperability and IoT, as there is probably no
other technology area in which interoperability becomes especially critical and relevant, as in
the case of IoT. Interoperability is the key that allows any set of devices to exchange
information and work together in concert, acting as an actual IoT system. For example, without
interoperability, lights would not respond to remote switches, sensors could not be read by
smartphones, and devices in general would be unable to connect to accessible networks.
If we consider that a transparent integration and interconnection of different IoT
systems and system components would critically simplify their implementation, maximize
performance and facilitate their interconnection with other systems.
This system’s interconnection propitiates them to share relevant data and to establish
significant synergies, improving the quality of the information, the quality of service and the
experience provided to the user. These advantages can be better understood through some
examples of inter operated IoT systems.
To achieve a high degree of interoperability in an IoT system is therefore desirable, but
regrettably it is still one of the most difficult and important challenges to solve in IoT. As a
matter of fact, currently the different IoT systems are typically unable to correctly
communicate with each other or to interoperate in general. The main cause of this is directly
related to the highly heterogeneous nature within and among IoT systems. The Internet of
things covers a wide range of devices, protocols, technologies, networks, middle ware,
applications, systems and data that present a vast diversity. In this sense, the existence of a
global reference standard for IoT would be helpful, as it would notably facilitate
interoperability, by giving rules and certain homogeneity to this heterogeneous universe.
However, currently we lack such a standard, posing a significant problem when designing new
IoT systems.
Syntactic Inteoperability:Syntactic interoperability refers to the ability of systems of correctly
interpreting the message structure of exchanged information and, thus, being capable to read its
content, although they may not be aware of the meaning of this information .
An example of syntactic interoperability is a smart city system that receives information
from a data center and is capable to properly recognise its specific data format (e.g. CSV) and
thus correctly extract the data from the message (e.g. a set of values).
Syntactic interoperability relies on data formats, as the messages exchanged among
systems require a common data representation for the correct interpretation of the data structure
and content. The use of standardized data formats avoids ambiguity in the interpretation of
data. Examples of data formats are standards such as, XML, JSON or CSV, which provide a
high-level syntax.
Semantic interoperability: Semantic interoperability is the ability of computer systems to
exchange data, with unambiguous meaning. It is a requirement not only for health data be
shared between different systems or applications, but for them to be understood. Semantic
interoperability refers to the transmission of the meaning of data.
As an example, semantic interoperability allows a smart city system that has correctly
extracted the data received from another system, to understand the meaning and context of the
information contained in this data. Then, this system can be aware that the set of values
extracted actually represent temperatures of a city area. Thus, the system becomes capable of
using this information in the proper context.
Structurel Interoperability:The next layer, structural interoperability, defines the format of
the data exchange that takes place between systems. Also known as syntactic or technical
interoperability, this layer structures the data for exchange. One informaticist that I have
worked with called this “putting the words into sentences”, thus adding context to the data (or
“words” being exchanged.
An example of structural interoperability is ePrescribing. The provider's health IT
system must leverage the same data standards for common prescription elements as the
pharmacy's system to ensure accurate prescribing.

2.4 Introduction to Arduino Programming


Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online. You can tell your board what to do by sending a set of instructions to the
micro-controller on the board. To do so you use the Arduino programming language (based on
Wiring), and the Arduino Software (IDE), based on Processing.

Over the years, Arduino has been the brain of thousands of projects, from everyday objects to
complex scientific instruments. A worldwide community of makers - students, hobbyists,
artists, programmers, and professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible knowledge that can be of
great help to novices and experts alike.
Features
1. It is an easy USB interface. This allows interface with USB as this is like a serial device.
2. The chip on the board plugs straight into your USB port and supports on your computer as
a virtual serial port.
3. The benefit of this setup is that serial communication is an extremely easy protocol which
is time-tested and USB makes connection with modern computers and makes it
comfortable.
4. It is an open source design and there is an advantage of being open source is that it has a
large community of people using and troubleshooting it. This makes it easy to help in
debugging projects.
5. An on-board LED is attached to digital pin 13 to make fast the debugging of code and to
make the debug process easy.
6. It has a button to reset the program on the chip.

Board Details:
USB: can be used for both power and communication with the IDE
Barrel Jack: used for power supply
Voltage Regulator: regulates and stabilizes the input and output voltages
Crystal Oscillator: keeps track of time and regulates processor frequency
Reset Pin: can be used to reset the Arduino Uno
3.3V pin: can be used as a 3.3V output
5V pin: can be used as a 5V output
GND pin: can be used to ground the circuit
Vin pin: can be used to supply power to the board
Analog pins(A0-A5): can be used to read analog signals to the board
Microcontroller(ATMega328): the processing and logical unit of the board
ICSP pin: a programming header on the board also called SPI
Power indicator LED: indicates the power status of the board
RX and TX LEDs: receive(RX) and transmit(TX) LEDs, blink when sending or receiving serial
data respectively
Digital I/O pins: 14 pins capable of reading and outputting digital signals; 6 of these pins are
also capable of PWM
AREF pins: can be used to set an external reference voltage as the upper limit for the analog
pins
Reset button: can be used to reset the board
The Arduino IDE is the best place to start your journey in programming your Uno.The text
editor is where you’ll be writing your code; you’ll use the verify button to compile and debug
the written program.

[“You should learn using Arduino ,blinking LED “]


Arduino Sketch
Arduino sketch is the name that Arduino uses for a program. It’s the unit of code that is
uploaded to and run on an Arduino board. A basic Arduino sketch consists of two functions:

setup()
loop()
To write in the serial monitor, you must first initialize the serial monitor, you can do it
with the help of the following statement:

Serial.begin(9600);

Here 9600 is the baud rate at which you are communicating over USB with your device.

The statement to write on Serial Monitor is:

Serial.println(“Your Message”);

Now, modify the code by initializing the serial monitor and writing the print statement
inside the setup() function. You will end with this code:

// Hello World Program

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

Serial.println("Hello World");}
void loop() {

// put your main code here, to run repeatedly:

Arduino Function Libraries

 a) digitalWrite() : Writes a HIGH or LOW value to a digital pin


b) analogRead() : Reads from the analog input pin i.e., voltage applied across the
pin
 c) Character functions such as isdigit(), isalpha(), isalnum(), isxdigit(), islower(),
isupper(), isspace() return 1(true) or 0(false)
d) Delay() function is one of the most common time manipulation function used
to provide a delay of specified time. It accepts integer value (time in
miliseconds)

Operators
 Arithmetic Operators: =, +, -, *, /, %
 Comparison Operator: ==, !=, <, >, <=, >=
 Boolean Operator: &&, ||, !
 Bitwise Operator: &, |, ^, ~, <<, >>,
 Compound Operator: ++, --, +=, -=, *=, /=, %=, |=, &=
Control Statement

If statement
 if(condition){
Statements if the
condition is true ;
}

If…Else statement
 if(condition ){
Statements if the
condition is true;
}
else{
Statements if the
condition is false;
}
4
 If…….Elseif…..Else

if (condition1){
Statements if the
condition1 is true;
}
else if (condition2){
Statements if the
condition1 is false
and condition2 is true;
}
else{
Statements if both the
conditions are false;
}
2.5 Integration of sensors and actuators

DHT11 Sensor Interfacing with Arduino UNO


The DHT11 is a basic, low-cost digital temperature and humidity sensor.

 DHT11 is a single-wire digital humidity and temperature sensor, which


provides humidity and temperature values serially with one-wire protocol.
 DHT11 sensor provides relative humidity value in percentage (20 to 90%
RH) and temperature values in degree Celsius (0 to 50 °C).
 DHT11 sensor uses resistive humidity measurement component, and NTC
temperature measurement component.

Program
After inserting the programming code, we need to install Adafruit and DHT sensor Library
The relative humidity is measured by the electrical resistance between two electrodes. The
humidity sensing component of the DHT11 is a moisture holding substrate (usually a salt or
conductive plastic polymer) with the electrodes applied to the surface. The ions are released
by the substrate as water vapor is absorbed by it, which in turn increases the conductivity
between the electrodes. The change in resistance between the two electrodes is proportional
to the relative humidity. The below figure shows the electrodes applied to a substrate on the
front of the chip.

The sensor converts the resistance measurement to humidity on the IC mounted to the back
of the unit and transmits the readings directly to the Arduino. The temperature readings from
the DHT11 come from a surface mounted NTC temperature sensor (thermistor) built into the
unit. The DHT11 uses one signal wire to transmit sensor readings to the Arduino digitally. The
power comes from separate 5V and ground wires.

components of iot
There are two different variations of the DHT11 sensor you might come across. One type has
four pins, and the other type is mounted to a small PCB that has three pins. The PCB mounted
version with three pins is nice since it includes a surface mounted 10K Ohm pull up resistor for
the signal line:
Servo Motor interfaced with arduino

So, over here we need a small servo motor. So, this one particularly is use for
controlling the wings and tail adders of remote control planes or RC planes. So, this
is just a there is a geared mechanism inside.
So, there is a motor, when you send pulses of various widths, the motor rotates to
just that bit. So, there are various gears present inside the servo motor.

So, actuators are basically mechanical or electro mechanical devices. They convert
energy or signals into motion. And mainly use to provide controlled motion to other
components of various mechanical structures or devices.

So, basic working principle is, in the servo motor you have various mechanical structures
like gears and screws and ball bearings, which are interfaced with a small motor , and this
produces very control motion, but is able to perform much more efficiently then this motor
alone would have been able to. So, like generally for servers the top requirements are high as
compared to normal dc motors. So, this is what is known as micro servo. There
are servo motors of various ranges and sizes. So, this one is this can be directly integrated with
our arduino board without much interfacing or external circuitry.

So we have various types of motor based actuators. Actually servo motor is just one of
them. You have
1. Servo motors
2. Stepper motors
3. Hydraulic motors
4. Solenoid relay
5. AC motors.
One point to note here is solenoid and relays are not actually motor based actuators, but
sometimes solenoid may be used to drive motors and relays may be used to integrate various
multiple motors with any kind of programmable circuit. So, relay is something like a electro
mechanical switch.. Whenever you pass there is a coil there is a coil surrounding an iron coal
whenever you pass current through the coil the whole set of magnetizes, we can use it as
a magnet.

Servo motor is a high precision motor and it is able to provide a rotary motion between 0 and
180 degrees. And as you have seen it has got 3 wires one black, one red and one yellow. So,
many a times you may have you may see that the black wire may be replace with brown ones
also.

To get started, you will need:

Micro Servo (9g).


Arduino Uno.
Jumper Wires.
The Micro Servo is a tiny servo which is about 9g in weight and can carry a load of upto 200g
easily. It can found useful in a large number of small projects like Obstacle Follower robot,
Automatic Fish food feeder etc. The technical specs of the servo (from adafruit) are as follows :

Size : 23x11x29 mm
Voltage : 3V to 6V DC
Weight: 9g / 0.32oz
Speed : 0.12 sec/60 (at 4.8V)
Torque : 1.6 kg-cm
If you have a heavier load to carry you can use larger ones.You can use any servo code,
hardware or library to control these servos.These MicroServos are good for beginners who
want to make stuff move without building a motor controller with feedback & gear box,
especially since it will fit in small places.

Connecting a Servo is quite simple.

The Red wire is the Vcc.


The Black or Brown is the Ground.
The Orange or Yellow one is the Digital Signal Pin.
This can be connected to Arduino without any motor drivers. So directly supply 5V from
Arduino to the servo. The Digital signal pin is used to send values of angles to which the servo
head has to be rotated.

The Arduino IDE has built in examples for testing Servos in two different functions. They are
the Knob and Sweep. For this example I'm using testing the servo with the sweep function.

You can also make changes to the code and control the servo with the inputs you give in the
Serial Monitor. For this you will need to create a variable that will hold the value of the angle
which you enter.
The Sweep code is as follows:

#include

Servo myservo; // create servo object to control a servo


// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position

void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

Once you have the circuit ready, upload the program to the Arduino. If you have any doubts
regarding that, do refer my previous Instructable.

Output:

If you have used the Sweep code, You will see something like in the image above, where the
servo head will be rotating in a sweeping fashion.
If you want to control the servo manually (Provided you have written the code for it), go ahead
and open the serial monitor and enter a value between 0 and 360. You should see the servo
head rotate to that angle from reference point.

You might also like