Presented here is a simple counter that counts the number of visitors entering or exiting an auditorium or any other place where you have installed this circuit at the gates. On receiving an interrupt from light-dependent resistor (LDR) sensors, the circuit increments the count and shows it on a 7-segment display.
With these units installed at the entrance and exit gates, you can calculate the number of visitors present in the room by subtracting the count at the exit gate from the count at the entrance gate. The system should be installed on a door such that only one person can cross through at a time, interrupting the light falling on the LDR sensor.
Circuit and working
The circuit is built around popular CD4026 counter ICs (IC1 and IC2), light-dependent resistor (LDR1), transistor BC547 (T1), common-cathode seven-segment displays (DIS1 and DIS2) and a few other components. The advantage of using CD4026 counter IC is that it drives a 7-segment display without the need of a driver IC.
The resistance of LDR1 decreases when the intensity of light falling on it increases and vice versa. In dark or absence of light, the LDR exhibits a resistance in the range of mega-ohms, which decreases to a few hundred ohms in presence of bright light.
In this circuit, the amount of light falling on LDR1 decreases as a person crosses the entrance/exit gate and his shadow falls on LDR1. Consequently, the resistance of LDR1 increases to provide a clock pulse to pin 1 of IC1 through transistor T1. During this time, LED1 stops glowing momentarily, indicating that someone is entering or exiting the hall.
ICI consists of a Johnson decade counter and an output decoder that converts the Johnson code into a 7-segment decoded output for driving one stage in a numerical display. When it receives a clock at pin 1, it advances the count on display DIS1 by ‘one.’ Similarly, the count on the display advances by ‘one’ with each person entering through the gate. When the count reaches ‘9,’ one cycle completes.
Carry-out pin 5 of IC1 is connected to clock pin 1 of IC2 to cascade another counter. On the next clock after count ‘9,’ it goes high to provide a clock pulse to IC2, advancing its counter by one. Now IC1 starts all over again.
DIS1 shows the unit’s digit and DIS2 shows the ten’s digit of the count. After completion of each cycle, ten’s digit advances by one. You can add more CD4026 counters with 7-segment displays for further extending the display to three digits, four digits, etc. For this, you have to connect carry-out pin 5 of each CD4026 to clock pin 1 of the next CD4026 as shown in the circuit diagram. Pin 15 of both IC1 and IC2 are connected to ground through resistor R5. A reset switch (S1) is connected to 6V for resetting the display to ‘00.’
Download PCB and component layout PDFs: click here
Construction and testing
An actual-size, single-side PCB for the visitor counter is shown in Fig. 2 and its component layout in Fig. 3. After assembling the circuit on a PCB, enclose it in a suitable case. Fix LED1, DIS1 and DIS2 on the front panel. Use a two-pin connector for connecting the power supply to the PCB.
This is a simple circuit and should work immediately after assembly. To check the circuit for proper functioning, verify voltage levels on various test points as per the test point table.
Proper installation is very important. Mount LDR1 on the gate such that light falling on it is interrupted when somebody passes through the gate. We have used a fixed resistor here but, if necessary, you can use a preset in place of R2 for tuning the system to your environment.
The author is a hobbyist and M.Tech from Banaras Hindu University (BHU)