# Thread: [Tutorial]: 120V AC to 12V DC Circuit

1. ## [Tutorial]: 120V AC to 12V DC Circuit

Tutorial: 120V AC to 12V DC Circuit

Introduction
Theory
The Build

Introduction:
Let me begin with a disclaimer: by no means am I an expert at any of this, but I’d like to share what I learned for the people that want to learn some circuitry beyond resistors and LEDs. I decided one day that I wanted to build this, so I did some research and started working. I built it so I could have an easily accessible 12V DC supply for messing around with circuits, but it can be used for just about anything. It’s a small and relatively simple project that can be completed in a few hours. Now onto the tutorial!

Theory
In my opinion, it is very important to know why something works and not just that it does work. For this reason, I will cover the basic theory of the circuit. I’ll do the theory from an electronics point of view (which is easier and less in-depth), but I’ll also go into the physics a little for those with an insatiable thirst for knowledge. If any of this is confusing or wrong, please let me know and I will do my best to make it as clear as possible and fix errors.

Before we start, we need to make sure we understand the difference between conventional current and “real” current. Basically, when people were first learning about electricity, they thought positive particles caused current (so current moves from the positive terminal of a battery through the circuit to the negative terminal). We now know that it is in fact electrons that move, so the current actually flows from negative to positive. However, as a convention, we analyze circuits thinking of current flowing plus to minus (conventional current). Don’t worry; everything works out no matter which way we do it. Whenever I refer to current, I mean conventional current unless I specify otherwise.

Now we’ll continue with the schematic for the circuit and analyze it piece by piece:

We begin with a 120V AC from a wall outlet. Obviously this is way more than we need, so we need a way to bring the voltage down. This is accomplished with a transformer.

Symbol for a transformer

If you’re not interested in the physics, all you need to know is that a transformer steps the voltage down. It is also important to know that the power stays the same on both sides of the transformer. (P=VI where P is power in Watts, V is voltage in Volts, and I is current in Amps)

For example, if you have a 10:1 transformer, and are transforming 120V at 1A: P=VI = 120V*1A = 120W. On the other side, you end up with 12V, and the power is the same, so I = P/V = 120W/12V = 10A.

Our transformer takes a 120V input and provides a 12V output (in theory). These are not “ideal” transformers, so they are not exact. Also, the output may change under a load. My transformer was putting out about 15V without a load. We will deal with this later.

<Physics>
For those interested in the physics, an ideal transformer works like this: There are two sets of coils wrapped around a metal core (see link below for a diagram). The input current through one coil induces a varying magnetic flux through the core (it varies because of the sinusoid), which in turn induces a second current (and voltage) through the second coil. This is called mutual induction. In an ideal transformer, the ratio between the voltages is the same as the ratio between the numbers of turns in the coils.
</Physics>

For more about transformers, take a look at the Wikipedia article:
http://en.wikipedia.org/wiki/Transformer

Now that we have 12V (ideally), we need a way to get rid of that pesky sinusoidal AC and get our lovely useful DC. To do this we need to discuss diodes.

Symbol for a diode

For our purposes, we can consider a diode to be a component that only allows current flow in one certain direction (like a one-way valve). Obviously it is very important to orient the diode correctly. Diodes allow current to flow from the anode to the cathode, and the side of the diode with the line on it is the cathode (both in the symbol and the actual component). If you use a diode backwards, current will try to flow from the cathode to the anode and will be blocked.

http://en.wikipedia.org/wiki/Diode

<Lots of Physics>
In reality, a diode is not as simple as an electric one-way valve. To understand diodes, we will first touch on semiconductors, which are the foundation of transistors and thus modern computing (really exciting stuff!).

Most modern diodes use p-type and n-type semiconductors which are made using a process called doping. Doping is adding tiny amounts of other elements to make a material more conductive. For example, silicon is a poor conductor, but when doped, it becomes a usable semiconductor.

When silicon is p-type doped, an element is added to it that takes away its weakly bonded outer electrons. This leaves you with “holes” - open spaces that can accept electrons. These holes are like positive charge carriers (hence p-type).

With n-type doping, an element is added that gives its electrons up to the silicon. The n-type silicon now has more negative charge carriers (hence n-type). The increase in charge carriers in both types is what increases the silicon’s conductivity.

Now that we know about p-type and n-type semiconductors, we can connect this to diodes. The diodes you will use are p-n junction diodes. A p-n junction is a layer of p-type semiconductor next to a layer of n-type semiconductor. These layers are separated by an insulating layer called the depletion zone which is created by the combination of electrons from the n-type and holes from the p-type.

A p-n junction

When you apply a voltage across the diode in the “proper” orientation (that is current flows from anode to cathode), you get what is called forward bias. The “positive charges” by the p-type side repel the holes, and the negative charges by the n-type side repel the electrons. (I use quotes because of the whole conventional current thing – see above) Basically you are pushing the holes and electrons closer to each other, so the depletion zone becomes smaller and smaller. Eventually, with a high enough voltage, the depletion zone becomes thin enough that the current can flow through it with very little resistance. This “turn-on voltage” is usually on the order of milliamps, so we don’t have to worry about our diodes not turning on.

So now we know that current can flow anode to cathode, but what stops it from flowing the other way?

When the voltage is applied backwards (reverse bias), the electrons and holes are pulled away from each other, so the depletion zone is too large for current to cross.

This is why a diode allows current flow in one direction and not the other. (Note that if you do apply enough voltage in the reverse bias direction, you can break down the junction and current will flow, but that won’t happen in our situation).
</Lots of Physics>

http://en.wikipedia.org/wiki/P-n_junction
http://en.wikipedia.org/wiki/P-type_semiconductor
http://en.wikipedia.org/wiki/N-type_semiconductor

So now that we have a component that will allow current to only flow in one direction, we can get rid of that pesky sinusoid.

Our circuit has 4 diodes arranged in what is called a bridge rectifier. (Bridge is the arrangement, rectifier is something that converts AC to DC). A bridge rectifier basically multiplies the sinusoid by itself, making it all positive.

A sinusoid

Sinusoid squared

That gets rid of the pesky changing polarity. I really wouldn’t consider this physics; it’s more like math:

<Math!>
We’ll start with the positive input of the AC voltage. It is surrounded by two diodes, so it is forced to go “up” (I’ll use directions in terms of whats on the schematic). This top corner will end up being our positive DC terminal. What happens when the voltage drops below 0 and goes negative? The diode won’t turn on, so current won’t flow through it. The result is something like this:

AC going through just the one diode. This is called half-wave rectification (because half of the “waves” get through)

Half-wave rectification is what I like to call “WEAK SAUCE!” We can do better! Fortunately, the bridge rectifier takes care of this. Take a look at the negative AC terminal. Its also surrounded by two diodes. While the positive terminal has positive voltage, the negative terminal will have the same voltage but negative, so the diode won’t turn on. When the positive terminal has negative voltage (the flat lines in our half-wave rectifier) the negative terminal is positive. This allows current to flow through the diode. So what we have is two alternating half-wave voltages. Add those up, and you get a pretty full-wave rectification.

The 2 half-waves combine to form a full-wave. Yay!
</Math>

http://en.wikipedia.org/wiki/Bridge_rectifier
(Yes I like Wikipedia. I wouldn’t consider it a credible source, but its electronics articles are usually accurate)

So now we have voltage that is all positive, but it has this pulsating magnitude. We’re gonna get rid of that with a capacitor!

Symbol for a capacitor

Basically a capacitor stores charge. It is used here as a filter capacitor to filter the pulse. When the voltage increases, some of that increase is cancelled by the storing of charge in the capacitor. When the voltage decreases, it’s slightly cancelled by the release of charge from the capacitor. This is a really simple explanation, but its how I learned it. If anyone has more insight, please let me know!

<Physics>
Now we’ll get into the physics of the capacitor. We’ll talk about what I think is the easiest capacitor to understand: the parallel plate capacitor. A parallel plate capacitor is simply two parallel plates separated by some dielectric (something that doesn’t conduct – air works). What happens is negative charges build up on one side of a capacitor, and that causes positive charges to build up on the other. This causes an electric field between the plates of the capacitor that creates a voltage drop associated with the capacitor.
</Physics>

http://en.wikipedia.org/wiki/Capacitor

Even with this filter, our voltage is not exactly 12V. There is still a little bit of a “ripple” and our transformer is not exact. The simple solution is to use a 12V regulator. A voltage regulator will keep a steady voltage output despite changes in input voltage and current.

I won’t go too much into detail with the regulator for two reasons. The first is that I don’t know enough to be comfortable teaching. The second is that there are different types and I’m not sure exactly what I used.

For those that are willing to trust my limited (but accurate!) knowledge, voltage regulators are made using a zener diode (like a regular diode, but in reverse bias it will break down faster and hold its output voltage at the break down value), a transistor, and some voltage comparator. The comparator compares the output voltage to some known value. When the output is too low, the comparator opens the transistor which increases the output voltage.

That just about covers the theory of the circuit. The voltage regulator will ensure a steady operating voltage of 12V which is what we set out to accomplish. Now we can get started with the actual build!

The Build
Here is a list of what you will need:
12.6V 300mA Transformer (enough current for me; if you need more you can buy a different transformer, just make sure it’s rated at about 12V) – Link
4x Diode These will work just fine
If you are really lazy, you can just buy a bridge rectifier here (but that’s no fun!)

You will need some wire. I used solid CAT5.

You’ll also need something to plug into the outlet. The plug is called a NEMA 1-15 See here

I got mine from a busted adapter. You could buy one and cut to expose the wires, or you can cut it off from your mother’s ugly old lamp. (Get permission first!)

Option 1:
Soldering Iron (There are lots of threads about soldering irons on OCF)
Soldering Skills – The components we’re using aren’t the most sensitive, so this project can be a good primer. However, I recommend practicing a bit first. Here’s a great guide.
PC Board Link (Any board will work really, this is what I used)

This option is a more permanent solution (and more fun in my opinion)

Option 2:

This is for the lazy people.

Completely optional:
5V regulator and a switch – this will allow you to have a 5 or 12V supply. I added this to my project later. It’s not on the schematic, but I’ll leave it to you to figure it out.

I would also recommend getting a digital multimeter to poke around and test voltages. It’s a great way to learn.

Now to build the circuit! (Sorry about the lack of pictures. Mine was already built by the time I wrote this)

Step 1: Lay out all of the components on your board according to the circuit diagram. Don’t forget to leave space for the AC plug input and two wires for your DC output. Make sure the connections on your board match the connections shown on the diagram. On the PC board, all of the holes that are connected by the gray paint are electrically connected (you can see the copper connections on the bottom). On the bread board, there are two long rows of 4 sets of 5 holes. The holes in each row are connected. (The two rows are not connected). Then you have two chunks of 5x<a lot> holes. Each row of 5 is connected, but no row is connected to another row.

Important Reminders!
-Make sure your transformer is oriented correctly. There should be labels for the 120V input and 12V output

-Make sure your diodes are oriented correctly. The side of the component with the line on it is the cathode (corresponding to the side with the line on the diagram)

-The point where a wire has a “hump” over another one means that those two wires are not touching

-Make sure the capacitor is oriented correctly. Electrolytic capacitors must be connected properly. I have marked the positive side of the capacitor on the schematic. On the component, the side with a stripe on it is the negative side.

-The package of your 12V regulator will tell you which pins are which. Make sure you have the right pins connected in the right spots.

Step 2: Double and triple-check your circuit. Make sure the connections are all in the right spot. I didn’t do that and it took some clever wiring/soldering to get it to work. If you’re using the breadboard, press everything into its hole (man you are lazy!). If you’re using the PC board, solder all of the components in place.

Step 3: Now we’ll attach the wires. Solder the AC input to the transformer. It doesn’t matter which plug goes into which side of the transformer. Now solder two wires to the output of the circuit. Make sure to note which is positive and which is negative. This will be the output of our circuit.

Step 4: Plug it in and make sure it works. Please don’t kill yourself. Safety first! I’m not responsible if you do something stupid and get a nice 120V jolt. Test the output with a voltmeter. If it’s not working, go back and test each stage of the circuit (transformer, rectifier, capacitor, regulator). Make sure to switch to AC if you’re measuring anything before the rectifier!

Congratulations! You have now built a 120V AC to 12V DC adapter! I hope you enjoy building it as much as I did. If you have any questions, let me know and I will do my best to help you out!

2. If you application draws a lot of current, I'd use a switching/buck -regulator setup. Also, not that the LVR (Linear VR) requires a few Ripple supression caps on its terminals. The exact placement of these are to be found in the VR datasheet.

3. You need a 10pf cap on either side of the regulator to stabilize it, and you should put another 470uF cap on the output for current surges.

That is a simple F/W (full wave) bridge power supply. Also the LVR wastes power as it dissapates the extra as heat. You can also use a darlington zenner configuration to regulate the voltage.

A zenner is a special diode. What happens is when its reverse voltage reaches its critical state it conducts. This one, is a 12v zenner so any voltage above 12v will cause it to conduct. Basicaly how this circuit works is when the base of the transistor is 12v or higher the zenner shorts to ground. Because of the pullup resistor the transistors base now becomes 0v. The transistor turns off. The voltage dropps and the zenner declamps and the voltage on the transistors base rises up again causing it to switch on. This is basicaly a very primitive form of self excited switching regulator and can be quite efficient.

The one I displayed produces a -12v, however ones producing +12v are aslo available. This was the first nice circuir I could find on the net so I posted it.
To make a +12v circuit just replace the two PNP transistors with NPN transistors of similar ratings and reversing the zenner.

EDIT: apparently its a GIF making it hard to see on the dark background of OCforums due to the transparancy.
here is the link the the site.
http://www.play-hookey.com/analog/ex...2_volt_ps.html

EDIT: there is a link to the +12v regulator on the site too at the top that I didnt see.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•