Showing posts with label Infrared. Show all posts
Showing posts with label Infrared. Show all posts

Sunday, 1 April 2012

Infrared Beam Break Detector

This purpose of this article is to design a circuit using Infrared signals to detect a beam break which can be used in multiple real world applications. The IR receiver used is TSOP1738. Below are some of the main requirements of Infrared Transmiter signal properties as described in the datasheet
  • Carrier frequency should be close to the  center frequency of the bandpass (38kHz)
  • Burst length should be 10 cycles/burst or longer
  • After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is neccessary

Design


1. Carrier Frequency (f1) : The center frequency of TSOP1738 is 38kHz

f1 = 1.44/((Ra1+2Rb1)C)
f1 = 38kHz

Let
Ra1 = 1k
C = 0.01uF

With that Rb1 = 1.394k or
Rb1= 2k variable resistor


2. Burst and Gap frequency (f2) : Let burst cycle equals gap cycle be equal to 40 cycles (burst between 10 and 70 cycles and gap greater than14 cycles)

f2 = 38k/ 40
f2 = 950
f2 = 1.44/((Ra2+2Rb2)C)

Let
Ra2 = 10k
C = 0.01uF

With that
Rb2 = 70.789k or
Rb2 = 100k variable resistor

Note:
1. BC547 is used at the output of transmitter as switching transmitter to boost the voltage increasing the range.

2. When the Infrared beam is broken, the output of TSOP1738 goes high. Using switching transistor 2N2222, the signal is inverted to High to Low which can be directly interfaced to External edge triggered interrupts of 8051 (EXT0 and EXT1)

Infrared beam break detector transmitter receiver circuit

Sunday, 4 March 2012

People Counting Machine with GSM

The main objective of this project is to design a system which counts the number of people present inside a premises with the count being sent automatically as an SMS upon dialing the phone number.


It consists of 3 modules

1. Infrared Transmitter and Receiver
There are two of them say IR1 and IR2. Breaking the beam of IR1 first and then IR2 will increment the count by 1 where as breaking the beam IR2 and then IR1 will decrement the count. The output of IR1 and IR2 are connected to microntroller interrupts INT0 and INT1 respectively. Complete design of IR Tx and Rx can be found here : Infrared Beam break Detector


2. Microncontroller with LCD
The microcontroller used here is 89c51. INT0 and INT1 of the micronctroller is connected to output of IR1 and IR2 respectively. It is connected to a GSM module via a serial port. And the microncontroller is also connected to a LCD which displays the total count at any given point of time. The microntroller increments or decrements the count based on weather INT0 interrupt occurs first and then INT1 or vice versa and continuously displays on the LCD. Micronctroller will also receive a serial interrupt when there is an incoming call in whch time it will read the phone number, disconnect and send the total count as a SMS

3. GSM Module
The microcontroller sends AT commands to GSM module to read the phone number, disconnect and send an SMS to the calling number. Below are the AT commands used.

1. Disconnect a call
ATH  and Enter

2. Read the phone number of an incoming call
  • Set the below AT command only once
  • AT+CLIP=1 and Enter
  • When there is a incoming call, the data from GSM will be similar to below for default settings
    • RING
      +CLIP: "+919449XXXXXX",145,"","",0
      RING
      +CLIP........
    • Read the phone number above into an array and send the SMS
    3. Send an SMS

    AT+CMGF=1 and Enter
    AT+CMGS="+919449XXXXXX" and Enter
    "Hello World" and CTRL+Z

    During programming CTRL+Z requires to be sent as 0x1A Ascii character while the escape character for Enter is '\r'. For better understanding on sending a SMS and C code, refer to Sending SMS using AT commands


    Saturday, 25 February 2012

    Burglar Alert through SMS

    The main purpose of this project is to design a system that would automatically send SMS to a predefined number up on the Infrared beam is broken between transmitter and receiver.


    It consists of 3 modules

    1. Infrared transmitter and receiver
    It consists of 38kHz Infrared transmitter and TSOP1738 Infrared receiver. The transmitter has 40 burst cycles and 40 gap cycles that satisfies the requirement of TSOP1738 that between 10 to 70 burst cycles, there has to be atleast 14 gap cycles. Complete design can be found here : Infrared Beam Break Detector circuit

    2. Microcontroller
    The microcontroller used here is 89c51. When the Infrared beam is broken, there is a high to low signal in the Infrared Beam Break Detector circuit. The micrcontroller is initialized to received edge triggered external interrupt (EXT0). When a interrupt is triggered, the micrcontroller sends the necessary AT commands to send an SMS to a predefined phone number.

    3. GSM modem
    The microcontroller sends AT commands to GSM module to send an SMS to the predefined number. Below are the AT commands used. The AT commands are

    AT+CMGF=1 and Enter
    AT+CMGS="+919449xxxxxx"
    and Enter
    "Burglar Alert!" and CTRL+Z

    Complete explanation and C-code can be found here : Sending SMS using AT commands

    Friday, 24 February 2012

    Path Following Robot with Obstacle Detection


    The main aim of this project is to design a robot that can follow a black path without collisions detect the end of the path and turn back. The black path below the car can be determined using the principle that black color absorbs all radiations and the presence of an obstacle is detected using ultrasonic waves.





    The project comprises of four main blocks

    Infrared Transmitter and Receiver


    IR transmitter consists of a IR led while the receiver used is IR transistors L14G2. When the Infrared rays fall over base of the IR Led, it is turned on. To catch this variation, the collector of IR transistor is fed to a comparators in LM324 IC  as shown in the circuit diagram. We use 4 such Tx Rx modules each at the corner of a rectangle. When the robot reaches the end of the path, only the forward Tx Rx detect white path while the backward Tx Rx module still detect the black path. This case is used to turn around the robot until the forward Tx Rx modules detect black path. In other cases, the robot turns left if one/both of the right Tx Rx module detect a white path. Similarly, the robot turns right if one/both of the left Tx Rx module detect white path. If all of the Tx Rx module detect a black path the robot moves forward.
    Black Line Detection Circuit
    Black Line Detection Circuit

    Ultrasonic Transmitter and Receiver

    Ultrasonic signals are used to detect obstacles in the path of the robot. Ultrasonic signals scores over Infrared signals in that they can detect obstacles of irregular shape as well as that of black color. Complete design of the circuit can be found here :  Ultrasonic Transmitter and Receiver

    Microcontroller


    The  microcontroller used here is 89c51. It is interfaced with DC motor driver H-Bridge IC L293D. The pins P0.0 to P0.3 receive the 4 IR signals indicating weather they are on black or white path. The microcontroller is programmed to drive the robot in either forward, left or right direction. The   microcontroller also continuously monitors the pin P0.4 which is connected to the output of ultrasonic obstacle detection circuit. When the pin P0.4 detects a obstacle, the microcontroller stops the robot. On reaching the end of the path, the microntroller rotates the robot until it encounters the black path and then continues foward. 


    
    Microcontroller Interface to H-Bridge
    Microcontroller interface to H-Bridge

    H-Bridge and DC motors


    The robot is driven by DC motors. To drive the motors we use an H-bridge-L293d which boosts the microcontroller logic voltage to 9v that is required to drive these motors. In our case, we used a 9v, 100rpm DC motor. To achieve higher speeds, DC motors of higher torque and voltage can be used.