Door Entry Detection for MCU Based Designs

This article discuss how you can detect the entry of a person in a room and get this signal inside your MCU. This is NOT a complete project but just an idea that can be implemented in many different projects. The technique is to use use an IR transmitter and a receiver pair. One side of door will have an IR Transmitter and the other side of door will have an IR Receiver. The transmitter (Tx in short) will continuously send IR beam to the receiver, as long as the receiver(Rx in short) will receive this beam it will give a voltage output in range of 2.5v to 3.0 volts. But as this beam is obstructed, for example by someone entering the room, the receivers output will tend towards 4.5

Door Entry Detection Schematic

Fig. 1 – Schematic For Door Entry Detection

The IR Transmitter can be made on a small PCB as shown below. It has four mounting holes to fix it in the wall near the door. Please use 1 Watt resistor for R2 and R3 (22ohms).

IR Transmitter

Fig. 2 – IR Transmitter Module

Similarly the IR receiver module is made.

IR Receiver

Fig. 3 – IR Receiver Module.

 

Mount the IR Transmitter and Receiver as shown in the image below.

Mounting Burgler Alarm

Fig. 4 – Mounting the Modules on Door.

As you can see the optimal distance between the transmitter and receiver is 2.0ft. to 3.5ft. While the Rx/Tx should be mounted at the height of 3.5ft. from the ground.

Reason for NOT using TSOP Receivers.

Many people would ask why I have used photo transistors and not modulated IR receivers like TSOP1738 etc. The reason is that the TSOP series sensors were designed for data transfer, mainly from hand held remote control to devices like TV’s or DVD players. So following points were kept in mind while designing TSOP sensors.

  • Maximum range (So that remote could be easily operated in big rooms), since these have long range you cannot assume that only the rays that are directly incident on the Rx are the only rays reaching it, rays bounced from walls also reach the sensor. So actually their are more than one path from the Tx to Rx. This makes door entry detection impossible because if the person entering the room cuts one path, the ray would reach from the alternate path! As you can see this situation is actually good for a TV remote (for which TSOPs were designed) but not for our application.

Reason for using two Tx

Simply to make IR beam stronger and to reach the other side of door without any problem.

Reason for using Filtered IR Rx

Their are two types of IR Photo transistor available. One is transparent white, this one is sensitive to both IR and Visible radiations. The second one is with Black case, this one is only sensitive to IR radiation.

Known Issues

The setup will not work in presence of sunlight due to presence of IR component in it. Nor will it work if the room is lit with incandescent bulbs (filament bulbs), so it is recommended to use this in room that is lit with florescent source like CFLs or Tube lights.

Facing problem with your embedded, electronics or robotics project? We are here to help!
Post a help request.

Avinash

Avinash Gupta is solely focused on free and high quality tutorial to make learning embedded system fun !

More Posts - Website

Follow Me:
FacebookLinkedInGoogle Plus

16 thoughts on “Door Entry Detection for MCU Based Designs

  • By Auro - Reply

    In place of photo transistor can we use TSOP1738?

    • By Maaniq - Reply

      yes , you can use 1738 at rx. in that case, you can.t simply connect the power to tx. instead, you have to use 555 at astable mode for tx . then only, 1738 will receive the rays from tx.

    • By Avinash - Reply

      Many people would ask why I have used photo transistors and not modulated IR receivers like TSOP1738 etc. The reason is that the TSOP series sensors were designed for data transfer, mainly from hand held remote control to devices like TV’s or DVD players. So following points were kept in mind while designing TSOP sensors.

      Maximum range (So that remote could be easily operated in big rooms), since these have long range you cannot assume that only the rays that are directly incident on the Rx are the only rays reaching it, rays bounced from walls also reach the sensor. So actually their are more than one path from the Tx to Rx. This makes door entry detection impossible because if the person entering the room cuts one path, the ray would reach from the alternate path! As you can see this situation is actually good for a TV remote (for which TSOPs were designed) but not for our application.

  • By Maaniq - Reply

    this is not Door Entry Detection, this should be mentioned as door “pass by” detection.
    if it is entry detection means, any detecting methods are used particularly for entering alone ?
    no, it can also alert, if someone else is leaving out.
    so its simply a ‘pass by ‘ detector and not an entry detector.

  • By radhe shyam - Reply

    Hi all.
    I am trying to make a door entry system to count the no. of person entering a room, exiting as well as have to take care of the late entry and early exit.
    I considered use of two ir led and photo diode pairs. When detector d1 then d2 is activated the count will increase and if reverse it will decrease.

    But using IR – Photo diode pair is not giving a result for its satisfactory operation.
    As the gap between the LED and Diode is around 1.5 meter, so the voltage across photo diode is 17mv in full light and 6mv in no light.
    I am not able to manage with this because its not going to drive any pin of microcontroller to 0 and 1.
    Please reply as soon as u can.

    • By yash patil - Reply

      Bro just make 2 doors exit and entry and keep 1 PIR sensors in each door and connect it to a system and name those two sensors exit and entry it will show how many entrys and exits

  • By swetachalapathi - Reply

    With a few modifications this circuit can be even better. Having a Tx and Rx and using an IR beam is not necessary. Also aligning the Tx and RX is difficult as the beam is not visible. Instead keep both the TX and RX on the door frame and put a mirror on the door this way alignment problems can be solved. You can also make a single board containing TX and RX which will simplify matters even more. Another modification that over comes the daylight problem is to modulate the TX with a 1 Khz signal and filter the light coming from the RX for the 1 KHz beam. This way ambient light will not have any effect.

    • By Avinash - Reply

      @Swetachalapathi

      Thank you for your kind suggestions !

  • By student - Reply

    I am trying to design a door entry counter system. my project include two IR sensors and two photo diodes as transmitter and receiver with the use of single door as the passage terminal. I have even designed the program in the software level. m using a microcontroller and LM324 to convert the photodiode output to the logical format.

    If anybody have done this project earlier, i want to have some suggestion regarding the limitations that can be arise during this project.

  • By maheshwari - Reply

    sir can u please send me program for line follower robot in embedded c……which includes a header file of reg51.h

  • By jai - Reply

    sir, please tell me how I make door entry counter
    system.

    • By Avinash - Reply

      @Jai,

      Why?

  • By Georg Hemmer - Reply

    Could you tell us, which type of IR transmitter and receiver pair you used?

  • By MOHIT Sharma - Reply

    Sir please tell me how I can able to know that which person entered into my office like which employ entered into my office
    Please reply me on my mail ID

Leave a Reply

Your email address will not be published. Required fields are marked *


× 4 = sixteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>