Infrared Counting entrances and exits through doors GP2Y0A21YK PIC16F676

| December 17, 2024 Updated
Infrared Counting entrances and exits through doors GP2Y0A21YK PIC16F676

The aim is to make a simple and at the same time effective device that will count the number of people entering and exiting rooms with a single entrance door. The detection was carried out with Sharp GP2Y0A21YK sensors, based on the use of infrared distance sensors for security systems. These sensors work at short distances between 10 and 80 cm, which is sufficient for a door.

The width of the doorway in the building varies between 60 and 80 cm. If you place two sensors in series and number them, for example, DR1 and DR2, the person entering the room will first block the beam. When exiting from the first sensor, then from the second, and then from the second and then from the first exit, the number of people in the room is tracked.

The use of the device is not limited to turning the lighting on and off in rooms. Different scenarios can be created according to the need.

The operating principle of the device is as follows; Two sensors positioned 10 cm apart on the horizontal plane and measuring the distances to the opposite wall, the analog outputs 1-2 and 2-1 in sequence are queried by the PIC16F676 controller in accordance with the program algorithm.

If the first sensor is triggered, the controller waits for the second sensor to be triggered. After the second sensor is locked and released, the controller adds one to the counter. When exiting, the sensor beam is blocked first 2, then the first one, and after the beam is released, the controller subtracts 1 from the counter.

The number of people entering and exiting the room can be up to 255. When the last person leaving is recorded, the counter shows 0 and the controller gives the command to turn off the load. The electronic and power circuits are optically separated using the MOC3083 Optoisolator.

The device body must be mounted on the inside of the door so that the telemetry beams do not cross the working area when the door is opened and closed. The setting consists in adjusting the signal amplification from the telemetry beams, so that when the beams are open, the LEDs indicating the overlap of the beams are turned off.

On the front of the device, in addition to the DR1 and DR2 telemetry meters, there are indicators for the presence of the counter power and a presence indicator. If the counter detects that a person has entered, the “Presence” LED lights up, if the last person leaves, it turns off together with the load connected to the power relay.

Infrared door Entry Exit Counter Circuit Diagram

circuit-infrared-input-output-counter-gp2y0a21yk-pic16f676-schematic

 

Infrared Counting entrances and exits through doors GP2Y0A21YK PIC16F676

Password: 320volt.com

chipmk.ru

Published: 2024/12/17 Tags:



Leave a Reply

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