Microcontroller which is controlling mains voltage circuit requires 5 volts to operate.
Is it realistic to use diode bridge followed by capacitor to straighten the ac wave and then use voltage divider to get 5 volts from 240 without actually burning anything up ? Or using transformer is the only means ?
Just thought to learn something new, if it is realistic.

  • 10
    \$\begingroup\$ It is certainly possible, but if you need to ask then you'd best avoid the incredible shock hazard potential. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 18 '17 at 14:52
  • 5
    \$\begingroup\$ From the comments and answers one thing should be clear to you: a transformer provides an (often) essential extra function: isolation. Meaning that it will be safe to touch the 5 V output without getting an electric shock. That's a nice feature I would say. \$\endgroup\$ – Bimpelrekkie Oct 18 '17 at 15:11
  • \$\begingroup\$ Possible duplicate of electronics.stackexchange.com/questions/281972/… \$\endgroup\$ – winny Oct 18 '17 at 16:34
  • \$\begingroup\$ Another possible duplicate: electronics.stackexchange.com/questions/127855/… \$\endgroup\$ – winny Oct 18 '17 at 16:35
  • 1
    \$\begingroup\$ Yes it's possible but potentially very unsafe you might want to simulate the circuits given in the answers provide here but please don't actually build any of them mains electricity can be fatal if you don't fully understand what you are doing. \$\endgroup\$ – Warren Hill Oct 18 '17 at 17:14

Capacitive power supply circuits have been used for decades in things like alarm clocks, small appliances (coffee makers) and the like. They work pretty well for small constant loads without the bulk of a heavy transformer.

example capacitive power supply circuit The example circuit uses for C1 a capacitor labeled 225K, which refers to 2.2µF with a tolerance of 10% (see capacitor notation). Components ratings for the Zener diode (ZD) and LED are dependent on the expected power output.

However, they are scary to work on and need special considerations for user safety.

Do not think about using one unless you really know and understand what you are doing.

Even an experienced engineer like myself will shy away from them, designing everything to the right of the bridge using a bench supply till everything else is proven functional before plugging in the AC with my other hand in my back pocket.


Some switching power supplies also avoid using the large power transformer by rectifying the mains voltage into a large DC voltage then use high frequency switching through a much smaller transformer. Again, though, "There be dragons here!", and the DC voltages on the primary capacitors are nasty.

  • 10
    \$\begingroup\$ As a switch mode power supply engineer "There be dragons here" is not an understatement and I use an external isolation transformer when testing and designing these to reduce the risk to a safe, for me, risk. Inexperienced people should never work on circuits like this. +1 for pointing out the safety risk. \$\endgroup\$ – Warren Hill Oct 18 '17 at 17:21
  • 1
    \$\begingroup\$ @WarrenHill thanks for the up-vote and well said. Yes an isolation transformer in your test setup is a great addition when working with main level voltages. However I feel compelled to add, an isolation transformer wont save you if your poking around in the circuit with two hands on the wrong spots.. Last words of many a technician has been "It's ok, I'm using an isolation transformer!" hmm.. maybe I'll have them carve that on my headstone..LOL \$\endgroup\$ – Trevor_G Oct 18 '17 at 17:33
  • 2
    \$\begingroup\$ That's why I said safe, for me. I agree only experienced engineers should work on mains powered equipment. \$\endgroup\$ – Warren Hill Oct 18 '17 at 17:36
  • 4
    \$\begingroup\$ It's worth looking through the archives of the YouTube channel run by a person under the name of "Big Clive". He's taken it upon himself to disassemble and document the widest variety of cheap and potentially dangerous consumer electronic equipment he can find. Many of them use capacitive droppers, and it's somewhat scary how many of the lack the varactor (labelled "MOV" in the diagram above) that is actually a critically important safety feature of this kind of power supply. \$\endgroup\$ – Jules Oct 19 '17 at 0:16
  • 1
    \$\begingroup\$ @AdamDavis assuming the diode is 12V which would jibe with the series resistor of the LED ~10mA, C1 would be 225nF. That would put ~13.5V on that big electrolytic at that load. \$\endgroup\$ – Trevor_G Oct 19 '17 at 15:54

The answer is "yes" - but it is dangerous because there is no isolation and component failure can lead to the full voltage and current from the mains appearing at the output. Here is a description

enter image description here

You need to adjust values to get your 5VDC. If you do not know how to do that, stay away from it.

  • 3
    \$\begingroup\$ Downvote because you can't ground the output of one of these supplies! \$\endgroup\$ – pericynthion Oct 18 '17 at 20:09
  • 1
    \$\begingroup\$ @pericynthion he mentioned it's not isolated, so what do you want? \$\endgroup\$ – Nick T Oct 18 '17 at 23:17
  • 3
    \$\begingroup\$ @NickT he probably meant the connection of the (-) rail to the Ground on this circuit is questionable. \$\endgroup\$ – George Y. Oct 18 '17 at 23:28
  • 1
    \$\begingroup\$ @NickT Yes. However, the whole thing is questionable. As for tying neutral to earth, that might increase its safety but OTOH it might decrease it if they are not locally tied together nearby on the mains. For one, your circuit breakers might not like it. And if you don't have earth current circuit breakers you risk significant earth current flows. \$\endgroup\$ – Dirk Bruere Oct 19 '17 at 8:21
  • \$\begingroup\$ Upvote because the OP said "Is it realistic to use diode bridge followed by capacitor to straighten the ac wave and then use voltage divider to get 5 volts from 240 without actually burning anything up ?" and @Dirk Bruere said "The answer is "yes" - but it is dangerous" which is correct, is it possible, although is dangerous and should be avoided. \$\endgroup\$ – mguima Oct 24 '17 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.