Read external circuit voltage

JanickGers85
Posts: 4
Joined: Sat Sep 12, 2020 11:47 pm

Read external circuit voltage

Postby JanickGers85 » Sun Sep 13, 2020 12:04 am

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?!
Attachments
IMG_20200913_011308_2.jpg
IMG_20200913_011308_2.jpg (1.19 MiB) Viewed 4381 times
Last edited by JanickGers85 on Mon Sep 14, 2020 4:13 pm, edited 1 time in total.

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: Read external circuit voltage

Postby ESP_Sprite » Sun Sep 13, 2020 8:02 am

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.

JanickGers85
Posts: 4
Joined: Sat Sep 12, 2020 11:47 pm

Re: Read external circuit voltage

Postby JanickGers85 » Sun Sep 13, 2020 10:13 pm

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?
Last edited by JanickGers85 on Mon Sep 14, 2020 8:10 am, edited 1 time in total.

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: Read external circuit voltage

Postby ESP_Sprite » Mon Sep 14, 2020 7:58 am

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?

JanickGers85
Posts: 4
Joined: Sat Sep 12, 2020 11:47 pm

Re: Read external circuit voltage

Postby JanickGers85 » Mon Sep 14, 2020 3:57 pm

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.
Attachments
pcb_front_untouched.jpg
pcb_front_untouched.jpg (455.53 KiB) Viewed 4381 times
pcb_front_described.jpg
pcb_front_described.jpg (520.31 KiB) Viewed 4381 times
pcb_back_untouced.jpg
pcb_back_untouced.jpg (545.25 KiB) Viewed 4381 times

JanickGers85
Posts: 4
Joined: Sat Sep 12, 2020 11:47 pm

Re: Read external circuit voltage

Postby JanickGers85 » Mon Sep 14, 2020 4:12 pm

I lifted the big yellow capacitor and I've taken a clearer picture of the back.
Attachments
IMG_20200914_180203.jpg
IMG_20200914_180203.jpg (1.03 MiB) Viewed 4381 times

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: Read external circuit voltage

Postby ESP_Sprite » Tue Sep 15, 2020 11:13 am

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.

Who is online

Users browsing this forum: No registered users and 141 guests