Page 1 of 1

Read external circuit voltage

Posted: Sun Sep 13, 2020 12:04 am
by JanickGers85
Hello there,
I would like to read an analog voltage from a circuit that is powered by different AC-DC transformer, different from the 220VAC-3.3VDC that powers my ESP: basically I would like to read the voltage of a led cathode to know if is on or not.
If I measure voltage between cathode and GND pin of the ESP with a multimeter sometimes I read 25V, sometiems 3V and sometimes a voltage that is out of scale! (>600V!!!)
How is it possible?!

Re: Read external circuit voltage

Posted: Sun Sep 13, 2020 8:02 am
by ESP_Sprite
First of all, did you connect the ground of the original PCB to the ground of the ESP? If not, you're measuring the voltage difference between two separate circuits and that just picks up any EMF that hangs around in the air. Secondly, make sure that your LED actually is driven in a way where you can measure the output using only the cathode... it may be multiplexed or PWMmed or something.

In general, a nicer way is to take an optocoupler and put it's internal LED into the original circuit in such a way that it lights up when the LED you're interested in lights up. (Usually, this involves adding a series resistor and connecting that in parallel with the existing LED+series resistor.) This will give you a signal regardless of how the LED is controlled, and gives you galvanic isolation from the original PCB to boot, which stops you from electrocuting yourself if you happen to touch the ESP and the original PCBs power supply isn't galvanically isolated.

Re: Read external circuit voltage

Posted: Sun Sep 13, 2020 10:13 pm
by JanickGers85
Thanks for you reply.
It's the first time I work on a project like this, I know a few of electric theory but never done something like that so... :)
I like the option of a octocoupler but I don't know how to use it in my context.
I've mesured the voltage between anode and cathode and when off is 3.38V, when 2.46V when on; it's a blue led.
Honestly I'm a bit puzzled, BTW if I connect an octocoupler between anode and cathode I'll have the output always on regardless the LED is on or off, right?
How to use it correctly?

Re: Read external circuit voltage

Posted: Mon Sep 14, 2020 7:58 am
by ESP_Sprite
Hard to tell; there's some reverse engineering involved here. Can you post a clean picture of the back (as in: where the traces are) of that PCB the LED is on?

Re: Read external circuit voltage

Posted: Mon Sep 14, 2020 3:57 pm
by JanickGers85
Here the PCB, front and back, and what I've understood analyzing the circuit.
I tried to find "the end" of the rectifier, where the DC voltage is picked up, but without success.
Moreover, the IC on the PCB has nothing printed on it so I can't understand how it operate.
Basically I would like to know if every of the LED are on, and I would like to simulate switch presses too but i think it should not be a big problem using optocoulplers.

Re: Read external circuit voltage

Posted: Mon Sep 14, 2020 4:12 pm
by JanickGers85
I lifted the big yellow capacitor and I've taken a clearer picture of the back.

Re: Read external circuit voltage

Posted: Tue Sep 15, 2020 11:13 am
by ESP_Sprite
That helps. It looks like the LEDs are multiplexed; measuring one pin is indeed not going to help you there. You're in luck that the LEDs are blue, as these have a pretty large forward voltage. You should be able to get away with taking an optocoupler with an 100 ohm or so resistor in series with the led, and hooking that up to the LED you want to monitor. Do note that because of the multiplexing, the LED actually isn't on 100% of the time, so you may need to monitor the optocoupler over the duration of 100mS or so to see if it's actually on.