3

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?

Sebastian
  • 227
  • 1
  • 2
  • 7

2 Answers2

2

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).

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • 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: https://www.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!) – Sebastian Dec 15 '14 at 16:40
  • 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](http://webarchive.nationalarchives.gov.uk/+/http://www.rohs.gov.uk/Docs/Deleted%20Exemptions%20RoHS%2009%202010.pdf) but that expired five years ago. – Spehro Pefhany Dec 15 '14 at 16:47
  • If the sensor is going to be right in the LED's face, wouldn't a phototransistor be prone to saturating? – Nick T Dec 15 '14 at 16:53
  • @NickT Is that a problem? – Spehro Pefhany Dec 15 '14 at 17:16
  • 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. – Nick T Dec 15 '14 at 17:34
  • @NickT He said "measure state" which I think means he wants to simply detect if its on or off. If it's photometry he's after that's a different kettle o'fish. – Spehro Pefhany Dec 15 '14 at 17:36
  • Sorry NickT, you're right, I should have used the word detect. I corrected it in the OP. – Sebastian Dec 15 '14 at 18:43
1

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.

  • 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. – Sebastian Dec 15 '14 at 16:32
  • 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. –  Dec 15 '14 at 16:33
  • 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). – Sebastian Dec 15 '14 at 16:48
  • @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. –  Dec 15 '14 at 16:49
  • Your answers has helped me, however I will mark the other answer because it is slightly more elaborate. Thanks for your help! – Sebastian Dec 15 '14 at 18:47
  • @Sebastian sure, you don't need to rectify your decision. Happy to help, good luck with your project! –  Dec 15 '14 at 18:50