0% found this document useful (0 votes)
379 views102 pages

Unit II - Lecture - THINGS IN IOT

Introduction to Sensors - Light sensor, voltage sensor, Temperature and Humidity Sensor, Motion Detection Sensors, Wireless Sensors, Level Sensors, USB Sensors, Embedded Sensors, Distance Measurement with ultrasonic sensor Introduction to Actuators- Connecting LED, Buzzer, Controlling- AC Power devices, Servo motor, Speed DC Motor. Electronic Communication Protocols (Device Interfacing) Protocols: I2C, SPI, UART, USRT, CAN.

Uploaded by

NALE SVPMEngg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
379 views102 pages

Unit II - Lecture - THINGS IN IOT

Introduction to Sensors - Light sensor, voltage sensor, Temperature and Humidity Sensor, Motion Detection Sensors, Wireless Sensors, Level Sensors, USB Sensors, Embedded Sensors, Distance Measurement with ultrasonic sensor Introduction to Actuators- Connecting LED, Buzzer, Controlling- AC Power devices, Servo motor, Speed DC Motor. Electronic Communication Protocols (Device Interfacing) Protocols: I2C, SPI, UART, USRT, CAN.

Uploaded by

NALE SVPMEngg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 102

TE IT (2019 Course)

Elective I : Internet of Things

Prepared by : Prof Nale Rajesh Keshav


IT Department
SVPM’s COE,Malegaon(Bk),Baramati 413115

1
2
Reference Books Suggested….

3
Unit II :- Things in IOT (6 Hrs)

4
Unit # II : THINGS IN IOT (06 Hours)
Select suitable sensors and actuators for real time
CO # 2 L3 : Apply
scenarios.

Major Topic Subtopic Hours Books


Light sensor, voltage sensor, Temperature
Introduction to T1, T4, T5,
and Humidity Sensor, Motion Detection 01
Sensors R1, R4
Sensors, Wireless Sensors,
Level Sensors,USB Sensors, Embedded
Introduction to T1, T4, T5,
Sensors, Distance Measurement with 01
Sensors R1, R4
ultrasonic sensor
Connecting LED, Buzzer, Controlling- AC
Introduction to T1, T4, T5,
Power devices, Servo motor, Speed DC 02
Actuators R1, R4
Motor.
Electronic
Communication
Protocols (Device I2C, SPI, UART, USRT, CAN. 02 T1, R1
Interfacing)
Protocols
Unit # II : THINGS IN IOT (06 Hours)

Major Topic Subtopic


1. What are sensors?
Introduction to Sensors
2. What are the types of sensor?
Light sensor, voltage sensor, Temperature and Humidity
Sensor, Motion Detection Sensors, Wireless Sensors, Level
Sensors, USB Sensors, Embedded Sensors, Distance
Introduction to all types of
Measurement with ultrasonic sensor
Sensors
1. What are types of every sensor?
2. How does every type of sensor works?
3. Where every sensor is useful? (Application)
1. What are actuators?
2. What are types of actuators?
Introduction to Actuators
3. What are the examples of actuators?
4. Comparison between sensors and actuators.
Device Interfacing and Connecting LED, Buzzer, Controlling- AC Power devices, Servo
Controlling motor, Speed DC Motor.
Unit # II : THINGS IN IOT (06 Hours)

Major Topic Subtopic


Electronic Communication 1. What are communication protocol?
Protocols (Device 2. What are types of communication protocols?
Interfacing) Protocols 3. How communication protocols are helpful?
I2C, SPI, UART, USRT, CAN.
For every protocol:
1. Explanation of protocol
Types of Communication 2. How does protocol works?
Protocols 3. What different methods of working of protocols?
4. Advantages and Disadvantages of protocols.
5. Examples of protocols.
6. Comparison of all protocols
Things in IOT

• The Internet of Things (IoT) describes the network of physical objects—“things”—that


are embedded with sensors, software, and other technologies for the purpose of
connecting and exchanging data with other devices and systems over the internet or
other communications networks.
.
• A thing in the IOT can be a
1. person with a heart monitor implant,
2. a farm animal with a biochip transponder,
3. an automobile that has built-in sensors to alert the driver when tire
pressure is low
4. or any other natural or man-made object that can be assigned an
Internet Protocol (IP) address and is able to transfer data over a network.

8
Sensor
● Sensor is a device that Sense a Physical Phenomenon (temperature,
displacement, force etc) & produces a proportional output signal
(electrical, mechanical, magnetic etc).

9
Sensors Types:

10
11
Types of Sensor & Function

Name Definition
 Light Sensor Type of sensor used to Detect the light
 Temperature Sensor Used to measure the temperature of room or atmosphere
 Motion Sensor It is used to detect the movement of any live thing

 Proximity Sensor Detect the presence of nearby objects without any physical contact
IR Sensor (Infrared
Sensor) It can measure the heat of an object as well as detects the motion
Pressure Sensor It is a device for pressure measurement of gases or liquids

 Accelerometer Sensor It is a type of sensor used to measure the acceleration exerted upon the sensor
 Ultrasonic Sensor ultrasonic sensors measure distance by using ultrasonic waves

 Color Sensor Detects the color of the material usually detects color in RBG scale.
 Humidity Sensor Measures and reports both moisture and air temperature
 Tilt Sensor Measure the tilting position with reference to gravity
 Current Sensor It is used to measure the current 12
Types of Sensor & Function… Continue….
Name Definition
Bio-Medical Sensor Detect specific biological, chemical, or physical processes
GAS Sensor Detects the presence of gases in an area
Speed Sensor Measure the speed of wheels
Use load cells to weigh objects and prevent machinery from
Force Sensor overloading
Hall effect Sensor Used to measure the magnitude of a magnetic field
Compass Sensor A device whose function is to give the right directions
Used to control the exact dosing of gases or liquids in many technical
Flow Sensor systems
Determining the level or amount of fluids, liquids or other substances
Level Sensor that flow in an open or closed system

13
Light Sensors

• Light sensors are a type of photodetector (also called photosensors) that detect light.
Different types of light sensors can be used to measure illuminance, respond to changes
in the amount of light received, or convert light to electricity.
• Light sensors that transform the light or infrared radiation into the other electrical
parameters like Voltage/Resistance or are known as the light sensors. These sensors
are also named as the photoconductors. A normally used photoconductor is the light-
dependent resistor (LDR)(Photo resister).
• Three types: LDR , Photodiode & Phototransistor.

14
Light Dependent Resistance(LDR) :Photo resistor

• LDR are also known as the photoresistors, these light sensors are used in the
different engineering projects to control the light strength for different components.
• It is constructed from the Cds (cadmium) this substance is very sensitive to light and
according to the intensity of the light, it varies the value resistance
• its resistance varies according to light in the shadowy resistance is higher while
in light resistance is less.

The normally used type of the LDR cell is OPR12 it is manufactured by the cadmium sulphide.
15
LDR Working Principle

• These devices depend on the light, when light intensity increases that fall on on the
LDR then the resistance decreases, and resistance increases when light intensity Low
(dark condition) 16
• If we connect LED at output then LED will be on/off is achieved using this principle .
17
Photodiode and Phototransistor

Both are semiconductor-based components used for sensing light intensity and
converting it into electrical signal but they are quite different.

18
SL PHOTO-DIODE PHOTO-TRANSISTOR
NO.
1. Photodiode basically is a PN Phototransistor basically an NPN
Junction Diode which can create transistor which allows the
an electric current, when the flowing of current when light
light is falling on this. falls upon its base.
2. The output response of the The output response of the
photodiode is faster than the phototransistor is lesser than a
phototransistor. photodiode.
3. The sensitivity of the photodiode The sensitivity of the
is lesser than phototransistor. phototransistor is more than the
photodiode.
4. The main applications of The main applications of
photodiodes are in solar cell, Phototransistors are IR receiver
light sensor, Smoke Detectors, circuit, LASER detector, Counter,
Pulse Oximeters Relays
Optocoupler or Opto-isolator Punch Card Readers, Level Indication
Medical Devices etc. Position Sensing,Logic Circuits
etc.

19
Optoisolator / OptoCoupler circuit
• Providing electrical and physical isolation of two sections
of a circuit and hence the safety.

20
10/15/2024
Comparison between Photodiode & Phototransistor
Definition
Photodiode is a semiconductor component that converts light energy into electrical energy.
Phototransistor is a semiconductor component that amplifies the current generated from
light energy.
Function
Photodiode is used for converting light or solar energy into electrical energy.
Phototransistor is used for sensing light.
Biasing
Photodiode can be connected in forward as well as reverse bias.
Phototransistor is only connected in forward bias.
Output
The output of photodiode is current as well as voltage
The output of phototransistor is only current.
Cost
Photodiode is cheap. Phototransistor is expensive.
Applications
Photodiode is mainly used for the conversion of solar energy into electrical energy but it is
also used for sensing light in applications such as optical fiber communication, object
counter, etc. 21
Phototransistors are mainly used for detecting light & they find applications in printers, CD-
Voltage Sensor
What is a Voltage Sensor?
A voltage sensor is a sensor used to calculate and monitor the amount of voltage in an object.
Voltage sensors can determine the AC voltage or DC voltage level. The input of this sensor is
the voltage, whereas the output is the switches, analog voltage signal, a current signal, or an
audible signal.
Two main types of voltage sensors are available:
1. capacitive type voltage sensor and
2. resistive type voltage sensor.

22
Voltage Sensors

23
Advantages of Voltage Sensors Over Conventional Measuring
Techniques
The advantage of voltage sensors include:
• Small in weight and size
• Personnel safety is high
• The degree of accuracy is very high
• Non-saturable
• Wide dynamic range
• Eco-friendly
• Can combine the voltage and current measurement into a single physical
device with small and compact dimensions

Applications of Voltage Sensors


• The application of voltage sensors include the following:
• Power failure detection
• Load sensing
• Safety switching
• Temperature control
• Power demand control
• Fault detection
24
Temperature and humidity sensor (DHT 11 / DHT22 )
Temperature and humidity sensor (or rh temp sensor) is devices that can convert
temperature and humidity into electrical signals that can easily measure temperature
and humidity according to certain rules and output the device to the instrument or
software to meet the environmental monitoring needs of users.

25
Humidity is the amount of water vapor in the air.
DHT 11 sensor interfacing

26
Motion detector Sensors : Active & Passive IR sensors

27
Motion detector Sensor
• Motion is a change in the position of object or person with respect to time and its
initial reference location. The motion can be specified in terms of displacement,
velocity, direction, acceleration and time. The device which senses motion is known
as motion sensor. Following are the types of motion sensor.

• Active Motion Sensor

• Passive Motion Sensor

28
Active Motion Sensor | Microwave Motion Sensor

Fig: Active Motion Sensor Operation.

• As shown it emits frequency in the microwave region and will


analyze the returned/reflected microwave frequency for
determining motion.
29
• Detects change in frequency or change in amplitude to determine
Advantages and Disadvantages of Microwave motion sensor

• Following are the advantages of microwave motion sensor:


• Used in harse environment where heat cycles are irregular
• It has lifespan of about 100,000 Hours

• Following are the disadvantages of microwave motion sensor:


• Microwave radiation is hazardous for health and hence low power microwave
sensors are preferred.
• Microwave frequency do not penetrate metal objects.
• Prone to false alarms due to blowing of objects due to wind and also emission from
fluorescent lights.
• They operate at irregular intervals and hence intruders sometimes are left
unnoticed.

30
Ultrasonic sensor
WHAT IS ULTRASONIC SENSOR ?
An Ultrasonic sensor is a device that can measure the distance to an object by using
sound waves. It measures distance by sending out a sound wave at a specific frequency
and listening for that sound wave to bounce back. By recording the elapsed time between
the sound wave being generated and the sound wave bouncing back, it is possible to
calculate the distance between the sonar sensor and the object.

31
Timing Diagram of Ultrasonic sensor
• The first signal is
'Trig', which is a pulse
with 10 us of duration
that triggers 8 pulses
of ultrasound emission
via the speaker, as
shown in the image
(Pulse sonico).

• The second signal,


called 'Echo',
generates a pulse
whose duration is
equal to the response
time of the ultrasonic
signal bounced off the
object to be
measured.
32
To obtain the distance, measure the width (Ton) of Echo pin.
Distance measurement using the ultrasonic sensor(HC-SR04)

Ultrasonic is the application of ultrasound & Ultrasound is an oscillating sound pressure wave with a frequency
greater than the upper limit of the human hearing range . Ultrasound is thus not separated from 'normal' (audible)
sound based on differences in physical properties, only the fact that humans cannot hear it.

Principle of operation : through the speaker, trains of ultrasound pulses are sent at a
frequency of 40 Khz. This signal bounces off the object, and returns to the sensor, being
detected by the microphone (Figure 1). Once the delay is measured between the signal
emitted and received, based on the constant speed of propagation of sound (340 meters
per second) and using an arithmetic formula (Figure 5) the distance to the object can be
calculated.

Trigger pin is triggered by external controller to


out burst an ultrasound wave.
​Echo pin notifies external controller when 33
receiver receives back the bounced back wave.
Distance calculation using Ultrasonic
Sensors:
Ultrasonic sensor did not calculate the distance by it self. Rather it only grabs the
time taken by waves to leave transmitter and bounce back to receiver. Time is
converted in to distance using the speed of sound in air formula.
According to universal speed of sound in air formula
Time = Distance / Speed
Where Speed = speed of sound in air.
Which is 340 m/s
Hence reorganizing the formula

Distance= Time * speed of sound in air (340


m/s)

where Time: the time taken by waves to leave transmitter


and bounce back to receiver 34
35
2. Passive Detectors
• Passive Motion Sensors are opposite to active sensors, they do not send out anything, but
it simply detects the infrared energy. Infrared (heat) energy levels are sensed by passive
detectors. Passive sensors scan the room or area, it is installed for infrared heat that is
radiated from living beings.
• Actually, heat is radiated from any object with a temperature above absolute zero. When an
object walks into the detection area of a passive sensor, it detects heat emitted from that
object and activates the alarm or turns on the light or any application.
Example: Passive IR Sensor (PIR) it senses infrared signal emitted by various objects including
human body

Note: Who can emit infrared radiation? All objects whose temperature more than zero (0°C) degree centigrade, which 36
emits HEAT energy in the form of IR radiation. We can not see this radiation because it radiates at infrared wavelength. Also,
Pin
Pin Description
Name
We have to connect this pin to the power supply Vcc. Input voltage range from 4.5V to
1 VCC
12V.
This is the output pin of the PIR sensor. This pin gives Digital pulse high output (3.5V)
2 OUT when the motion is detected and Digital pulse low output (0) when no motion is
detected.
37
3 GND We have to connect this pin to the power supply Ground.
Arduino Code
int buzz = 9; //Defining pins
int pir = 2;
void setup()
{

// Sets the buzzer as an OUTPUT & PIR sensor as an INPUT


pinMode(buzz, OUTPUT);
pinMode(pir, INPUT);

Serial.begin(9600);
}
void loop()
{
//Read data from the sensor
int status = digitalRead(pir);

if(status == HIGH)
{
Serial.println("Motion Detected");
tone(buzz,1000,700);
delay(2000);
}
else
{
Serial.println("No one is there");
delay(1000);
}} 38
8/14/2024
• It generates energy when exposed to heat. Human or animal body radiates
energy in the form of infrared radiation. Hence when human/animal come in the
range of PIR motion sensor, it receives thermal energy and hence motion is
detected by the sensor.
• Detects increase in received thermal energy to determine the motion of the
object/person
• Senses based on heat and light

Advantages and Disadvantages of PIR motion sensor

Following are the advantages of PIR motion sensor:


• Detects motion reliably in indoors as well as in day or dark.

Following are the disadvantages of PIR motion sensor:


• It does not operate greater than 35 degree C
• It works effectively in LOS (Line of Sight) and will have problems in the corner
regions.
• It is insensitive to very slow motion of the object 39
• In outside environment, during day and night, PIR motion sensor triggers alarms.
Types of Motion
Sensors:

40
Applications of Types of Motion Sensors

Some of the key applications of motion detectors include:


• Intruder alarms
• Automatic ticket gates
• Entryway lighting
• Security lighting
• Hand dryers
• Automatic Door Opening System Using PIR sensor
• Ultrasonic sensors are used for triggering the security camera at home and
for wildlife photography.
• Liquid Level Controller using Ultrasonic Sensors
• Active infrared sensors used To indicate the presence of products on
conveyor belts

41
Wireless Sensors :
WHAT IS A WIRELESS SENSOR?
• A wireless sensor is a device that can gather sensory information and detect changes
in local environments.
• Wireless sensors are designed to measure specific parameters about their physical
surroundings and produce outputs, often electrical signals, for further processing. These
parameters include many different types of stimuli, including air temperature, lighting
levels, movements, and liquid leakages.

42
SOME OF THE TRADITIONAL WIRELESS SENSOR PROTOCOLS?
There are many wireless protocols that enable connectivity between sensors. Wi-Fi
,Bluetooth ,Zigbee etc

SOME EXAMPLES OF WIRELESS SENSORS?


Wireless proximity sensors
These sensors detect the presence or absence of different types of objects.
There are several categories of proximity sensors that include inductive,
ultrasonic, infrared, microwave, laser, pulse radar, and RF time-of-flight / Doppler
sensors. Some of the most common proximity sensors use Hall Effect sensors or
reed switches to detect the presence of a magnet.
Wireless movement sensors
This sensor can detect certain types of motion, including acceleration and tilt. For
example, PIR motion detectors use infrared light to detect movement within a
room. PIR sensors are often used in security and people detection applications.
Vibration sensors can help determine how much a machine is in use or monitor
pump activity

43
Wireless Sensors :

Wireless liquid sensors


This sensors detect the presence of liquids, such as water or fuel.
A flow sensor can monitor when water movement has stopped, indicating potentially
frozen pipes.
Wireless push buttons
This sensor transmits signals when buttons are pushed, which is particularly important in
emergency health or personal situations. In this type of application, it is referred to as a
Personal Emergency Response System (also called PERS).
Wireless air sensors
This sensors are used to assess air quality, including temperature, humidity, and the
presence of harmful gases. Using wireless air temperature and humidity sensors, homeowners
can detect heat system failures or measure humidity levels in greenhouses.
Wireless temperature sensors
This sensors can not only track temperatures in the surrounding environment, but can also
measure material temperatures. For example, probe-type temperature sensors can detect
frozen pipes and warn homeowners that they need to take preemptive measures to avoid
future problems. Warehouses will use air temp and humidity sensors to measure heat index
values to ensure the safety of their employees.
Wireless optical sensor 44
This sensors can detect optical events involving light levels or optical beam crossings. With
WIRELESS SENSOR NETWORK IN IOT

• Wireless Sensor Network in IoT is an infrastructure-less


wireless network that is used for deploying a large
number of wireless sensors that monitor the system,
physical and environmental conditions.
NETWORKS CONNECTING WIRELESS SENSORS
• To connect Sensors embedded in IoT devices, a
communication protocol is used.
• A low-power wide-area network ,LPWAN, is a type of
wireless network designed to allow long-range
communications between these IoT devices.
• LPWAN have a Protocol like Lora
based Wireless Sensor network LoRa® (an
abbreviation for “long range”) is widely used.
Sub-1 GHz, Zigbee,Thread etc are also used to
connect sensor networks and gateway and data
collected from this sensor network can be sent to
cloud using cellular networks such as NBIoT
(Narrowband IoT), LTE-M (Long Term Evolution) or
Radio Nodes- Radio nodes or master nodes in Wireless sensor network receive data from the sensors and
wifi etc.
forward it to the gateway. These consist of microcontrollers, transceivers and a battery.
Access Point or Gateway-It is used to receive the data sent by the radio nodes wirelessly typically through
the internet or other cellular network and send it over the cloud. Cloud for IoT (ThingSpeak, Ubidots). 45
Cloud IoT Core supports two protocols for device connection and communication: MQTT (MQ Telemetry Transport)
WIRELESS SENSOR APPLICATIONS IN IOT?
The success of the IoT is highly dependent on wireless sensor technology. Wireless sensors
will enable many major IoT applications across a wide variety of sectors and settings.
1. Connecting everyday objects in smart homes
2. Improving service company responsiveness and effectiveness: Both plumbing and insurance
companies can also benefit from wireless water leak sensors.

3. Supporting patient health care via real-time monitoring


4. Enabling better and smarter product management
5. Improving security and safety in industrial settings
6. Preserving and maintaining fragile artwork
In museums and art galleries, preservation specialists can place wireless humidity sensors in rooms to
monitor and adjust air conditions in order to protect artifacts or artwork. Optical sensors could also be used to
detect lighting levels and ensure that guests have the best possible viewing experiences.

46
Level Sensor
• Level sensors are used to measure the position of the surface within some form
of container of both liquids and solid materials in the form of powders.

Level Sensor Classification


Level Sensors can be broken into two classifications;
1. Point level measurement
2. Continuous level measurement

Point level measurement: indicates Level when a product is present at a certain point.
The sensors for point level indication are:
– Capacitance
– Optical
– Conductivity
– Vibrating (Tuning fork)
– Float Switch
Continuous level measuring indicates the continuous level of a product as it rises and
falls.
following are the sensors for this :
– Ultrasonic 47
Examples: Sensors connected to tank

48
Level
•Sensors
Level sensors are used to measure the position of the surface within some form
of container of both liquids and solid materials in the form of powders.

49
Ultrasonic Sensor for Level
Management.

• Measuring water level is same as measuring distance of solid surfaces, the ultrasonic transducer
outputs a train of ultrasonic bursts at 40 KHz which will hit the water surface and reflect back to the
sensor. The time taken between sent and received ultrasonic waves are calculated by a microcontroller
such as Arduino. The measured distance is converted in to percentage.
• The tank has two heights the actual water holding capacity and the total height of the tank. In any
overhead tank there will be overflow and inlet tube, the point just below the overflow tube is the end of
water holding capacity. You need to measure these two heights and enter it in the given program code 50
USB sensors

• This type of sensor incorporates a common standard interface like USB which you can
connect directly to your IoT devices or a single-board computer to add sensing
capabilities.
With a USB extended type sensor, you can plug into a USB port of a single-board
computer to receive power and create a data acquisition program to load the sensor
data.
Moreover, this type of sensor allows connection to the internet via a single-board
computer which you can
2JCIE-BU Environment easily build
Sensor(USB IoT devices.
Type)

• Connects to a network via USB or Bluetooth®


to enable the sending of measurement data
• Using OMRON’s unique and innovative
algorithm, enables highly accurate
determination of earthquakes based on
vibrational acceleration
• Enables continuous monitoring of room air
quality using a VOC sensor 51
Embedded sensors
What are embedded sensors?
• An embedded sensor network is a network of embedded computers placed in the
physical world that interacts with the environment. These embedded computers,
or sensor nodes, are often physically small, relatively inexpensive computers, each with
some set of sensors or actuators.

• Embedded type sensor is installed inside a single board computer or a power drive case.
A sensor module is placed on the printed circuit board so at the very least, all you need
is a power supply circuit.
This type of sensor is integrated into robots and single-board computers to monitor the
operating condition.

52
Embedded sensors in
Mobile

53
Introduction to Actuators
• An actuator is a part of a device or machine that helps it to achieve physical movements by converting
energy, often electrical, air, or hydraulic, into mechanical force., for example by opening a valve.

• Sensors in the device sense the environment, then control signals are generated for the
actuators.

• The controller directs the actuator based on the sensor data to do the work/perform actions.

• Examples of Actuators used in IOT: LED, Buzzer, Controlling- AC Power devices, Servo motor, Speed
DC Motor.

54
55
56
Types of Actuators :
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical Action
Ex- construction equipment uses hydraulic actuators because hydraulic actuators can
generate a large amount of force.
2. Pneumatic Actuators –
A pneumatic actuator uses energy formed by vacuum or compressed air at high pressure to
convert into either linear or rotary motion. Example- Used in robotics, use sensors that work
like human fingers by using compressed air.
3. Electrical Actuators –
An electric actuator uses electrical energy, is usually actuated by a motor that converts
electrical energy into mechanical torque. An example of an electric actuator is a solenoid
based electric bell, DC MOTOR etc
4.Thermal/Magnetic Actuators –
57
These are actuated by thermal or mechanical energy.
Actuators used in IOT
1. LED : Light emitting Diode
A Light Emitting Diode (LED) is a semiconductor device, which can emit light
when an electric current passes through it.

58
Interfacing LED with Ardiuno UNO

59
RGB LED
An RGB LED is basically an LED package that can produce almost any color. It can be used
in different applications such as outdoor decoration lighting, stage lighting designs, home
decoration lighting, LED matrix display, and more.

60
2. Buzzer
• A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric (piezo for short).

• Two categories: Active Buzzer and Passive Buzzer

1. The active buzzer has an internal oscillation source that makes the buzzer sound whenever
power is applied. Only one type of sound .Active buzzers are widely used in computers, printers,
copiers, alarms, electronic toys, car electronics, telephones, timers and other electronic product
sounding devices.

2. A passive buzzer has no internal source of oscillation and needs to be driven by a square
wave and a different frequency. It acts like an electromagnetic speaker, and the changing
input signal (Changing frequency) produces sound, rather than a tone automatically.

61
Passive Buzzer
Active Buzzer

Types of buzzers
Buzzers come in a variety of construction, size, and specifications. Different types and
sizes of buzzers are used for different applications. Based on construction, there are the
following kinds of buzzers:
1. Piezoelectric buzzers
2. Magnetic buzzers
3. Electromagnetic buzzers
4. Mechanical buzzers 62
5. Electromechanical buzzers
Interfacing Buzzer with Ardiuno

#define BUZZER_PIN 8

void setup()
{
pinMode(BUZZER_PIN, OUTPUT);
}

void loop()
{
digitalWrite(BUZZER_PIN, LOW);
delay(1000);
digitalWrite(BUZZER_PIN, HIGH);
delay(1000);
}

63
Button controlled Buzzer.

64
8/14/2024
Controlling- AC Power devices

• You can control a lot of things with an Arduino. Displays, LEDs, and other devices can
easily be hooked up to the I/O pins and controlled with a simple sketch.
• But the output ports on an Arduino, or any microcontroller, are only designed to
control logic-level devices (Logic 1 and Logic 0 ). Interfacing to anything that requires
more than a logic-level signal is going to require external components.
• Controlling AC devices requires different techniques:Safety First
• Alternating Current, or AC differs from Direct Current (DC) in that it constantly changes
polarity, oscillating like a sine wave between positive and negative at a predetermined
frequency.
Here are a few guidelines for working with AC:
1. NEVER experiment directly with high-voltage AC.
2. NEVER connect high-voltage AC to a solderless breadboard.
3. NEVER connect high-voltage directly to an I/O pin (or any pin) on a microcontroller.
4. ALWAYS work on AC circuits with the power off. Confirm that the power is truly off with
a multimeter.
5. ALWAYS test your wiring with a multimeter before applying power.
6. Do not leave high-voltage work unattended and powered on. Always remove power
from the circuit if you are not present, to avoid the risk of injuring others.
7. Do not attempt to work with high-voltage AC if you are inexperienced. 65
Controlling AC Devices : to control AC devices we can use
SCR,TRIAC and DIAC

TRIAC ( Triode for


SCR (Silicon controlled rectifier) DIAC (Diode for alternating
• It is having three terminals. alternating current)
current.
• It is having three terminals
• It is a unidirectional device that is • It is having two terminals.
• It is a bi-directional device
only conducted in forwarding bias. • This is a bi-directional device.
• This is a controlled device
• It is a controlled device since it is • It is an uncontrolled device.
• The power handling capacity
having a gate terminal. • The power handling capacity of
• The power handling capacity of this of TRIAC high.
DIAC is low.
• The firing angle of TRIAC is 0
is high. • There will be no firing angle for
• The firing angle of SCR is 0 to 180°. to 180° and 180° to 360°.
DIAC.
• Used in fan control, light
• Used in inverters, choppers, • Used to trigger TRIAC.
dimmer, and many more.
rectifiers, 3 phase systems. 66
Controlling AC Devices :

1. Silicon Controller Rectifier (SCR)

67
2. Triode AC Switch (TRIAC)

Fig: DIAC Fig :TRIAC

68
3. Optocoupler

• Optocoupler is a electronic device which connects two isolated circuits by light.


• Basically Optocoupler consists of LED and a photo sensitive device. Both the circuits are
enclosed in a package.
• Optocouplers are used to prevent the system from high voltage.
Applications of Optocoupler:
1. Used for ground isolation
2. Used in high voltage monitoring circuits
3. Used in lighting control circuits
4. Used in dimmer circuits

working principle of Optocoupler


An optocoupler consists a Transmitter as IR LED and a
Receiver as a photosensitive component. when light is
emitted by an LED and that light hits on the photosensor
(Photodiode, Phototransistor) then the photosensor starts to
flow the current. in this system, the Input Light is proportional
to the current at the output. 69
Fig: High voltage control using
Optocoupler
• Optocoupler is commonly used where A computer system or any digital system needs to
control or drive a motor or control the high voltage devices. Here computer system circuit
and Motor controlling device is fully electrically isolated, there is no interference of
electrical signal.
• If we need to connect a 220v AC Motor that is controlled by a microcontroller or
Arduino etc. In this case, we cannot directly connect both. Then there is optocoupler is
used. Microcontroller output is directly connected with the input of LED of the optocoupler,
and the Phototransistor is connected with the output component like Relay or Triac for 220v
Ac connection with the Motor.
70
Relay :
• A relay circuit is typically a smaller switch or device which drives
(opens/closes) an electric switch that is capable of carrying much
larger current amounts.

• Here you see three pin named NC, NO and COMMON.


• Now NC stands for normally closed,
• NO for normally open and
• common stands for common pin for connecting NC or NO.
• P1 and P2 pin are for providing control signal to relay.

• working principle of relay is very simple when P1 and P2 get a


certain amount of voltage then coil between P1 and P2 get
energized and create a magnetic field around it.

• For this magnetic field the metal switch liver which is attach to the
common pin is attracted towards the NO pin and connection made
between NO and common pin.

• So by using relay switch we easily turn on or off any high


voltage device by microcontroller
Relay Operation
• Initially when the power is not supplied and relay is in normally open condition, its
contact will be opened.
• When relay is in normally closed condition, its contact will be closed.

• When power is supplied to its coil, it gets energized and its normally open condition is
changed to normally closed and normally closed condition is changed to normally open.
• If we want to control the device via relay through a software then we have to attach this
device to its normally open terminal.
• When the relay gets energized, that device will be turned on for the appropriate
operation.
Fig 1: When Switch is OPEN Normally Closed(NC) contact and Lamp A is ON

Fig 2: When Switch is CLOSED Normally Open(NO) contact and Lamp B is ON


basic relay driver circuit

• NPN transistor BC547 is being used to control the relay. The transistor is driven
into saturation (turned ON) when a LOGIC 1 is written on the PORT PIN thus turning
ON the relay. The relay is turned OFF by writing LOGIC 0 on the port pin.
• A diode (1N4007/1N4148) is connected across the relay coil; this is done so as to
protect the transistor from damage due to the BACK EMF generated in the relay's
inductive coil when the transistor is turned OFF. When the transistor is switched OFF
the energy stored in the inductor is dissipated through the diode & the internal
resistance of the relay coil. Normally 1N4148 can be used as it is fast switching
diode with a maximum forward current of 300ma. This diode is also called as free-
wheeling diode.

5V Relay / 12V relay in IOT

76
Opto-coupler & Relay Connection

77
Optoisolator Relay Device :

78
Pulse Width Modulation (PWM)
Pulse Width Modulation (PWM) is a one modulation technique by which the width of a
pulse is varied while keeping the frequency of the wave constant.

PWM.gif
we have period T= Ton + Toff

Duty Cycle = Ton/ T *100

Example: If T=10 ms and Ton=02ms


Then Duty cycle=20%
If T=10 ms and Ton=03ms Then Duty cycle=30%
If T=10 ms and Ton=07ms Then Duty cycle=70%
If T=10 ms and Ton=05ms Then Duty cycle=50%

PWM signal is a signal with Different Duty cycles .

Through the PWM technique, we can control the power delivered to the load by using the
ON-OFF signal. The PWM signals can be used to control the speed of DC motors and to
change the intensity of the LED. Moreover, it can also be used to generate sine signals.
Controlling Brightness of LED Using PWM

NOTE:
PWM supported pins in Arduino
Uno are 3, 5, 6, 9, 10, and 11 (~
tilde sign before pin).

• When duty cycle is increased the power dropped across the load increases and
when duty cycle is reduced, power across the load decreases.

8/14/2024 10-81
Motors :
• A motor is an electric machine which can convert electrical energy into mechanical
energy. The electrical motor works on the principle of Faraday's law of electromagnetic
induction.

There are mainly three types of motor

1. DC Motor
2. AC Motor
3. Universal Motor

• The motor which can run on DC supply is called DC Motor.


• The motor which can run on AC supply is called AC Motor.
• The motor which can run on both AC and DC supply is called Universal Motor.

82
Difference between DC Motor ,Servo Motor and
Steeper Motor
1. DC motors are fast and continuous rotation motors mainly
used for anything that needs to rotate at a high rotation per
minute (RPM). For instance; car wheels, fans etc.

2. Servo motors are high torque, fast, accurate rotation in a


limited angle. Generally, a high-performance alternative to
stepper motors, but more complicated setup with PWM tuning.
Suited for robotic arms/legs or rudder control etc.

3. Stepper motors are slow, easy setup, precise rotation, and


control – Advantage over other motors like servo motors in
controlling of a position. Where these motors require a
feedback mechanism and backing circuitry to drive locating,
this motor has positional control through its nature of rotation
by fractional additions. Suitable for 3D printers and related
devices where the position is essential.

83
DC Motor
A DC motor is an electro-mechanical device that converts direct current into mechanical energy by means
of rotation of a shaft.

DC motors are widely used in industrial automation, toys and robotics applications.
The speed of the DC motor can be controlled either by controlling current to the armature or by
using a variable power supply.

Controlling the speed of dc motor

1)using a potentiometer and also by a controlled current to the armature.

2) using pulse width modulation is the effective way to implement motor speed control.
Driver Circuit for DC Motor
• We can’t drive a dc motor directly through a microcontroller pin. It usually operates in
3.3v-5v and lower currents but DC motor normally works in 6-12v, 300mA and it has
other drawbacks like the back EMF produced by the DC motor may harm the
controller ports and damage them.

• The solution to the above problems is using motor driving circuit usually known as
H-Bridges. They are basically built using FETs and many dedicated ICs are also
available like L293D etc.
• These are dual H-bridge motor drivers, i.e., by using one IC we can control two DC
motors in both clockwise and counterclockwise directions.

• The L293D can provide bidirectional drive currents of up to 600mA at voltages from
4.5 V to 36 V.

• Thus, 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 the PWM technique.
• For reversing the current, we can make use of H-Bridge circuit or motor driver
ICs that employ the H-Bridge technique or other any other mechanisms.
L293D :Motor Driver IC
INTERFACE OF DC MOTOR WITH MOTOR DRIVER IC L293D
Ref :https://pijaeducation.com/arduino/motor/interface-of-
CASE 1: MOTOR SINGLE TERMINAL CONNECTION WITH IC arduino-and-dc-motor-using-driver-ic-l293d/

As you can see, one terminal of the motor is connected at ground, so it will work when it gets a HIGH signal to
the other end.
But before this, we need to make sure some connections like,
• Connect VSS / VCC 1 (pin 16) and VS / VCC 2 (pin 8) to HIGH (+5V)
• Enable pin EN1 (pin 1) to +5V.
(We connected both Enable EN1, EN2 you can connect the one you need,
• EN1 for IN1, IN2 &
• EN2 for IN3, IN4 where EN is enable & IN is input)
• Ground Pin 4, 5, 12, 13 (although here only two shown, but in real-time there are 4 pins)

When IN1= 0 …Motor OFF


When IN1= 1 …Motor ON

10-87
8/14/2024
CASE 2: MOTOR BOTH TERMINAL CONNECTION WITH IC

00 = Motor OFF
11 = Motor OFF
01= Motor Rotate clockwise
10=Motor Rotate Anticlockwise

88
8/14/2024
Interface of Arduino and DC Motor using Driver IC L293D

89
8/14/2024
Speed control of DC Motor
Servo Motor
• A servo motor is an electrical device used to rotate objects at certain specified angles. It’s
just a basic motor that runs through the mechanism of the servo.
• They are used in numerous applications such as toy cars, robotics, machines etc.
• Servo motors are measured in kg / cm (kilogram per centimeter). Servo motors are rated 3kg
/ cm or 6kg / cm etc. This kg / cm tell you how much weight your servo engine can lift at a
given distance. Generally servo motor 9G SG90 is used in projects.
• You can connect small servo motors directly to an Arduino to control the shaft position very
precisely.

91
Connecting Servo motor to Ardiuno

92
Controlling Servo motor

93
Brushless DC Motors :Steeper Motor

● DC motor contains brushes which cause


problems such as wear and tear and sparks.
● Stepper motors are brushless DC motors that
move in discrete steps.
● They have multiple coils that are organized in
groups called "phases". By energizing each
phase in sequence, the motor will rotate, one
step at a time

• Stepper motors are controlled by a driver, which sends the pulses into
the motor causing it to turn.

• The Rotation Angle of the Stepper Motor is Proportional to the Input Pulse.
• the position of motor shaft is controlled by controlling the number of
pulses.(step angles).
Stepping Modes
Driving Unipolar Stepper Motor

There are three stepping modes of a stepper motor. The stepping mode refers to
the pattern of sequence in which stator coils are energized.
● 1. Wave drive (One phase ON at a time)
● 2. Full drive (Two phase ON at a time)
● 3. Half drive (One and two phase ON at a time alternately)

Wave Drive
Wave Drive
● In this mode only one electromagnet is energized at a time. Generated torque will be less when compared to full
drive in which two electromagnets are energized at a time but power consumption is reduced. It has same number
of steps as in the full drive. This drive is preferred when power consumption is more important than torque. It is
rarely used.

Wave Drive Stepping Sequence

Step A B C D Hex code

1 1 0 0 0 08h
2 0 1 0 0 04h
3 0 0 1 0 02h
4 0 0 0 1 01h
FULL Drive
● In this mode two electromagnets are energized at a time, so the torque
generated will be larger when compared to Wave Drive. This drive is
commonly used than others. Power consumption will be higher than other
modes.
Full Drive Stepping Sequence

Step A B C D Hex code

1 1 1 0 0 0Dh
2 0 1 1 0 06h
3 0 0 1 1 03h
4 1 0 0 1 09h
Half Drive
● In this mode alternatively one and two electromagnets are energized, so it is
a combination of Wave and Full drives. This mode is commonly used to
increase the angular resolution of the motor but the torque will be less,
about 70% at its half step position. We can see that the angular resolution
doubles when using Half Drive.
Half Drive Stepping Sequence
Hex
Step A B C D
code
1 1 0 0 0 08h
2 1 1 0 0 0Ch
3 0 1 0 0 04h
4 0 1 1 0 06h
5 0 0 1 0 02h
6 0 0 1 1 03h
7 0 0 0 1 01h
8 1 0 0 1 09h
Advantages of stepper motor.
1. Flexibility.
2. Greater Torque than Servo motor.
3. Cheaper than Servo Motors
4. Stepper Motors are Considered to be Safer.
5. Stepper Motor Offer a Longer Life.
6. Excellent Repeatability.
7. Stepper Motors are Overload Safe
8. Good Choice for Applications Requiring Low Speed with High Precision.
Sensor Vs Actuators
● The main difference between sensor and actuator is that a sensor is used to monitor
the changes in the environment while an actuator is used to control the environmental
or physical changes.
Summary :Sensor Types and Actuators types

You might also like