I have several devices in my home that I would like to add to my home automation setup using esp8266 as an arduino. These devices have push buttons that I can control with relays, but I would like to also know if the device is on or off. I would like to be able to continue using the device how it was intended, but its state be reflected in my home automation program if its state was changed manually at the device.
These devices have LED indicator lights that I would like to "monitor" from the esp8266. I know I could use photo resistors, but I would rather solder to the board so there is no apperence of alteration on the outside if the device.
So, the question is how would I go about reading the state of the LED in another circuit using the esp8266?
"Ground" is a problem when making direct connections between boards on different devices, especially if they are powered from different legs of the household circuit, where differences in ground potential can lead to malfunction.
Optical coupling is the only simple and reliable way of doing what you want to do. Put a phototransistor behind the monitored LED, if you can access the location, and make no electrical connection to the monitored device.
Thanks, I will look and see if that is a possibility, not sure how much room i have to work with. I forgot to mention though, I am powering the esp from the device, using a voltage regulator to drop 12v down to 3.3. So... I am using the same ground, not sure if that will make a difference.
jremington:
That makes all the difference in the world. Make sure you do not exceed the voltage limit of the ESP8266 input.
So I still have the same question, how would I "detect" the led?
I have tried to connect the positive side of led to the esp and that doesn't work. If I test the positive side of the led with a multimeter and the common ground I get about 4.9 volts on or off. So I am not sure how to detect the difference between on and off.
The LED is probably connected to an active low output. Check the negative side of the LED, or better, trace the circuit and connect to the actual output pin.
Optocoupler anode/cathode side in series with the LED, may have to track down the resistor of that LED and adjust if the additional load dims it too much. This assuming you want the original LED to still be there.
jremington:
The LED is probably connected to an active low output. Check the negative side of the LED, or better, trace the circuit and connect to the actual output pin.
INTP:
Optocoupler anode/cathode side in series with the LED, may have to track down the resistor of that LED and adjust if the additional load dims it too much. This assuming you want the original LED to still be there.
Also a good idea, I have never used one before, but looks pretty easy, I'll order some. Any suggestions on what I should get?