I'm trying to measure the voltage on a pcb traces, to use it later on, in an arduino program.
My problem is that because the pcb is from a cheap product, the power block consists of a capacitor, a zener diode and some other components but no tranformers.
I tried google and gpt, and figured it probably is something called a capacitive dropper or a capacitive power supply. And that it probably isn't safe to connect directly to an arduino board and might even have a large voltage difference. Although I'm not sure about any of that. But if it's correct, is there a way to do it safely? For example I've thought of powering the board from the pcb traces with a voltage regulator.
It's not clear what you are trying to do, you wrote "interfacing", "measure the voltage" and "powering".
It's not safe to probe capacitive power supply.
This capture from wikipedia might help you to decide:
" The primary downside of this type of power supply is the lack of galvanic isolation between the input and output, which means the output side is a dangerous shock hazard. For safety reasons, this type of power supply and every circuit connected to it must be double insulated in all places where a person could come into electrical contact with it.[3] In addition, failure of a single component can result in unacceptably high voltages at the output. For instance, if the Zener diode in the circuit shown should fail open, there will result a gradually-rising voltage at the output, eventually reaching the input (AC) voltage.[4]"
Transformer-less supplies are widely used in consumer products, including those from highly regarded manufacturers.
Mainly used in low current devices like timers, heating programmers etc.
A suitably sized capacitor is used to limit the current. A Zener sets the voltage.
I personally wouldn't use them for your application.
If you build everything in a closed container, it should work.
Do not connect to USB from your computer...
...it may destroy your computer....
Maybe not a safe and easy starter project...
Be aware that all traces may be at over 230VAC....
...so deadly...
Yes, with a linear optoisolator
If the capacitor fails, things can get warm.
It's done to save money.
In the interest of keeping things simple, there are good power supplies and there are cheap power supplies but there are no good cheap power supplies. A good and safe power supply using an inverter can be had relatively inexpensive. Avoid at all cost anything capacitive dropper.
Just My Take
Ron
The problem is, even if you make your project double-insulated with no connections to the outside world, it's difficult to develop, test, and debug with no USB or other outside connections.
Even if everything is done right and no components fail, if the hot & neutral get reversed through a mis-wired outlet or through an extension cord, etc., 5V relative to ground can become 5V relative to 120V with (115V relative to neutral and ground).
That can fry you or your computer, etc. It's only safe if it's electrically isolated and completely contained in a plastic box.
Thank you all for replying. I'm afraid I wasn't clear enough, sorry.
To kmin although I read that wikipedia page but didn't notice the part where it says only failing a zener diode might cause rising voltage. I'm not an engineer and just a hobbyist but I'm getting into pcb repair and this is one of my customer's boards. Although maybe it's worth saying that the output is supposed to be at the input AC voltage when it's on, so hopefully the pcb is designed to tolerate that. Based on what @tigger said I should be expecting to see and work with many similar situations. To build_1971 It destroying my computer actually is what I was afraid of, and also traces being over 230VAC, thanks for the affirmation. @jim-p Care to elaborate please? I've got a couple 4n35 ic's but haven't worked with them ever, only bought them among so many other ic's because they were cheap and I wanted to have things, do they work for my purpose? I was afraid that by using them I somehow just shift the issue problem of the capactive dropper to the optoisolator if that makes any sense. Maybe it helps clearing out the confusion that I'm given this pcb to repair and I'm trying to test some low voltage DC signals on it, and on similar pcb's by writing an arduino program to monitor certain points on the traces with the ADC.
I was thinking of a solution to keep the measurements accurate and the PC safe by having the same power rails for the arduino and the PCB:
DC-side of the pcb right after the zener diode ----> a voltage regulator ----> vin and gnd pins of the arduino
And then:
ADC pins of the arduino ----> traces which i'm testing
And then using an lcd instead of the serial monitor
I have some other questions too:
Does the dc part of the circuit fluctuate because of it being powered by a capacitive dropper?
Does it matter which AC wire from the plug goes into which AC input of the pcb?
Are both dc sides i.e. vcc and gnd have a large voltage difference with mains?
The simple answer is if you are connecting ANYTHING powered from the mains to SOMETHING ELSE powered from the mains there is a possibility of a catastophic failure.
The only safe way is to isolate one or both by transformers.
AS @KM says.
You could eg have one using the neutral as a ground. Which it ISNT.
Your arduino doesn't mind if it's bonded to mains, but one moment YOU forget that while tinkering...
What is this device? Can't you test the circuit with external isolated supply?
For example, smart relays are often powered like that and MCU gnd is bonded to mains live.
You can hack them, flash them, whatever, but not when they are powered from mains.
Maybe find a separation transformer...
Without the background, guidance and a good schematic it will be much more cost effective just to simply buy a replacement.
Thank you! thinking that way make things clear, now that i think about it, doing arduino personal projects I have never connected two things powered by completely different sources.
Sorry now I'm confused again, in what ways does the arduino not mind it.
It's a microwave sensor, powered by mains from the input, and switching a mains-powered load on the output again.
I also don't understand the concept of testing it with external isolated supply, because is an arduino which is connected to and powered by my pc through usb, which has a transformer in its psu, not isolated from mains? Is it ok if I power the arduino with a wall adapter because they are isolated from mains?
Is this the same as a 1:1 transformer? I've never used them, do they go between arduino and pcb? like connecting the pins to the transformer and the other side to pcb? I'm ok with that but it kinda sounds weird in my head and I wanna make sure I'm doing it the right way.
I might be able to draw the schematic for it but it takes a bit of time.
It seems you have a microwave detector device, which is mains powered, has a transformerless power supply, and it drives a relay, and you want to test it.
I'd probably work out a strategy for testing it in stages, minimising the testing which is conducted while the device is connected to the mains supply. A schematic diagram, as already suggested, would be a good starting point.
Stage 1 would be to test the (transformerless) power supply and determine what voltages it is delivering using a multimeter. The electronics will be powered at a low DC voltage (say 5v). The relay coil maybe driven at a higher voltage (say 24v). The remaining testing would be done without the device being connected to the mains.
Stage 2. I'd then work out a way of using a bench power supply (or other isolated supply) to power just the low voltage electronics. If the electronics are 5v or less, there may be a role for an Arduino in testing this part.
It is a 1:1 transformer that goes between your mains and your device. If the device is coffee machine or so, the transformer needs to be quite big. Not a cheap solution...
I have not used a linear supply in a PC since 1984. I have been getting rid of my transformer-wall-warts since 2000. I buy switching power supplies instead. Is there a problem with using those?
Near weightless USB 5V 1A plug-ins to lightweight 60W adjustables… oh no?
How about DC-DC converters?
Yes.
One like this (there are several others)
The input is totally isolated from the output and unlike a transformer, you can measure DC voltages.
The 4n35 is basically only useful for knowing if a voltage is present or not
So why don't you post the circuit you have?
I can imagine something like a light with motion sensor (not some sensor inside you microwave oven) .
I expect that there's MCU and sensor that are powered let's say at 5V. Capacitive power supply provides that. But if you want to play with the sensor without risking your life, you use isolated 5V power supply instead. Like a phone charger in case of 5V.
Thank you.
So, mine is digital and the one you're recommending is analog. Are these typically powered by two different voltages on their two sides?