Currently, I have a digital circuit running parallel to a LED to measure if it is driven high, with a zener clipper circuit to clip the voltage to 3.3v (max safe for microcontroller).

Current circuit is: this

This senses if S2 is closed but does not check if S1 is closed.

I want to have a digital circuit that checks if both S1 and S2 are closed.

Thanks in advance



simulate this circuit – Schematic created using CircuitLab

Figure 1. Opto-isolator to detect current flow in LED circuit.

The problem with your circuit is that with S1 and S2 open both ends of LED2 are floating and your GPIO input will be too so the logic level will be undefined.

A simple solution is to monitor the current in the LED circuit. This can be achieved with an opto-isolator as shown in Figure 1.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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