I'm planning to build a circuit that reads LEDs displayed from another separate off-the-shelf proprietary system without reverse engineering or modification (which would cause warranty issues) of that system. Just for example, I would build an external device that reads LED status indicators of my Internet router then performing actions on my circuit in response to the LED status. That can be accomplished without an Application Programming Interface (API)

I imagine I would need some kind of light dependent resistor (LDR), but is there an optimum device built for it? The photonic component should ideally block light from external environment so that only the LEDs on a target device provides the signal. Does such a device differentiate between different colors of a multi-color LED, as another practical example for an EV battery charger may use a multi green-and-red LED to indicate charging and standby modes, respectively, turning off a relay to the charger when the LED status is green?

All these device must not modify the components (including status LEDs) of the system or device

  • \$\begingroup\$ Your example is not very specific so the answer won't be either. How about a webcam? Should detect arbitrary light and colour and does not even need to block external light. \$\endgroup\$
    – Justme
    Commented Nov 13, 2023 at 6:48

1 Answer 1


I am assuming that you will use a GPIO interface.

I have used a phototransistor to do this for a one-time test. For a permanent solution, attaching the sensor to your device is a mechanical design challenge. Maybe 3-D print something.

Most phototransistors sense light from a wide spectrum, to differentiate between colors, you will need a good optical filter. Attaching two sensors with different filters to one LED indicator could be a mechanical challenge.

These are cheap: WL-TTRW, Digikey PN 732-1540052NA3090-ND

This is probably too expensive for your application, a Vishay VEML6040 color sensor with I2C interface. I have played around with one of these, it can differentiate colors.


simulate this circuit – Schematic created using CircuitLab


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.