I'm trying to understand how to build a battery charger.

I need to convert from the usually european 220 VAC to 24 VDC but also from USA 110 VAC to 24 VDC like the normal chargers, to adapt it to the whole world plugs.

From the secondary to the battery it's clear for me, rectification, smoothing and regulation.

But my problem it's, how to connect or make the transformation from 220 or 110 VAC?

How can I use both of the voltages (one or another not two at the same time) to feed the transformer without using a manual voltage selector? Like the most of the chargers?

If the avobe solution it's complicated, how can I install the manual voltage selector in my design? and also I need just only one transformer or for both design I need two different trasnformers?

Thanks in advance for your help! :)


closed as too broad by Edgar Brown, Bimpelrekkie, RoyC, Finbarr, Sparky256 Mar 27 at 23:06

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ buy a 24V laptop computer power adapter \$\endgroup\$ – jsotola Jun 3 '18 at 19:48
  • 2
    \$\begingroup\$ google auto voltage select power supply schematic \$\endgroup\$ – jsotola Jun 3 '18 at 19:50
  • \$\begingroup\$ How long do you want the battery to last? Battery charging in a way that results in long service life is a well refined science. Not easy to do. \$\endgroup\$ – Harper Jun 3 '18 at 21:47
  • \$\begingroup\$ thanks guys, it's for a clasee project, but I wanted to ask here because you guys are the best in this topics! \$\endgroup\$ – Tom Bromel Jun 4 '18 at 9:55

You are, I'm afraid, approaching this wrong. You seem to think that rectification and regulation occur after the transformer. While this is true for simple supplies, especially those with linear regulators, that's not how it's done in universal supplies.

For these supplies, rectification and 1st stage smoothing take place at line voltage. This means that the input capacitors are rated at 400 to 450 volts.

Regulation then takes place using a switch-mode regulator which will handle a 2:1 input range, followed by a second stage of smoothing at the output voltage. The relative insensitivity of a well-designed switching element makes the power dissipation low and allows the approach.

With that said, there is a conceptually simple approach which you can look into, although I doubt very much that you'll get much joy out of it.

Charles Cowie provided a schematic for switching a dual-winding transformer. If you can find such a beast, you could replace the switch with a relay whose winding is activated by AC at a voltage of about 170 VAC. An input of 230 VAC would produce a different contact connection that 120, and the transformer/relay combination would auto-select for the proper transformer connection.

Of course, you'd need to design your regulator to accept transient voltages twice the optimal, since it would take a fraction of a second to respond to application of 230 VAC. Power dissipation, though, would not be an issue due to the short high voltage time.

Another issue is relay response. A relay, once activated by a rated voltage, will typically remain activated until the input voltage gets quite low, due to the armature being pulled close to the magnets. This would only be a problem if you somehow operated in an environment where the power voltage varies from 230 to 120 with no dead period. It would not be a problem for simply responding to being plugged in to an arbitrarily-chosen socket.


A modern AC/DC power supply, one for a laptop as a comment suggests, has 2 switching converter stages.

The first stage is a boost converter. The output of the boost converter is 400 VDC or greater so that at European high line the boost output is still above peak to peak line and hence above full-wave rectified line.

The boost converter makes its 400 V output from the rectified AC input. Note this is not rectified and filtered to DC plus ripple with a capacitor. The boost stage provides power factor correction (PFC) as well so it must see the AC line voltage waveform. PFC means that current drawn from line is approximately sinusoidal and in phase with line voltage.

When presented with 120 VAC, the boost stage draws more current to deliver the same output power. Ripple on the boost output will correspond to 60 Hz rather than 50 Hz line but otherwise variation in the line voltage is handled by the boost converter.

After the boost converter is some type of isolated converter. Lower power supplies will use a flyback because it requires fewer components. Flyback converters are not practical above a few 100 W because all the transferred energy must be stored in the transformer core. Higher power designs use forward converter topologies, resonant topologies, ect. These can be very interesting.

Another complication is that all products that interact with AC line need to be certified to safety, EMC, and other standards appropriate to the country where they are sold. Buying a AC/DC converter shifts this complexity and cost onto the supplier.

Unless you want to get into the complicated world of AC/DC conversion, I suggest you purchase an appropriate supply. Either:

  1. Buy an AC/DC converter with the maximum voltage and power you need a design a charging stage after it.
  2. Buy an appropriate AC/DC battery charger.
  3. Buy some modules (at least the AC/DC module) and add your own circuitry.
  4. Your design is so low power (less than 0.5 W) that something like directly regulating the output of AC coupled line is reasonable.

For the second option, I think you will find that products exist to meet your need. Search "Programmable battery charger" for example.

If you are trying to find out how these things work, take the cover off of a laptop power adapter you no longer need. Study its construction (not plugged in). Please do not plug it into AC line once you have taken it apart. High voltages and significant energy is exposed. The heat sinks, among other things, are likely live.


To drop from 120/240 to the 20 volts or so that you want for your charger rectifier, you have twi choices.

If you use a transformer, you an buy one that has a dual-voltage primary. That is usually done by providing two 120-volt windings that can be connected in series for 240 volts or in parallel for 120 volts. The voltage change cam be done with a switch, but it is a rather complicated switch. It is possible to get a transformer that has two transformer connections that can be selected with a less complicated switch, but that means less efficient use of the transformer requiring a larger transformer than necessary.

You could also use a electronic buck converter circuit that is designed to provide a regulated DC charging voltage with a variable input voltage.

Detailed explanations of both of the above can be found on the internet.

Here is the series-parallel, 240/120 volt transformer and switch diagram found on the internet:

enter image description here

  • 1
    \$\begingroup\$ It's a series/parallel switch. Literally. DPDT wired cleverly. Done. \$\endgroup\$ – Harper Jun 3 '18 at 21:50
  • \$\begingroup\$ Many thanks for the explanation Charles, I get it. So, whatever I use 120 or 240 VAC in the secondary always I'll get 240 VAC right? Just to confirm \$\endgroup\$ – Tom Bromel Jun 4 '18 at 9:52
  • \$\begingroup\$ Whichever you use, you get the same voltage on the secondary. When you buy the transformer, you select a secondary voltage to suit your charger design. \$\endgroup\$ – Charles Cowie Jun 4 '18 at 12:08
  • \$\begingroup\$ Something like this would work for you I think. It has a little switch to go between 120 and 240 and you can connect it directly to your dual winding transformer. \$\endgroup\$ – Avid Pro Tool Feb 15 at 1:36

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