Pages: [1]   Go Down
Author Topic: Determine if an LED is on or off on another device.  (Read 609 times)
0 Members and 1 Guest are viewing this topic.
Indiana, US
Offline Offline
Newbie
*
Karma: 0
Posts: 39
*_+
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I want to use my arduino to tell if an LED is on or off on a different electronic device.
I don't want to use a LDR because ambient light will affect the reading, is there a way that I can connect the arduino to the LED leads and use analog read to tell that the LED is on/off without affecting the LED?

Something like ...
Arduino A0 connected to LED +
Arduino GND connected to LED -

then somethign like...
Code:
if(analogRead(A0) > threshold){
 // LED is ON
} else {
  // LED is OFF
}
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Sounds like something that should work. If the device drives the LED with 5V (and include a resistor) you better measure over the resistor and the LED.
You could then use a "simpler" digitalRead(PIN) instead resulting in HIGH or LOW.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Indiana, US
Offline Offline
Newbie
*
Karma: 0
Posts: 39
*_+
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks robtillaart,
Good call with the digitalRead() that sounds like a better approach than analogRead()
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't forget to connect the grounds of the two systems together or it will not work.
Logged

Pages: [1]   Go Up
Jump to: