Go Down

Topic: Detecting a led lighting up (Read 1 time) previous topic - next topic

Michaelc1985

hello all

This is my first post. I was wondering is there a way that I can detect when a led is powered on a device such as a CD player or PS3 controller by detecting when it receives power.

Thanks

Michael

KenF


weedpharma

Simplest way would be a light dependant resistor. You would have to come up with a way of mounting it to collect as much light as possible.

To connect it to your Arduino, put a 10k resistor from 5v to an analogue input, then the LDR from input to gnd. Read the analogue input and set you trigger point to a value that indicates the LED is lit.

You may have to change the 10k depending on the value of the LDR. Use a multi meter to measure the R of the LDR with and without the LED lit. Look for a value that will give a good range of voltage variation with the R from 5v in the range of 1k to 27k.


Weedpharma

Michaelc1985


KenF

Can it be done without LDR?
If you have access to the wiring inside the CD player.

Michaelc1985

Yes I do. I can solder to the board

raschemmel

Would you be content to know how much current the led is drawing? (measure the voltage across the current limiting resistor using an analog input )

Consider this:
If the led is not lit, it won't draw any current.
If the led is burned out , it won't draw any current.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

KenF

Would you be content to know how much current the led is drawing? (measure the voltage across the current limiting resistor using an analog input )

Consider this:
If the led is not lit, it won't draw any current.
If the led is burned out , it won't draw any current.
But the voltage being supplied to the LED would be detectable, whether the LED is blown or otherwise.  So I think the voltage across the diode would be more useful,

raschemmel

If the resistor is connected to power and the diode to ground you can measure the forward voltage, which,
now that I think about it , would actually be more useful. If it were wired the other way around, the voltage across the led would have to be subtracted from 5V. If it was 2.3V , then the voltage measured across the resistor would be 2.7V. I think the first method would be preferred because if you measure between 2.3
and 3.3V , it's a pretty safe bet that the led is working or it wouldn't be in that range.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Paul__B

Yes I do. I can solder to the board
Well now, here is the problem.  You need to figure out to what the LED is connected.  Generally, a LED has a current limiting resistor in series - you want to be able to detect the voltage not just across the LED, but across the combination of the resistor and LED.

As you determine this, you want to know which side of this combination  is connected to either a supply line or a ground line, and which side is switched by some transistor or IC.  You need to know what voltage is applied to that combination so that you can figure how to apply it to the Arduino.

An easy way to do this is to use an opto-coupler with a series resistor, this combination wired across the combination of resistor and LED you found on the circuit board, the resistor you use for the opto-coupler being five times the value of the resistor on the board.  The output (transistor element) of the opto-coupler is then wired between an Arduino input and ground with that input set to "INPUT_PULLUP".

raschemmel

Short version: Two- for- one offer.
Light one led , get one free.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Go Up