IOT - MOD - 3 - Notes
IOT - MOD - 3 - Notes
IOT - MOD - 3 - Notes
MODULE III
Sensors & Actuators
Syllabus Content:
Sensor & Actuators: Sensors - Overview, working, Analog and Digital. Various types of
sensors - Temperature, Distance, Humidity, Motion, Light and Gas. Actuators - Overview,
working. Various types of actuators - Relay, LEDs, Buzzer, DCMotor and Servo Motor.
Concept of shield and modules. Interfacing of sensors and actuators with Arduino
Basics of Wireless Networking - Protocols, specification, interfacing &application of
Serial(RS232), Bluetooth(HC05), Wifi(ESP8266)
Sensors:
• A sensor is a device that detects the change in the environment and responds to some output
on the other system.
• A sensor converts a physical phenomenon(pressure, temperature, position, force, proximity,
flow, optical, sound etc.) into a measurable voltage or current.
Types of Sensors:
Analog Sensor Digital Sensor
• It measure the external parameters and give • It measures the external parameters and give a
an analog or continuous output voltage. digital output data(0s and 1s) or ‘binary’ signals.
• Signal get distorted due to external noise. • Signal get less distorted due to external noise.
• Analog sensors is cannot be easily interfaced • Digital sensors can be easily interfaced with
with embedded system. embedded system.
• Less expensive sensors. • Digital sensors are more expensive.
• Eg: Accelerometers, Pressure sensors, Light • Eg: Ultrasonic sensor, Humidity sensor, Digital
sensors, Sound sensors, Temperature sensors temperature sensor
NOTE:
Accelerometers(ADXL335): These are analog sensors that detect changes in position, velocity,
orientation, shock, vibration, and tilt by sensing motion are called as accelerometers. Accelerometer
sensors are used in many ways, such as in many electronic devices, smartphones, smartwatches etc.
The ADXL335 accelerometer measures acceleration along X, Y and Z axes and gives analog
voltage output proportional to the acceleration along these 3 axes. It is very easy to interface to an
Arduino, X_OUT, Y_OUT, Z_OUT pins are connected to any 3 Analog pins, VCC to 5V, GND to
GND.
Light Sensors(LDR): They are a type of photodetector (also called photosensors) that detect light.
Photo resistor or Light Dependent Resistor(LDR) are passive devices that decrease resistance in
proportion to the amount of light received is one of the most common type of light sensors.
For interfacing with Arduino, connect the one of LDR pin to any one of the Analog pins &
resistor to GND. Other pin to 5V on your Arduino board.
Gas sensor: It is a device which detects the presence or concentration of gases in the atmosphere.
Based on the concentration of the gas the sensor produces a corresponding potential difference by
changing the resistance of the material inside the sensor, which can be measured as output voltage.
Based on this voltage value the type and concentration of the gas can be estimated.
These sensors are normally available as modules (shown right), these modules consist of the gas
sensor and a comparator IC. The gas sensor module basically consists of 4 terminals. The sensor’s
analog output voltage varies in proportion to the concentration of smoke/gas. The higher the
concentration, the higher the output voltage; the lower the concentration, the lower the output
voltage. The analog signal is digitized by an LM393 High Precision Comparator and made available
at the Digital Output pin. Digital Out used to give output High/Low when the gas concentration
reach the threshold. . The module includes a potentiometer for adjusting the sensitivity of the digital
output.
For interfacing with Arduino, connect VCC to 5V, Analog Output to any Analog pins, GND to
GND. Digital Output is used for setting a threshold & is connected to any one of Digital pins.
Humidity Sensor(DHT22): Humidity sensors are used to measure and monitor the amount of
water present in the surrounding air.
The DHT-22 is a digital-output, relative humidity, and temperature sensor. It uses a capacitive
humidity sensor and a thermistor to measure the surrounding air, and sends a digital signal on the
data pin. It can measure relative humidity in percentage (0 to 100%) and temperature in degree
Celsius in the range of -40°C to 80°C. For interfacing with Arduino, connect VCC to 5V, Data pin
to any Digital pins, GND to GND.
Actuators:
• Actuators are frequently used as mechanisms to introduce motion, or to clamp an object so
as to prevent motion.
• They are devices which transform an input signal (mainly an electrical signal) into some
form of motion.
Types of Actuators:
Relay: A relay is generally an electrically operated switch. The principle used by the relays is an
electromagnet to mechanically operate the switch. So basically it operates a switch using an
electromagnet which needs only less power like 5V, 12V or 24V. Relay is used to connect Arduino
board to powerful electrical devices like pumps, motors, lighting bulb, etc. Relay switches ON or
OFF these devices using the control signal from Arduino.
It has 5 terminals:
• NO(Normally Open): It will establish electrical contact with Common terminal once the
relay is energized.
• NC(Normally Closed): It will have electrical contact with common terminal whenever the
relay is not energised.
• C(Common terminal)
• GND(Ground)
• 5V VCC: Operating voltage for the relay.
• Signal: Actuation signal to control the
relay.
Light emitted Diode (LED): It is an output device & is used as an indicator for the status of
various signals or situations. LED is a semiconductor device that emits light when current flows
through it. It have 2 terminals - anode & cathode.
For interfacing LED with Arduino, the anode should be connected one of the Digital pins through a
current limiting resistor & cathode to GND.
Piezo Buzzer: It is a piezoelectric device for generating audio signal(alarm signal) in embedded
applications. A Piezo buzzer contains a piezoelectric diaphragm which produces audible sound in
response to the voltage applied to it.
For interfacing Buzzer with Arduino, the +ve terminal should be connected one of the Digital pins
& -ve terminal to GND.
DC Motor: DC motor converts electrical energy into mechanical energy in the form of rotational
motion of the motor shaft. The DC motor speed can be controlled by applying varying DC voltage;
whereas the direction of rotation of the motor can be changed by reversing the direction of current
through it.
For applying varying voltage, we can make use of PWM technique. L298N motor driver IC is used
for controlling the direction of the motor. PWM wave generated on the Arduino UNO is used to
provide a variable voltage to the motor through L298N. This IC provided with a 12V power supply
which provides enough current to drive the DC motor.
Servo Motor: Servo Motor is a DC Motor equipped with error sensing negative feedback
mechanism to control the exact angular position of the shaft. Unlike DC Motors it will not rotate
continuously. It is used to make angular rotations such as 0-90°, 0-180° etc.
The servo motor consists of VCC, GND, SIGNAL pins. For interfacing servo motor with Arduino
connect VCC to 5V pin, GND to GND, SIGNAL to any one of digital pins.
Arduino shields:
• They are the boards, which are plugged over the Arduino board to expand its functionalities.
• There are different varieties of shields used for various tasks, such as Arduino motor shields,
Arduino Ethernet shields, etc.
• It is easy to connect the shields by mounting them over the Arduino board.. It does not
require any complex wiring.
• The hardware components on the shields can be easily implemented.
Wireless Network: A wireless network connects communicating devices without using network
cables. They uses radio waves to send & receive data between each other.
Serial(RS232): The term RS232 stands for "Recommended Standard 232" and it is a type of
serial communication used for transmission of data normally in medium distances. It was
introduced back in the 1960s and has many applications like connecting computer printers, modems
etc. For interfacing MAX232 module with Arduino connect GND to GND, VCC to 5V pin, RXD to
RX0(Pin 0), TXD to TX0(Pin 1). DB 9 connector cable is used to connect device to MAX232
module.
WiFi(ESP8266) module: The ESP8266 wifi module is low cost stand-alone wireless transceiver
that can be used for end-point IoT developments. ESP8266 wifi module enables internet
connectivity to embedded applications.
For interfacing ESP8266 wifi module with Arduino connect TX to TX0, RX to RX0, GND to GND,
3V3 to 3.3V pin.