I have an electrical circuit which uses an LED, connected to a µC, to show the status of an x-ray source in another room. Obviously this LED is important to have in a working condition.

Now, LEDs can fail in in multiple ways, one being a broken circuit, another being a short circuit.

I have thought about using a light sensitive resistor to check the status, yet the surrounding light might break this. I then thought about PWMing a "signal" on to my LED power, trying to read the same signal from my light sensitive resistor - assuming that no outside light emits the same strobe signal (I might even modulate the signal further in its frequency over time).

Is there a "best practice" way of detecting if my LED is still working, emitting light as it should, without being disturbed by outside light?

  • \$\begingroup\$ Probe it with a multimeter. \$\endgroup\$ Nov 20, 2017 at 11:08
  • \$\begingroup\$ I rather meant "something built into my circuit" to check constantly / repeatedly. \$\endgroup\$
    – Christian
    Nov 20, 2017 at 11:37
  • 2
    \$\begingroup\$ Have multiple LEDs, then if one fails replace it. \$\endgroup\$
    – HandyHowie
    Nov 20, 2017 at 11:38
  • \$\begingroup\$ I was hoping for an automated alarm, somehow built into the circuit. \$\endgroup\$
    – Christian
    Nov 20, 2017 at 12:09
  • 2
    \$\begingroup\$ Normally, "lamp test" is a manual function -- you press a button and verify that all of the indicators light up. If you make it an automatic self-test, how is a user observing it supposed to know that it's a test and not the actual x-ray status? But anyway, LEDs are very reliable when operated well within their specs, which isn't hard to do. How are you going to make sure that whatever hardware and software you add to test it is more reliable than (or at least as reliable as) the LED itself? \$\endgroup\$
    – Dave Tweed
    Nov 20, 2017 at 12:12

1 Answer 1



simulate this circuit – Schematic created using CircuitLab

Figure 1. (a) Monitoring forward voltage across LED. (b) Monitoring LED current by opto-isolator.

Figure 1a may provide the best solution. The analog input should read around 2 V for the LED when on, 0 V if short-circuited and +5 if open-circuited. In addition the ADC can be read when the LED should be off to confirm that the micro output is OK.

enter image description here

Figure 2. Use the chart to estimate the expected forward voltage drop across the LED based on its colour. The current is the y-axis value of the point where the loadline crosses the chosen coloured LED curve. The expected forward voltage drop is the x-axis value of the same point. Source: LEDnique.com (mine).

Figure 1b: If analog inputs are not available monitoring by opto-isolator is an option but not as precise as the analog monitoring. It will not be able to differentiate between a working and short-circuited LED.

In either case the LED can be toggled periodically to test the LED whether on or off.

  • 1
    \$\begingroup\$ perhaps use the Opto output to go to a buzzer (as mentioned above, by Christian). \$\endgroup\$ Nov 20, 2017 at 14:51
  • \$\begingroup\$ @Christian: Thank you. See the update with a load line. I suggest that you unaccept my answer for a day or so to allow time for the Earth to rotate once so that everybody has a chance to answer. You may get some better insights and solutions. \$\endgroup\$
    – Transistor
    Nov 20, 2017 at 17:16
  • \$\begingroup\$ (the buzzer,of course, could also be inserted in option a. as submitted above, by Transistor, (ADC IN)) \$\endgroup\$ Nov 20, 2017 at 21:03
  • \$\begingroup\$ @Transistor I "unaccepted" your answer as per your request for a few days, yet your solution seems darn genius to me. \$\endgroup\$
    – Christian
    Nov 21, 2017 at 10:47

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.