Is there any IC which converts 230V AC to 5V DC? As lossless as possible. I want to connect my microcontroller to an ordinary electrical socket and I don't have enough space available. Thanks.

  • 9
    \$\begingroup\$ How much current? How much space? And no, nothing is completely lossless; can you live with, say, 90% efficiency? Do you need isolation? \$\endgroup\$
    – Dave Tweed
    Commented Sep 23, 2012 at 22:01
  • 8
    \$\begingroup\$ Why not use a standard wall adapter? \$\endgroup\$ Commented Sep 23, 2012 at 22:21
  • 2
    \$\begingroup\$ You can use a USB charger and cut the USB cable to reveal the 5V and Gnd wires. (When you buy a new phone, you'll get a spare 230VAC to 5V DC converter.) \$\endgroup\$
    – Oskar Skog
    Commented Apr 24, 2017 at 12:17

7 Answers 7


There's no such thing as "lossless" anything in electronics, and there's not a single IC that's designed to do what you want. But here are some different supply ideas. Since you didn't specify current consumption or efficiency, let's look at three different approaches:

Non-isolating Zener supply

5% efficiency or less

Plug-in timers that are microcontroller-based usually use non-isolating power supplies, like this:

Non-isolated DC supply schematic

R1 essentially drops the difference between the Zener diode and the AC mains potential, so it's not going to be efficient for anything except light loads. Also, your load can't change dramatically, as the resistor has to be sized to provide enough current to the zener to cause it to reverse avalanche, without providing too much current. If your load starts pulling too much current, its voltage will drop. If your load doesn't pull enough current, the zener diode can be damaged.


  • Very small
  • Very cheap
  • Excellent for extremely light loads (MCU + switch device)


  • No isolation
  • Load current isn't flexible; must be fixed within small window

Mains-frequency regulated transformer supply

20-75% efficiency

You can always use a transformer (60:1 or so), a bridge rectifier, and a linear regulator, like this: Regulated DC supply schematic

This introduces a bulky, costly transformer into the design, but it's more efficient than the previous design, and your load can vary quite a bit.


  • Easiest to implement
  • Designed for medium current loads -- a clock radio, for example.
  • Full isolation
  • Relatively inexpensive


  • Bulky
  • Fairly inefficient

Fully-isolated Switch-mode AC/DC Converter

75-95% efficiency

Most efficient (and most complex) is a AC/DC switching converter. These work on the principle of first converting AC to DC, then switching the DC at very high frequencies to make optimal use of the transformer's characteristics, as well as minimize the size (and loss) of the filter network on the secondary. Power Integrations makes an IC that does all the control/feedback/driving -- all you need is to add a transformer and optoisolators. Here's an example design: Power Integrations LinkSwitch converter schematic example

As you can see, AC mains voltage is immediately rectified and filtered to produce high voltage DC. The Power Integrations device switches this voltage rapidly across the transformer's primary side. High-frequency AC is seen on the secondary, and rectified and filtered. You'll notice that the component values are quite small, even considering the current use. This is because high-frequency AC requires much smaller components to filter than line-frequency AC. Most of these devices have special ultra-low-power modes that work quite well.

These converters, in general, provide a great amount of efficiency and can also source high-power loads. These are the sorts of supplies you see in everything from tiny cell phone chargers to laptop and desktop computer power supplies.


  • Extremely Efficient
  • Full isolation
  • High output current: can source 50+ amps of low voltage DC fairly easily.
  • Small size


  • Large BOM (Bill of Materials)
  • Difficult to design
  • Requires thoughtful PCB layout
  • Usually requires custom transformer design
  • Expensive
  • 5
    \$\begingroup\$ The 7805 in figure 4 immediately reduces efficiency to under 70% due to very high dropout voltage of regulator. A modern LDO will greatly reduce that loss. \$\endgroup\$
    – Russell McMahon
    Commented Sep 24, 2012 at 1:10
  • 1
    \$\begingroup\$ Russell is right, but an LDO will fix that only partially. You still have to give it some headroom to cover mains voltage variations, the diodes also mean a 30 % efficiency loss. Add transformer losses and even with an LDO you won't get 50 % efficiency. \$\endgroup\$
    – stevenvh
    Commented Sep 24, 2012 at 6:58
  • 2
    \$\begingroup\$ Could you explain what is the NC winding of the transformer for in the design #3? \$\endgroup\$ Commented Apr 21, 2015 at 10:24
  • 1
    \$\begingroup\$ What about EMC ? What about Power factor ? What about line current harmonics ? \$\endgroup\$
    – Autistic
    Commented Nov 8, 2015 at 4:38
  • 8
    \$\begingroup\$ I think it needs to be emphasised for the benefit of beginners that 'non-isolating' for the zener supply means that the 'low voltage' side must be treated exactly like mains voltage as far as safety goes. Also from an end user perspective, switch mode supplies for commonly used voltages and power ratings are not 'expensive' but usually the cheapest option - it's hard to make your own 5 V, 1 A supply cheaper than you can buy a USB-output phone charger, unless you can scavenge all of the parts. \$\endgroup\$
    – nekomatic
    Commented Jan 27, 2016 at 14:16

I know it's an old question, but you might want to see the SR086. enter image description here
At Vout you just need to use generic dc reg (e.g. 7805) to get your 5V.

Note: This is not isolated, so it could be dangerous depending on the situation.

  • \$\begingroup\$ Interesting IC if there is no isolation required. \$\endgroup\$
    – Rev
    Commented Sep 22, 2014 at 8:54
  • \$\begingroup\$ Cool, that's one of those "why didn't I think of that" ideas... \$\endgroup\$
    – O'Rooney
    Commented May 16, 2016 at 5:25
  • 1
    \$\begingroup\$ Looks like a standard linear regulator, which will be nowhere near lossless. \$\endgroup\$ Commented Jul 6, 2016 at 3:30
  • 2
    \$\begingroup\$ @immibis It's not a linear regulator. The SR086 makes use of the fact that mains voltage is sinusoidal, by only activating the transistor when the mains voltage is suitably low. This means the transistor should only be operating in saturation or cut-off, implying low losses. The data sheet mentions 55%, which is not lossless, but not bad either for low-power applications. All this, of course, comes at the expense of a horrible power factor. \$\endgroup\$
    – marcelm
    Commented Jul 8, 2016 at 12:00
  • \$\begingroup\$ Price estimation on this circuit? \$\endgroup\$ Commented Jul 20, 2016 at 21:21

Old but actual question. After evaluating tens of approaches for AC/DC power converters I concluded following (for myself).


  1. Small size as possible.
  2. Less components as possible (footprint, size, price).
  3. Less heat dissipation (efficiency in other words).
  4. Low current, very low voltage, low output power.

Gave up requirement:

  • Isolation: in my application it's well isolated by box, no human protection needed.

(So far, I am going with LDO regulator LR8 based PSU. Best solution for current up to 30mA. Can be connected in parallel to get 100mA for extra price and footprint.) UPDATE: The LR8-based PSU is not relevant, its practical current is 3mA only. I implemented pretty small, simple and stable PSU with LNK305 IC. 1W PSU on LNK305 When R1=2k the output voltage is about 3.3V. C2 better to use few hundreds uF. All input circuit (D3, D4, L2, C4) I replaced with diode bridge. C5=2.2uF is enough - for small size and cost.

These circuits are so far good enough (taken from the Internet): less components + isolation bonus. enter image description here

This is second best non-isolated very simple circuit by ST.

enter image description here

In both circuits above the coil or transformer are pretty big and expensive.

Discarded variants:

  • All above in this thread due to complexity, transformers, isolation, total PSU price, etc.
  • Viper17 and Altair04 due to complexity and transformer.
  • HV-2405E based due to end of life.

I am mildly surprised that while the Non-Isolating Zener Supply was provided, there is no mention of a non-isolating capacitive reactance circuit voltage divider.

If the device functions within a narrow current requirement, this can be reasonably efficient. The chief issue with the design (well, besides not providing mains isolation) is that you cannot use electrolytic caps (which are polarized), and thus must source uF-range film caps rated at the AC RMS voltage (so a 240V circuit would need caps rated at 350V or higher), which are not especially compact. The capacitance values are also dependent upon AC mains frequency (60Hz in the USA, 50Hz in much of the rest of the world), as well as the actual mains voltage (which will be the case with any non-switching design).

IMO, a MOV (metal-oxide varistor) should be added to all of these designs to protect against line transients. One is present in the SR086 schematic (which curiously doesn't show attribution). That should bridge Line-to-Neutral (for US 120V mains), or Line-to-Line (for 240V mains), and be tapped between the fuse and load (as seen in the SR086 schematic), and ideally before any switches (since a sufficiently high spike can bridge a switch). This will help to protect your circuit - a MOV should handle many small spikes and surges with no problem, and will give its life on the big spike which would otherwise fry everything in your circuit, while the fuse between the MOV and mains will blow if the MOV shorts while doing its job.

I don't have a ready-made schematic of a capacitive reactance voltage divider, but you can find one in the Wikipedia article for Voltage Dividers

Wikipedia article for Capacitive Power Supply. The basic premise is that since you're dealing with AC, the capacitive reactance mimics resistance, but with the benefit of not actually "burning off" the energy - it is stored in the cap and returned to the line on the negative AC cycle.


Building on top of the 7805 idea, by using parts with less loss.


simulate this circuit – Schematic created using CircuitLab

This circuit replaced all 1N4001 rectifiers with 1N5819 Schottky rectifiers and used a low dropout linear regulator AMS1117-5.0.

The LDO can live with a smaller headroom than 7805 so if you want 5V output, you can feed it with 5.6V filtered, plus the two Schottky drops of 0.2V each you have an input AC peak voltage of 6V.

An LDO with PMOS pass element (AMS1117 used PNP BJT) can have even smaller loss (headroom of a few tens of millivolts from its \$R_{ds(on)}\$) and hence more efficient.

  • \$\begingroup\$ I always use schottkies at LV and I use descrete LDO . \$\endgroup\$
    – Autistic
    Commented Nov 8, 2015 at 4:35
  • \$\begingroup\$ @Autistic Discrete LDO? As in a RRIO op amp + reference + PMOS? \$\endgroup\$ Commented Nov 9, 2015 at 6:35
  • \$\begingroup\$ Maxthon Chan ,in theday I would use a long tail pair with a current mirror to drive the mosfet .This gave me flexability for different jobs needing different currents and voltages.Most of the time I was charging batteries so I would hang the longtail pair reference and voltage sense via a diode off the output.This gave me short circuit and reverse polarity protection .The volt drop was far better than available regulators in the day . \$\endgroup\$
    – Autistic
    Commented Nov 9, 2015 at 10:27
  • \$\begingroup\$ @Autistic Well those designs have crazy part count so I usually just stick with an LDO chip. If I do need high currents (e.g. my percision power supply design) I would use the aforementioned RRIO op amp + reference + PMOS. \$\endgroup\$ Commented Nov 9, 2015 at 11:56

Good reference design for simple, low-power transformer-less supplies: http://ww1.microchip.com/downloads/en/AppNotes/00954A.pdf


It's not actually an "IC" but it's a PCB mount package.

XP Power ECE05US05


Or if you don't need 5W, this one is only 1W

Recom RAC01-05SC


  • 1
    \$\begingroup\$ Element14 seems expensive: that same Recom module costs 30 % less at Digikey \$\endgroup\$
    – stevenvh
    Commented Sep 24, 2012 at 7:05
  • 1
    \$\begingroup\$ It's very nice to have no external components required (or, at least very few compared to the typical support for a switched mode DC-DC converter IC). But those are pricey ($20-$40). Is there anything available in the $3 range? (even just DC-DC that goes after the rectifier) \$\endgroup\$ Commented Oct 4, 2013 at 2:03
  • \$\begingroup\$ "IC" : it is actually an integrated circuit. \$\endgroup\$ Commented Feb 27, 2020 at 11:15
  • 1
    \$\begingroup\$ Interesting point Jasen. IC is usually taken to mean a circuit entirely on one silicon chip, not a circuit with discrete components that happens to be packaged together. Wikipedia seems to agree "a set of electronic circuits on one small flat piece (or "chip") of semiconductor". \$\endgroup\$
    – O'Rooney
    Commented Feb 27, 2020 at 20:31
  • 1
    \$\begingroup\$ Perhaps could be called a "Hybrid Integrated Circuit". en.wikipedia.org/wiki/Hybrid_integrated_circuit \$\endgroup\$
    – O'Rooney
    Commented Feb 27, 2020 at 20:42

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