Intermediate DIY-er needs advice.
I'm trying to detect if my Air Conditioner power indicator LED is on from ESP8266 microcontroller (Wemos D1 Mini).
The indicator LED is on a small PCB module with a header, through which it is connected to the unit's controller. So injecting a couple of wires will not be a problem.
Here's a simplified schematics of the module connected to the controller:
The LED is switched on by the controller by pulling it to the ground. I have measured voltage between GND
and LED1
when LED is on and it was approximately 2V.
I want to connect the ESP8266 like on the schematics below to detect if LED is on (using pin D5
with INPUT_PULLUP
):
D5
would output 3.3V.
The questions that I have:
- Will this approach work to detect if LED is on?
- Am I risking damaging the controller by feeding it 3.3V via
LED1
connection?
UPDATE: Another approach that I considered was using an optocoupler connected in series between the LED and the board:
-
1\$\begingroup\$ The opto-coupler option is the way to go as it provides electrical isolation between the two circuits. You won't need additional series resistance. If anything you would reduce R8 somewhat but with a 13 V output it will make little difference. \$\endgroup\$Transistor– Transistor2021年07月14日 06:27:54 +00:00Commented Jul 14, 2021 at 6:27
1 Answer 1
That won't work, and could damage the board.
Suggest adding a 2N7000 MOSFET as follows:
schematic
simulate this circuit – Schematic created using CircuitLab
The output will be "high" when the LED is "on".
The resistors are optional but I would suggest using them. They may cause the LED to slightly glow 'on'. You can parallel the LED with 10K if that is objectionable.
-
\$\begingroup\$ Thanks for your input. Would using an optocoupler be ok too? E.g as on the schematics added to the bottom the original post. This way the LED should not glow 'on' when off. \$\endgroup\$Muxa– Muxa2021年07月14日 06:16:15 +00:00Commented Jul 14, 2021 at 6:16