microcontroller with ir sensors
DESCRIPTION
Micro-Controllers & RoboticsRaman kumar Lovely Professional UniversityA sensor when coupled with an electronic circuit converts the physical change into a signal which can be read by an observer or by an microcontroller.The most common use of sensors is to get feedback from external environment.IR Sensor PairIR sensor Pair Object / LineTransmitter (Tx)Receiver (Rx)Transmitter = LED (Light Emitting Diode) Receiver = PhotodiodeIR LED• Similar to normal LEDs but emit infra-redTRANSCRIPT
Micro-Controllers
&
Robotics
Raman kumar
Lovely Professional University
A sensor when coupled with an electronic
circuit converts the physical change into a
signal which can be read by an observer or by
an microcontroller.
The most common use of sensors is to get
feedback from external environment.
IR Sensor Pair
Transmitter (Tx)
Receiver (Rx)
IR sensor Pair Object /
Line
Transmitter = LED (Light Emitting Diode)
Receiver = Photodiode
IR LED
• Similar to normal LEDs but emit infra-red light
• Glow can be seen with a digital camera or
mobile phone camera.
Photodiode
A photodiode is a diode that conducts only when light falls on it.
O/p = 5 V = 0.7 V
Transistor
Principle of Operation
R1< R2
WHITE surface
Maximum reflection
T1 is turned ON
Vout is LOW
BLACK surface
Minimum or No Reflection
T1 is turned OFF
Vout is HIGH
Interfacing IR sensor with
microcontroller
A
T
8
0
5
1
Port 1
Out: 1
Out: 0
In
1
0
2
Sensor Connector on board
O/p
GND
Vcc
Programming IR sensor with 8051
#include <regx51.h>
void main( )
{
P12=1;
while(1) {
If ( P12==1)
// do something
else
// do the other thing
}
}
• Vout is ANALOG
But uC being digital can only read it as 0 or 1.
0 if Vout < 1.2 V
1 if Vout > 1.2 V
However most applications require much higher
resolution & multiple levels.
TSOP
GND
Vcc
O/p
TSOP
• TSOP is also an IR sensor, but differs from
phototransistor in the following aspects.
- O/p is either 0 or 5V
- Responds only to IR pulses at 38KHz ( or 36KHz)
- 3 terminal device (Vcc, GND and O/p)
- Has a lot of electronic circuitry inside along with simple
IR Rx.
• TSOP is the IR receiver used in TV sets for receiving
signals from remote control.
TSOP Output
No IR Light f ≠ 38KHz Constant IR Light
O/p = 5V O/p = 0V
f = 38KHz
Nomenclature
Commonly available models of TSOP are
TSOP1736 responds only to pulses at 36KHz
TSOP1738 responds to 38KHz pulses
To use TSOP as Rx, the IR LED must blink at 38KHz
(36KHz).
So a 38KHz waveform needs to be applied at the +ve
i/p of IR LED instead of the constant +Vcc as in earlier
case.
This 38KHz signal can either be generated used PWM
mode of timers or separate astable multi-vibrator made
using NE555.
Complete TSOP sensor
GND
Vcc
O/p
IR LED
38KHz
waveform
source
Wireless Control of Robots
RF Remote (radio Control)
RF Modules
IR Remote
Mobile Phone
RF Remote
Plug n play remote, everything ready
Numerous controls
Very costly
Rx Can be directly connected to motor driver
RF Modules
Cheap
Rx Can be directly connected to motor driver
Require external Antenna to be connected.
Require parallel to serial converter at Tx and vice versa at Rx
Commonly avai freq are : 315MHz, 345 MHz, 434 MHz
IR Remote
Replacement of H bridge
Download this ppt
http://lpu.co.in/oe/ece881
From within LPU : student login UMS
Raman
9988900339