Bidirectional Photoelectric System

Posted in Alarms and security, Digital, on 2015-05-25

Circuit diagram:

Bidirectional Photoelectric System


  • R1,R4__________Photo resistors (any type)
  • R2,R5___________20K 1/2W Trimmers (Cermet)
  • R3,R6____________2M2 1/4W Resistors
  • R7,R8___________10K 1/4W Resistors
  • R9______________22K 1/4W Resistor
  • C1,C2__________470nF 63V Polyester Capacitors
  • C3_____________100µF 25V Electrolytic Capacitor
  • D1-D7_________1N4148 75V 150mA Diodes
  • IC1_____________4093 Quad 2 input Schmitt NAND Gate IC
  • IC2____________40193 Presettable Dual Clock Up/Down Binary Counter IC
  • Q1_____________BC337 45V 800mA NPN Transistor
  • P1______________SPST Pushbutton
  • RL1_____________Relay with SPDT 2A @ 230V switch Coil Voltage 12V. Coil resistance 200-300 Ohm

Device purpose:

Photoelectric detectors are usually unidirectional, i.e. they are able to detect when someone enters a particular area but not when leaves it. On the contrary, a system able to detect movement in both directions could be useful to control shops, rooms etc.

If installed in a shop it could allow to know if all customers entering the premises have left them at the end of the day. Or, at home, it could be used to switch on the light (or any other electric device) when one enters the room and to switch off the electric device when he or she leaves it. Furthermore, the circuit is able to control the number of people, as it switches off the electrical device only when the last person has left the controlled area.

Circuit operation:

R1 and R4 are two common Photo resistors placed about 1cm apart and both facing the same source of light (e.g. a beam generated by any type of lamp placed on the opposite side of a door threshold). If a person passes through the door in one direction, the light is prevented to hit R1 at first, then R4: in this case IC2 counts up once. If the door is passed through in the opposite direction, the light is prevented to hit R4 at first, then R1: in this case IC2 counts down once.

The four outputs of IC2 feed the Base of Q1 (the Relay driver) by means of D3 - D6. Therefore the Relay will be energized each time one or more persons (up to 15) enter the room, and will remain in the "on" state until the same amount of persons entered has left the room. 

C1, R3, IC1C and C2, R6, IC2D form two monostable circuits, employed to shape the input pulses driving the up and down clock inputs of IC2. The first monostable to be started will stop the other by means of a diode (D1 or D2) in order to prevent an immediate up-down counting (or vice-versa) of IC2. P1 resets the counter.


  • R2 and R5 should be trimmed in order to allow proper operation of the Photo resistors, depending by the light source, distance etc.
  • For this reason and therefore to allow a reliable operation, a 12V regulated supply for this circuit is recommended.
  • The circuit was designed to count up to 15 people. This number can be increased cascading a further 40193 to IC2 thus allowing a maximum count of 255.

If you like this page, please consider sharing