Lec 2 - Arduino Sensors Module
Lec 2 - Arduino Sensors Module
College of Engineering
Mosul University
Arduino
Arduino Sensors Module 1
Objectives
Study the characteristics and applications of
different photoelectric sensors:
• Humidity Sensor
• Flame Sensor
• Tracking Sensor
• Metal Touch Sensor
Humidity Sensor
• The DHT-11, DHT-22 Digital Temperature And
Humidity Sensor 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.
Humidity Sensor
Features
• Low power consumption.
• DHT11 sensor adopts
• The module can detect the surrounding
environment of the humidity and temperature
• High reliability and excellent long-term stability
• The output from the digital output
• Has fixed bolt hole and easy installation
Humidity Sensor
• Comparison between the two types of sensors
DHT-11 DHT-22
Temperature range Good from 0 to 50 ° Temperature range Good from -40 to
C with an accuracy 80 ° C with an
of ±2 ° C accuracy of ±0.5° C
The output signal level changes with the The short lead of the infrared sensor is cathode,
brightness of the fire flame, which is then and the long lead is positive. The negative lead is
feed into the ADC of the MCU to be connected to 5V and the positive lead connect to
converted to a digital reading. the GND through a 10K ohm resistor. When the
intensity of infrared light changes, the resistance of
the sensor changes too, which then lead to the
change of voltage.
Flame Sensor
Features:
• High Photo Sensitivity
• Sensitivity adjustable
• Detects a flame or a light source of a wavelength in the range of 760nm-
1100 nm.
• Detection range: up to 100 cm.
• Adjustable detection range.
• Detection angle about 60 degrees, it is sensitive to the flame spectrum.
• Operating voltage 3.3V-5V.
• Digital and Analog Output.
Flame Sensor
There are two types of Flame Sensor:
1. DO digital switch outputs (0 and 1)
20
Tracking Sensor
In this experiment, we will use an obstacle
avoidance sensor module and an LED attached
to pin 13 of the Arduino board to build a simple
circuit to make a tracking light.
Since an LED has been attached to pin 13,
connect the pin out to D8 of the Arduino board.
When the tracking sensor detects reflection
signals (white), the LED will be on. Otherwise, it
will be off (black line).
21
Experimental Procedures
Step 1: Build the circuit
S D8
- GND
+ 5V
22
Experimental Procedures
23
Experimental Procedures
const int tracingPin = 8;
const int ledPin = 13;void setup()
{
pinMode(tracingPin, INPUT);
pinMode(ledPin, OUTPUT);
}void loop()
{
int val = digitalRead(tracingPin);
if(val == HIGH)
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}
24
Metal Touch Sensor
Introduction:
A metal touch sensor is a type of switch that
only operates when it's touched by a charged
body. It has a high-frequency transistor which
can conduct electricity when receiving
electromagnetic signals.
25
Metal Touch Sensor
26
Metal Touch Sensor
Experimental Principle:
27
Experimental Procedures
the LED attached to pin 13 of Arduino, connect pin D0 of the sensor to D7 of the
Arduino board. When the metal touch sensor detects touch signals, the LED will be on.
Otherwise, it will be off.
Step 1: Build the circuit
AO A0
G GND
+ 5V
D0 D7
Step 2: write a program to touch the base electrode of the transistor and the LED
attached to pin 13 on the Arduino board will light up.
28
Experimental Procedues
29
Experimental Procedues
• int touch = 0;
• int motor=7;
•
• void setup() {
• // put your setup code here, to run once:
• pinMode(2 , INPUT);
• pinMode(motor , OUTPUT);
• Serial.begin(9600);
•
• }
•
• void loop() {
• // put your main code here, to run repeatedly:
• digitalWrite(motor,HIGH);
• touch =digitalRead(2);
• Serial.println(touch);
•
• while(touch==1)
• {
• digitalWrite(motor,LOW);
•
• }
• }
30
THANK YOU ANY QUESTION