Professional Documents
Culture Documents
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.
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.
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.
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:
void setup() {
Serial.begin(9600);
Serial.println("Hello World");}
void loop() {
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
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.
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.
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
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.