I want to make a circuit where there will be a photodiode which when receives infra red light from the IR LED for the first time, produces a high output and when it receives the light for the second time, the output ahould become low. When it stops receiving the light, the previous output state should be retained.

enter image description here

I have found a latch circuit using 555 timer which uses pushbuton to toggle states. How can I replace the pushbutton with my photodiode circuit so that the objective can be achieved? What components should I add to realize this circuit?

  • 1
    \$\begingroup\$ It might be best to forget modifying a pushbutton circuit to be suitable for IR photodiode, as it might be more complex than designing a circuit specifically for the photodiode. I mean, why does it have to use a 555 to begin with. \$\endgroup\$
    – Justme
    Commented Jul 18, 2023 at 17:54

1 Answer 1


The problem with inserting a photodiode in your circuit in place of the switch is that the direction of current through the switch (or sensor) changes with each trigger event, and a photodiode is, well, a diode.

Any J-K or D CMOS flipflop can perform the toggle function without the resistors and capacitor, and the current direction through the switch or sensor is the same for all events.

The next step is a small circuit that turns the current change through a photodiode into a large enough voltage swing to clock a flipflop. This is not as difficult as it might sound.

Note that the 555 circuit had a version of the same issue, needing a small enough voltage drop across the switch or sensor to create a large enough voltage change at pins 6 and 2 to cause the 555 to change state.

Does it have to be a photodiode? Can the sensor be a photo-transistor? Also, consider fully-integrated optical sensors that have a photodiode and amplifier integrated into one device.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.