-pegasus

valid to eat nibbits

posts provided without warranty of any kind

av by @AviYinglet


New twitter (ugh lmao)
x.com/kyle_pegasus

-pegasus
@-pegasus

Hello and welcome back to Electronics From Scratch Project 1 - Building an adjustable workbench power supply!

In the previous chapter we covered Power transformers, what they are, what we need them for, and how we use them. At the end of the chapter we understood enough to take wall power and turn it into two 24V AC power sources, safely isolated from the mains and ready for action.

Our next step is to convert that AC power into DC power, so we're going to meet a couple of components for the first time and learn how to use them in a circuit. At the same time, we're going to have to take another step forward and learn to read and write proper circuit diagrams.


Today's episode stars:

AC Power

We'll start with our AC power source. So far I've symbolized it as a British wall socket, but that would be too much clutter for a proper circuit diagram. AC power is a little clumsy in that not everyone agrees how to draw it, but here are a few that I've come across:

The first two have a wave symbol in them, representing the wave of AC power on a voltage graph. The third instead is a crude approximation of a wall plug. All three are also marked "240VAC 50Hz", which tells us exactly the voltage and frequency. All three have two lines sticking out, representing the two connections of AC power - Live and Neutral.

Which one to use is really a stylistic choice. I personally prefer the first one, so all diagrams from now on will use it.

⚡ Electronics From Scratch needs your help 🧲 I only have £350 a month to live on after rent - Your contributions enable me to buy the electronics supplies and services I need to make this series possible. Thank you very much! Buy Me a Coffee at ko-fi.com

power switch

Next we're gonna need a power switch, so we can turn our circuit on and off without yanking the plug out.

Notice it looks like a drawbridge? That's because a switch is electro-mechanical - both electricity and moving parts are involved. When the switch is on, the drawbridge is lowered, pressing two metal contacts together and allowing power to flow. When the switch is off, the drawbridge is raised, separating the contacts and cutting power off.

Like everything, a switch has some resistance, so it's important to choose one rated for the current it'll handle. To keep you safe you also have to be sure that it can insulate you from the voltage. We're going to use one that's rated for at least 250VAC and 5 Amps, which is more than plenty.

Fuse

A fuse is a safety device meant to break the connection if something goes wrong and too much current flows. It consists of a small glass tube with a little wire running through it. If too much current flows, the wire burns and falls to bits, cutting the power. The glass case keeps those burning wire bits away from anything they might harm.

Here are the common symbols for a fuse, depending on where you are in the world:

All three of them are trying to convey the same thing, but do it different ways. The first takes an X-Ray approach, showing the wire go straight through the inside of the fuse's body. The second one instead shows a simplified version of the fuse's exterior, with a contact on each end separated by the glass body. The third is much more abstract, showing the fuse wire alone as some sort of funky wiggle.

Readers from the UK, Ireland or some other areas formerly occupied by the British Empire will know that their plugs contain a fuse, while plugs from other countries don't.

I should clarify that the British plug fuse is not to protect the device! For historical reasons not worth elaborating on, most household wiring in the UK could potentially supply as much as 32A to a single socket, while the socket, plug and power cords are only rated for a maximum of 13A. For lower current devices, there's also 5A and 3A sized power cords, with matching fuses.

Even a 3A fuse is much too large to safely protect a low power device, so the plug fuse must be considered a last line of defense which only protects the socket, plug and power cord. So while the fuse plug is mandatory in the UK, the correct size internal fuse is still required.

While fuses are rated by maximum amperes, it isn't quite as simple as picking one with a matching number and forgetting about it. Some devices that normally use only a small current will briefly pull giant amounts of it, usually when they're first switched on. (Our transformer is definitely guilty of this!). In those situations we have to use a slow-blow fuse. As the name suggests, it will let any brief spikes in current slide, while still popping if current is consistently above it's rating.

transformer

Oh look who it is!

Our transformer that we selected in part 3 is back! Here's the symbol:

Easy enough to understand. The primary coil winding that takes in the 240V AC is the curly wire on the left with two connections. The two vertical lines represent the iron core. The joined secondary coil windings are the curly wire on the right, with three connections - 24V, 0V, and 24V again.

Light bulb

It wouldn't be a very realistic circuit if it didn't do anything, would it? So here's something, an ordinary 60W Incandescent Light Bulb.

The symbol is pretty simple, pretty abstract. The glass body of the bulb is just a circle with two connectors, one on each side. In the middle there's a curved wire - this is the filament that heats up and glows.

I chose a light bulb because it's incredibly simple, but also does something that's so obvious there can be no doubt as to if it works or not. The other alternative would've been a buzzer, but that'd be fucking annoying.

Is that everyone? I think it is, so far!


Our first circuit diagram

In the previous part I showed a diagram of a transformer connected to the mains and being being used to power a light bulb.

Now if we convert it into a circuit diagram (and add the switch and the fuse!), it looks like this:

This might look like a mess at first. But if that's the case, we can take a moment to space the components apart:

Turns out it's no big deal. The symbols haven't been changed by being incorporated into a circuit diagram, they've just been linked together by lines that represent wires, until a complete loop (or, well, circuit) has been formed.

This is a milestone for us. Now we have an initial circuit, we can start evolving it into our bench power supply.

Let's look at the voltage going across the lightbulb on a graph:

So our 24V AC transformer is giving us a healthy 34V peak voltage (reminder: the difference between AC and peak volts was covered in part 2), but our goal for today is DC, not AC. To convert it we're going to need another component.


Semiconductors: Enter the diode

A diode is a one way valve. Power can only flow into the input (or Anode), and then out the output (or Cathode). Reverse the flow of power and the valve will close, the diode will stop conducting, and the flow will stop.

Conducting electricity only when certain conditions are met is the defining trait of a Semiconductor. We're going to meet more of those in later chapters, but for now we better stick with the one.

Notice the triangle? It's pointing from one side to the other, towards a stripe. That triangle is an arrow showing the direction current is permitted to flow. The real diode doesn't have an arrow, but the stripe is still there.

Unlike a resistor there's no specific measurement for "diodeness". Diodes have all sorts of properties and characteristics, but right now, we only care about a few of them:

Forward Voltage - how much voltage it can conduct.
Maximum Current - how much current it can conduct.
Reverse Voltage - how high a voltage going in the wrong direction it can block.

(There's also Voltage Drop, but we'll discuss that later)

These aren't written on the diodes themselves because they're so small there'd be no space. Instead, you have to rely on the part number. You can use that part number to look up a data sheet, a document published by the component's maker which will tell you everything you could possibly need to know. (If not in a particularly clear way).

For this circuit, I've picked a diode called 1N4007. It's very cheap, can work up to 1000 volts, and 1 amp of current.

Let's take our diode and put it into the circuit now:

So now the power can only flow in one direction, we should be good, right? Surely we've rectified the problem. Let's look at the voltage graph again:

Uh oh. We've technically created DC, because all the power that's flowing is going in one direction. But it's still not very useful, because now we've only got power half the time. The reverse voltage is totally blocked, and nothing replaces it. We need to be smarter than this.

Well, that doesn't just mean that power coming towards you is now traveling away, it means that the power that was traveling away from you on the other wire is now traveling towards you. There is always power traveling towards your device, the only thing that's changed is where it is! So what we need to do is direct that positive power, whichever wire it's on, to where we need it to go.

We've got two AC wires, so let's do something with two diodes. One for each.

This isn't a complete circuit, but I felt it was best to zoom in on a small part so we can See what's going on.
There's an AC wire coming in from the left, and an AC wire coming in from the right. Each one connects to a diode input at a right angle, so the power goes in below and comes out at the top. Up at the top, the two diodes join a third wire, which will be our positive DC voltage.

Here's how the current flows at one half of the AC cycle:

And here's how the current flows in the other half:

So in theory, this should give us full time DC, rather than that useless half time DC we made earlier. But it won't work on it's own, because it's not a complete circuit. There's no ground. How do we solve that?

That's simple! More diodes:

This is called a bridge rectifier, and it works by applying the same principle to both positive and ground. The extra diodes attach behind the first two, facing the same direction. This time, their inputs are both connected to the ground wire.

Just like the two-diode example, the bridge rectifier only allows power to flow in a sensible way to get it from AC to DC. Here are the two paths it can take, depending on where we are in the AC cycle:


Now we understand the bridge rectifier, let's put it in our power supply circuit:

And check out what it looks like on our voltage graph:

No gaps, now we're getting somewhere. Power is never blocked, instead we accept it wherever it tries to come in and route it to where we need it to be.

There's one problem though. It might be going in the same direction all the time, making it technically DC, but that oh-so-very-AC habit of constantly shifting voltage is still there.

We'll have to do something about that!

Join me next week for Part 5 - Get Smooth! Introducing the capacitor!


Electrons cost money!

If you'd like to see this series continue, and you can afford it, please put a buck in the tip jar!

I earn only £800 a month, and spend more than half of that on rent. Any contribution you can make will enable me to buy electronics supplies and services I need to continue the project - it'll be a real struggle otherwise.

I'd like to thank everyone that has contributed so far, no matter how much or how little. It's already made a real difference.


You must log in to comment.

in reply to @-pegasus's post:

Do you think I could grab a transformer and other parts and follow along as you go through this? I'd be pretty excited to have a power supply like the one you described by the end.

(Relevant context for me is I'm not a beginner at electronics, but not a super expert either, and currently don't have a lab full of equipment at home, and want to build some.)

yes you could, and my intention is that the finished design is released as a full bill of materials as well as files to get pcbs made up (which is surprisingly cheap)

the problem with doing the moves alongside the main character is that i’m getting this out too slowly. and also, some of the next chapters will introduce stuff that gets changed later. so there would be a lot of wasted parts and money

(also i am super not an expert, i just know some stuff and want to share)