I need to detect the state of an LED in a machine that I cannot connect to in any electrical way. So I would like to measure the light emitted from this LED.

The conditions:

  • The ambient lighting is low to very low (both the machine containing the LED and the sensing device are inside a box with few and small holes)
  • The sensing component can be very close and well aimed at the LED (distance between 0 and max 5mm)
  • The LED is orange (if that is relevant?)
  • Input will be processed by a PLC

My question is: what component meets the following criteria the most? Criteria in order of priority (from high to low): reliable detection, simple wiring (few components, easy to wire to let's say an arduino), easy programming the microcontroller, and low price.

I am looking into these alternatives (but maybe there are more?).

  • LDR (light dependant resistor)
  • Phototransistor / photodiode
  • LED as a light sensor (in the same colour as the emitting LED)

Which component meets the criteria the best?

  • \$\begingroup\$ What is this for? \$\endgroup\$ – Nick T Dec 15 '14 at 17:34
  • \$\begingroup\$ The machine (a printer) has an LED indicating errors, when it is blinking some actions needs to be taken. \$\endgroup\$ – Sebastian Dec 15 '14 at 18:41

Probably a phototransistor. It would be best if you could shield it from outside light and attach it closely to the target.

One thing to consider is if the LED is actually illuminated continuously or merely appears to be illuminated continuously. The phototransistor will likely be fast enough to pick up multiplexing that would not be obvious visually. If so then you'd need some kind of filter.

The general approach would be to use a phototransistor plus a resistor (maybe a parallel cap) and a comparator such as an LM393 with a reference formed by another couple resistors.

Using an LED as a photodiode (or a real photodiode) is possible, but the output current is very low compared to a phototransistor and it would thus be more sensitive to electrical noise and might require a bit more complex circuit (such as a transimpedance amplifier).

  • \$\begingroup\$ Thank you for your answer, could you explain why you don´t consider the LDR ? Wouldn't it be simpler to wire since you only need an extra resistor? (like in this setup: udemy.com/blog/arduino-ldr ) (I don't think there is multiplexing involved since it is a simple status LED, but thanks for the info!) \$\endgroup\$ – Sebastian Dec 15 '14 at 16:40
  • \$\begingroup\$ You could use a similar circuit with the phototransistor (just a resistor) and depend on the micro input for the comparator. LDRs are less stable than phototransistors and have gotten harder to find (especially in countries with strong environmental laws) due to the toxic cadmium used. There was an exemption for professional audio equipment but that expired five years ago. \$\endgroup\$ – Spehro Pefhany Dec 15 '14 at 16:47
  • \$\begingroup\$ If the sensor is going to be right in the LED's face, wouldn't a phototransistor be prone to saturating? \$\endgroup\$ – Nick T Dec 15 '14 at 16:53
  • \$\begingroup\$ @NickT Is that a problem? \$\endgroup\$ – Spehro Pefhany Dec 15 '14 at 17:16
  • \$\begingroup\$ Depending on the type of 'measurement', it won't give as much information as you might need. Most of the reasons I can think of to measure an LED's output are for something like calibration. That said, the OP didn't really mention what this is for. \$\endgroup\$ – Nick T Dec 15 '14 at 17:34

Sounds like you're trying to make an optocoupler.

In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is a component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal.

If that's not what you're trying to do, I would go with the photodiode/~transistor: it either conducts or it doesn't, while an LDR gives you some resistance dependent on the light intensity (compare digital and analogue). Using an LED as a light sensor would basically be the same solution as using a photodiode (see this instructable or Detecting light with an LED), but could be nice if you don't have a photodiode at hand. I never tried that method myself though.

  • \$\begingroup\$ Thank you for your answer, in principal the detecting device would make an optocoupler-like combination with the machine containing the LED. However I need to read the status of this machine and do some other action if the error LED blinks. I may not open this machine. So an optocoupler would not help here. \$\endgroup\$ – Sebastian Dec 15 '14 at 16:32
  • \$\begingroup\$ I see, yes, if you have two different machines you can't use an optocoupler. I will leave the note here though for future visitors. For the rest, I would still recommend a photodiode / phototransistor over an LDR or an LED as a light sensor. \$\endgroup\$ – Keelan Dec 15 '14 at 16:33
  • \$\begingroup\$ Yes leave the note, very well. If you read the resistance of the LDR with an A/D port and than threshold it in the microcontroller program, wouldn't that give the same 1/0 logic of the phototransistor but than in programming language? (so more tweakable). \$\endgroup\$ – Sebastian Dec 15 '14 at 16:48
  • \$\begingroup\$ @Sebastian sure! You wouldn't need a microcontroller for that, a comparator would suffice as well. But if you're using a uC with analogue port anyway, use that by all means. \$\endgroup\$ – Keelan Dec 15 '14 at 16:49
  • \$\begingroup\$ Your answers has helped me, however I will mark the other answer because it is slightly more elaborate. Thanks for your help! \$\endgroup\$ – Sebastian Dec 15 '14 at 18: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.