Microcontroller With IR Sensors
Microcontroller With IR Sensors
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
IR sensor Pair Object / Line
Transmitter (Tx)
Receiver (Rx)
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
WHITE surface Maximum reflection T1 is turned ON Vout is LOW
R1< R2
A T 8 0 5 1
0 1 2
In
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
differs
from
- O/p is either 0 or 5V
- Responds only to IR pulses at 38KHz ( or 36KHz) - 3 terminal device (Vcc, GND and O/p)
TSOP Output
No IR Light
f 38KHz
O/p = 5V 0V
Nomenclature
Commonly available models of TSOP are
TSOP1736 TSOP1738
responds only to pulses at 36KHz responds to 38KHz pulses
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.
GND
O/p Vcc
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
http://lpu.co.in/oe/ece881
From within LPU : student login UMS