AC to DC Conversion

About: I've always loved to figure out how things work, so hacking and making just fits for me. I'm a husband, a father, an EOD technician with the WA Army National Guard, an automation engineer at Schweitzer Engin...

Every once in a while I come up with an idea for a circuit or device that has applications where a battery may not be the best or most convenient option for a power supply. One example is the Motion Activated AC Switch that I built. Since I was wanting to have the switch open a relay to allow AC current to pass through, it made sense to me to make the timer circuit inside utilize the AC power that was already there. I also don't want to have to open the box every time the battery dies. That required rectifying and regulating the 120VAC mains to a stable 9VDC. The problem is that it's AC, and most people are understandably nervous about working directly with AC mains. Hopefully I can dispel that fear with this Instructable.

Before we begin, a word of caution. AC MAINS VOLTAGE IS EXTREMELY DANGEROUS!!! You must be extremely careful. This Instructable is meant to help overcome the anxiety that comes with working with AC, but don't think that I don't get the chills every time I plug in the cord so I can test the circuit. I'm not trying to downplay the dangers involved. Take your time with it. Check your work, then check it again. Be aware of where the exposed wires are. Make sure that your workstation is either isolated from other people or that they are fully aware of what you are doing. I only work with mine in my office with the door locked so the kids can't physically interrupt me. That being said, I am not responsible in any way for anything that you do. Only you can know if you should proceed or not. When you get to the point where you feel comfortable, stop and do a mental check. Don't ever get comfortable or complacent with things that can seriously hurt you.

Step 1: Theory

Most consumer electronics regulate the AC mains to DC. Some have a big, black, hurky wall wart that is unsightly and nearly impossible to plug more than one into a power strip without taking up two or three slots each. Others have the conversion circuitry built inside. A large part of the weight of the device is actually the transformer itself, which is usually made of several steel plates sandwiched and then epoxied together, and two or more windings of coated copper wire. Each winding can be any where from a just a few to several thousand turns. The number of windings determines how much change in voltage you will get out. When a current is introduced through one winding (or coil), it creates a magnetic field, with poles forming along the winding axis. If another coil is placed nearby, along the same axis, the magnetic field will induce a current, and thus a voltage, in the second coil. Adding a magnetically permeable core between the two greatly enhances the effect, reducing loss. Since the two windings are both made using insulated wire, you can wrap one around the other, with both wrapped around the core. This is very efficient and space saving, especially since you can add several separate windings to get whatever voltages you want out. Computer power supplies do this. The only thing is that the output is always AC, since for the magnetic coupling to work, the magnetic field must change polarity. The only way to do that is by using AC current, which switches between positive and negative voltages at 50-60Hz. In order for electronic circuits to work, we must convert this stepped-down AC voltage to a flat, stable DC voltage.

That's where the bridge rectifier comes in, and in this case a full-wave rectifier. We can make it out of individual discrete diodes or use one that is purpose built. The idea is that we switch the negative AC pulses to positive pulses, and leave the already positive pulses there. There is some voltage loss due to the voltage requirements of the diodes, but it is minimal and if you plan for it, it won't affect the outcome at all. The end result is a pulsed DC voltage, going from 0 to maximum voltage at 120Hz. We use a capacitor across the '+' and '-' terminals to smooth out the ripples. As the voltage rises from 0 to max, the capacitor charges. When the voltage starts to drop, the capacitor discharges through the circuit but at a much slower rate, in effect holding the voltage up while the supply drops to 0 and then rises again. Once the voltage rises to where the capacitor voltage is, it recharges the capacitor and surges back to max again. Larger capacitors will allow the voltage to stay higher longer, so you get less rippling. As long as the ripple doesn't get below a certain value, e.g. +12VDC, we can use that to power a voltage regulator, which simply stabilizes the wobbly input voltage to a specific output voltage. Full-wave rectifiers are better here than half-wave, since there is less time between the high and low pulses, resulting in a more stable output.

Schematics are shown for full-wave rectification using a center-tapped transformer and for half-wave rectification if you are interested. For the rest of this Instructable, I will be using a variation of the full-wave schematic shown in image 1.

For more thorough and better explanations, see the rectifier, diode bridge, transformer, and voltage regulator articles on Wikipedia.

Step 2: Practical Design

You will only need a few parts for this circuit. I salvage parts where I can, so you may even be able to salvage the entire AC/DC conversion circuit from something that already has it built onto a board. The side of the transformer where the AC power cable connects is the primary winding side. The secondary winding side will be connected to the bridge rectifier. Use your multi-meter to carefully check the output voltage on the secondary pins when the power cable is plugged in. The reading should be 1/10 to 1/5 of your mains voltage, which is 12-24VAC in the U.S. If you are using 220VAC mains, you will need a transformer that has a 10:1 step down ratio because most voltage regulators can't handle more than about 35VDC input. Also be aware of the power requirements for your circuit. Transformers do have current limitations and voltage regulators can usually only source 1 amp max, and only when you have a proper heat sink attached. Fuses are a good thing if you're unsure.

The Parts:

- 1 transformer. This one will work if you need to buy one, but they are in almost everything you use so you should be able to find one and salvage it without any difficulty.

- 5 diodes. 1N4001, 1N4004, 1N4007 will all work fine. You can substitute 4 of them for a purpose built bridge rectifier, but you will need the fifth to reverse bias the regulator output.

- 4 capacitors. 2 220-470uF electrolytic, 2 100nF ceramic disc. Check to make sure that the voltage ratings on your capacitors are higher than the voltages they will be experiencing. If the output from the diode bridge is +30VDC, and your capacitor is rated for +25VDC, you're going to have issues. Capacitors will explode if to much voltage is applied, whether your face is nearby or not.

- 1 78XX voltage regulator. I'm using a 7805 in this build. You can get them in several output voltages, e.g. +5VDC (7805), +9VDC (7809), +12VDC (7812), etc. The 79XX series of voltage regulators are similar, but provide negative voltage, i.e. a 7909 outputs -9VDC. Be sure that the output of your transformer stays at least 2V above the output level of the regulator, since it will regulate down to the output voltage required. (78XX datasheet)

- wires as needed

- heat sink if the voltage regulator is providing high current or your input voltage is significantly higher than the output voltage. For more on that, read this.

The tools:

- solderless breadboard for prototyping and testing

- soldering iron and solder

- printed circuit board (PCB)

- wire cutters/strippers

Step 3: Building and Testing

This is a really simple and easy circuit to build. I've included two breadboard images that show the same thing, but one may be easier for some to understand than others.

Images 3 and 4 are o-scope images to show what is going on in the circuit. After the transformer steps down the AC voltage the diode bridge makes the signal DC, but with some serious fluctuations. Image 4 shows why we add the smoothing capacitor. This image was taken with a smaller capacitor so I could highlight the effect the capacitor has on the signal. The cap in the parts list gave an almost flat line so it was hard to see.

Image 5 shows the final regulated DC voltage at +4.8VDC. The datasheet for the 7805 shows that 4.75-5.25VDC is normal, so we are well within specs.

That's all there is to it. As long as you keep aware of what is where, you shouldn't have any problems. Remember to take it slow and double check your connections before plugging anything in. And above all, BE CAREFUL!

A special thank you to redditers t_Lancer and E_kony for their help in adding to my knowledge on this subject matter.

Please don't hesitate to ask questions, either in the comments below or PM. Have fun building!

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest

    34 Discussions

    0
    None
    DaleM90

    Question 3 months ago on Step 2

    I recently purchased an AC/DC converter to be able to power small LEDs from the power supply of my hot-tub which outputs 12VAC for lighting.

    The converter I bought was this:

    SMAKN® AC/DC TO DC Converter AC 16-28V/DC 16-40V Step Down to 12V/5A Power Supply Module

    I also wanted to be able to dim the LEDs, so I added this:

    10K Ohm potentiometer

    . When I hooked everything up, I discovered that there wasn't enough power coming through. I had hoped on being able to light up a dozen or more LEDs brightly, but there was barely enough power to light up a single one a tiny bit.

    The bulbs I am trying to power are these:

    5mm Bright LEDs Bulb Light Blue

    Since my plan did not work, could you suggest an alternative setup to make this work?

    Thanks,

    Dale

    0
    None
    Bsrlin

    Question 5 months ago

    Could I use something like this to make light unit that uses bulbs that were designed to be used in battery operated lights originally...want to make light that uses ac power (wall outlet), using bulbs from battery-operated items such as flashlights?

    0
    None
    epdowd

    Question 7 months ago on Step 3

    In the circuit below, if I make it, where do I acquire the ground ?. Thank you..

    0
    None
    bernardmunger

    1 year ago

    Hello,
    Thanks for the very detailed instructions. The comments from others is also very helpful, especially your very well explained answers.

    I have a project to generate electricity using a brook near my cottage. I have already found a few turbines that are coupled to generators and will make wild AC.

    Your circuit certainly is a good option for me to convert that wild AC into a smooth DC. The goal is to charge batteries, very very large batteries (220 Ampere-hour).

    From what I understand, rectifying the wild AC into DC is a simple diode bridge, then smoothing it out is a question of choosing the right set of capacitors.

    I have yet no idea how wild my AC will be, but my question is the inverse: how smooth must I be to be able to successfully change the 450V-550V wild AC with varying fequency into a rather smooth 14.4V (the recommended voltage to charge 12V battery banks to complete charge)?

    I am a professional mechanical engineer, so the turbine and pressure/flow regulation is an option I can handle better than the electrical circuit, although that would mean potentially loosing a lot of mechanical power.

    If a robust circuit (with over sized capacitors?) can handle all the power I throw at it, maybe with a little electronic power loss along the way, it might be a less costly and better (more stable) option.

    What do you think?

    Bernard

    0
    None
    pandam4

    1 year ago

    greetings instructables! please help guys/ gals. i have a transformer 220vac to 12vac 12A i've placed 4 diodes 6a05 bridged, then 2 capacitors 25V / 10000UF then a LM7812 Linear voltage regulator. i'm expecting to have 11v to 11.5v but it shows only 8.5 from the relay. what did i missed?

    from 4 diodes 8.5v to 8.6v

    from 2 capacitors 8.3v to 8.4v

    from 1st regulator 7v

    from 2nd regulator 8.5v

    from 3rd regulator 7.5v

    3 replies
    0
    None
    brmarcumpandam4

    Reply 1 year ago

    You're stepping down your AC too far.
    You need to supply voltage regulators with at least 2 volts more input than you expect on the output. So with the 7812, if you want 12V out, you have to supply it with at least 14V bare minimum, preferably over 15V. That 15V is the output from the diode bridge, which will also drop the voltage about 0.7V per diode. The current travels through two of the four diodes at any point in time (all four are still used though) so the input to the diode bridge needs to be at least 17VAC.
    The datasheet four the 7812 will list the max input V at around 30V (double check that), so if you use a 10X step down transformer that outputs ~22VAC you should have no problems, though you may need a heat sink on the 7812.
    Your setup as is will only provide enough voltage to drive a 7805 5VDC voltage regulator or lower.

    0
    None
    pandam4brmarcum

    Reply 1 year ago

    thank you sir brmarcum. will post the pic what i've made sorry it's very unprofessional work. it's not on a circuit though. if it's not too much to ask can i ask for diagram what should i put in it with parts. diode, capacitor, regulator, etc. appreciate it!

    got 220vac to 12vac 12A transformer

    IMG_20170611_222419.jpgIMG_20170611_222432.jpg
    0
    None
    brmarcumpandam4

    Reply 1 year ago

    Good question. Thank you for providing sample data. It makes it easier to pinpoint the solution.
    Cheers

    0
    None
    josephbuilds

    1 year ago

    hi there, thanks for the instructable! I would like to make this as safe as possible and would like to add a fuse as you mentioned. I live in Germany now and here they don't have fused wall plugs as i used to in Engand. How would you recommend doing this? (more than happy to recieve a simple link and I'll work it out from there...)

    2 replies
    0
    None
    brmarcumjosephbuilds

    Reply 1 year ago

    I would add a fuse between AC mains and the transformer. The correct fuse rating needs to be determined by the max input current capacity of your transformer, or the max input capacity of your circuit, whichever is lower.

    0
    None
    brmarcumbrmarcum

    Reply 1 year ago

    I added a fuse to this project //www.instructables.com/id/Motion-Activated-AC-Switch/ but not on the ac/dc rectifier portion. I split the ac mains input to use as a switched ac source controlled by the dc portion.

    0
    None
    Confuseddad

    2 years ago

    I made this using a lm317. My output voltage is jumping quite a bit. Would a larger cap help smooth that out?

    1 reply
    0
    None
    brmarcumConfuseddad

    Reply 2 years ago

    I would have to see your circuit. The capacitors between the diode bridge and the regulator should take care of a lot of the AC ripple in, and the capacitors after the regulator should filter anything else that gets through.

    Is the "jumping" you are seeing happening at regular frequency? Does it appear at several places in the circuit or just on the output of the 317? Are you using long wires that could be acting as antennas and picking up signals from other devices nearby?

    What voltages are you working with at each stage? AC input, after the diode bridge, into the regulator, and after the regulator? If you are trying to get your 317 output to be close to what you put into it, but flat, you will likely have problems. You need some buffer voltage in that you can afford to lose to the regulator to let it do its job properly.

    0
    None
    ANDERM

    3 years ago on Introduction

    Do all Transformers require this method? Example if you have a motor that runs on 18v DC but want it to run on AC, you just happen to have a 117v (AC) to18v (DC) @ 2amp transformer would this work? or does it require this method you show? My other concern is the amperage because I do not know for sure the amp limit on the DC motor. Any help or advice will be greatly apreaciated.

    2 replies
    0
    None
    brmarcumANDERM

    Reply 3 years ago on Introduction

    This method is for stable, flat line DC output using sinusoidal AC input. If the device you are connecting to the output can handle an imperfect, unstable DC signal, then it is possible to use just the transformer and diode bridge (the signal still needs to be rectified positive. LED strips can use this method as long as you match your numbers right).

    As far as I understand DC motors, you need rectified AND stabilized DC power for it to work right. So you will need to set it up as shown here.

    Regarding amperage, as long as the entire circuit after the transformer (diode bridge, regulator, AND motor) requires less than 2 amps, it will work fine. The motor should list average amps needed as well as max amps needed (peak) in the datasheet. If it lists it in watts, divide that by the voltage rating to get amps. The motor should never require more than that, so just make sure your transformer's output rating exceeds that power requirement.

    Hope that helps.

    0
    None
    ANDERMbrmarcum

    Reply 3 years ago on Introduction

    Yes it did help me understand a bit better, thank you! I did manage to find out the amps under normal run and load run which is ranging from 2.7A to 16A under load. So now I just need to figure out how to build the transformer set up correctly. Also I found out more about the transformer I found which list a apparent power of 36VA, not a 100% sure of this meaning yet. Which will be the next step to learn is knowing which diodes or parts will be needed and as you stated making sure the numbers are correct. So now that I know my amp limits, the current transformer may or may not work unless the amp limit/power is controlled or regulated from my understanding if this is correct. This is what I am understanding if my assumptions are correct that is. I am enjoying learning about this, I only know basics but this is getting me into a very exciting world of circuitry. Which is a bit confusing and complicating but way cool. I did find another site called all about circuits which helping also, it is a bit hard to understand some of it sometimes but it helps. This is awesome stuff, From a beginner, Thank you very much for your help! BTW: I like how you present your instructions very informative.

    0
    None
    trplback

    3 years ago on Introduction

    Are ac and dc powered motors so different that it's impossible to change a motor that currently runs on ac to run on dc?

    2 replies
    0
    None
    brmarcumtrplback

    Reply 3 years ago on Introduction

    Impossible is an absolute and I don't like absolute. But in this case, it may be accurate. They work in similar but very different ways. AC motors are matched to the frequency of the input current, which is how you vary speed. DC motors use the level (quantity) of current to vary speed. I'm no expert, but it would probably be much (much, much) easier to just get the right motor than convert one. Though it would be a pretty cool way to learn motors.

    0
    None
    Akasi

    3 years ago on Introduction

    One more question. Is this circuit meant only to convert AC main to DC? Can I use any other source of AC and use this circuit to convert this to DC? Thanks!