Circuit and working
The outputs of IC3 change state synchronously with the low-to-high transitions on the clock inputs. Separate count up (CPU) and count down (CPD) pins of IC3 are used here. Its parallel pin 11 is made high and parallel data input pins 15, 1, 10 and 9, along with master reset pin 14, are made low in this circuit.
The outputs (Q0 through Q3) of IC3 are given to IC4 to drive display DIS1. Resistor R11 is used to limit the current flowing through DIS1.
Outputs of IC3 are also given to IC5. output O1 of IC5 is fed to relay-driver transistor T3 through resistor R9 to energise relay RL1. Light switches off when RL1 is energised. The second output O2 is fed to relay-driver transistor T4 to energise relay RL2 for locking the door. RL1 and RL2 energise simultaneously as inputs of 4-input NOR gate (IC5) are connected to both the drivers.
Download PCB and component layout PDFs: click here
Output O2 of IC5 is also given to the base of transistor T7 whose collector is connected to the base of transistor T6. When O2 of IC5 goes high, it locks the door and makes the Vcc pin 8 of IC1 low to stop further counting.
When each person enters the room and presses foot switch S1, counter IC3 advances by one count and display shows the number of persons in the room. On first person’s entry, the outputs O1 and O2 of IC5 go low, transistors T3 and T4 stop conducting and relays RL1 and RL2 de-energise to switch on the light and open the door lock.
Similarly, when they start leaving the room by enabling foot switch S2, counter IC3 reduces by one count and the display shows the number of persons present in the room. the outputs O1 and O2 of IC5 remain low, so light remains on and door remains open till the room is vacant.
Construction and testing
A single-side PCB for the circuit is shown in Fig. 2 and its component layout in Fig. 3. After assembling the circuit on PCB, enclose it in a suitable case. Switches S1 and S2 should be installed as explained earlier. The display can be installed on the door frame outside the room. Fix switches S3 and S4 at a suitable location such that you can press them simultaneously when needed.
Connect the door-lock assembly to relay RL2 contacts using external wires as shown in Fig.
1. Use a 2-pin connector each for connecting the light and lock assembly.
EFY note. Avoid entry of more than nine persons. Otherwise, at the entry of 10th person, the display will show ‘0,’ the door will get locked and the lights will switch off. If this happens, someone will have to press switch S2 from inside the room to open the lock and switch on the lights.
The author is a lab engineer at EFY Lab.