the spirit is weak. woe be the spirit. the body is weaker still. Siërra R
.
ask me about horses
.


somewhere on website league
username will be botflymother
really if you wanna find me just look for botfly mother
gonna keep that name around for a good while

-pegasus
@-pegasus

We're almost at the point where we can start designing the circuit for our bench PSU. It's going to have to run off of wall power though, so we have to cover that first.

writing this was a chore. I just want to get to the fireworks factory. You are completely permitted to skip this if you already know about it

Here in the UK, the power we get out of the socket on the wall is described as 240V AC, 50Hz, with a maximum current limit of 13 Amps per device.

The AC stands for Alternating current, meaning that the electric flow is alternating - changing direction - constantly. The change happens every ten milliseconds.

That means that every 20 milliseconds it's changed directions twice. Reversed, and then reversed the reversal, facing forwards again. We call this a Cycle, and we measure the number of cycles in a second in Hertz, named after a rental car company. So 50Hz means 50 cycles a second, or 100 reversals a second.

When the electric flows towards our viewpoint, it's measured in regular numbers. When it's flowing away our viewpoint, we measure it in negative numbers.

So 240V, switching from positive to negative every 10 milliseconds. If we draw it on a graph you might totally expect it to look like this:

A square wave signal

It doesn't. Instead it looks like this:

A sine wave

So "switching every 10 milliseconds" turned out to be a lie. It's not switching, it's rising and falling gradually. Even stranger, it's almost reaching 340 volts instead of 240! That's weird! What's going on?

Well, it turns out that AC Electricity is generated by moving copper wiring and magnets past each other. The easiest way we've found to do that is by spinning them.

AC Generation

The peaks (and negative peaks) are when the poles of the magnet are closest to the copper coils. When the voltage reads zero is when the magnets are furthest away. If the magnet is kept spinning at a constant speed we get a nice consistent rising and falling action like we see in the graph.

(Before you ask, no, you can't just leave the magnet in one position and get a constant voltage. It's not the position that makes power, but the movement. It's like you're using a spoon to scoop up magnetic field as it goes past, except not really).

That still raises the question: Why is it called 240V when it's wavering between -340 and 340?

Well, you can only use a number if you can catch one. Since the voltage is always changing, then so would the display of anything that's trying to measure it:

I found this gif on google

Maths boffins solved this problem by creating a new kind of voltage measurement just for AC power: Root Mean Square voltage.

The basic idea is that we use RMS voltage to give it a rating that's equivalent to DC. So if wall power is 240V AC, we know that it's as useful as 240V of regular direct current electricity.

The way RMS Volts are calculated is fairly complex. But the power delivered to your house is pretty standard, so we can make a bunch of assumptions and take a bunch of shortcuts. You can find the peak voltage of an AC supply using multiplication:

AC voltage * 1.414 = Peak voltage

And in reverse, we can use the peak voltage to find the RMS voltage:

Peak voltage * 0.707 = AC voltage

So 240V AC, multiplied by 0.707, peaks at 339 Volts.

For the rest of this series, unless specified otherwise, all voltages will be given as DC or peak.


Using AC

So now we know what AC is and that it's volts are lies. What do we need to know to use it?

We've all seen a wall socket. In the UK they've all got three pins, and are polarized. Polarization means that the two AC wires have been given two separate roles to play. Let's meet them in the back of a plug:

Live (or Line, or Phase ) Should be considered the one that carries the power. Live is the wire controlled by the on off switch. It also has a fuse, which will pop and disconnect if something you plug in draws an unsafe amount of current.

Live's wiring is coloured Brown, because if you touch it while it's on, you will shit your pants. You might also die.

Neutral is an interesting one. It does carry power too, and a lot of the time it can be considered interchangeable with Live. If you accidentally wired them backwards, most things would keep working.

What makes Neutral interesting is it's relationship with the Planet Earth. The electric grid that supplies your neighborhood connects the Neutral side directly into the soil with a metal rod. This makes everything sitting on the planet earth technically connected to the neutral wire already.

diagram of substation grounding N to E

They do this as a safety feature. You're already Neutral. If you touch a Neutral wire's connector, that's just more Neutral. Neutral cannot flow from itself to itself, so nothing will happen to you.

(assuming that the wires in your house are wired up correctly and there are no hidden faults! Please don't try this without checking!)

Neutral's wiring is coloured an inoffensive Blue.

Earth (or CPC, Circuit Protective Conductor) Should be considered a safety feature. It connects to any metal parts of a gadget that you might be able to touch, and connects them directly to the Planet Earth.

This clipart is getting a lot of use today

This is a critical safety feature on appliances that are mostly made of metal. If one was damaged, it might happen in such a way that power from the Live wire contacts those parts. If you touched it in that situation, you'd get zapped.

By connecting all those parts to the Planet Earth, we provide a more attractive path for electricity. It will flow down the Earth wire into the planet, away from you, and eventually make it's way back to the power grid.

The live wire has come loose and is touching the metal case. The Earth wire is siphoning the power away

Meanwhile, a special gizmo in your house's fusebox called a Residual Current Device will go "hey what the fuck? why is Current leaving on Live but not coming back on Neutral?" and cut the power.

Earth's Wiring is coloured Yellow and Green

A common two pin power cable, this one with an American wall plug

You will also come across stuff that only has Live and Neutral, but no Earth. This is because that thing is Double Insulated. That means that it's been designed in such a way that Live can never, ever come into contact with a metal surface that a person can touch. When that's the situation, there would be no point to having an Earth wire, so they leave it off.

The symbol for Double Insulated is a box inside another box.

There are also non-earthed, non double insulated electronics, but they're from a time before safety was invented.

This radio is a perfect example. While the outer case is wooden, the inside is built around a steel frame. To save costs, that frame is being used as the Neutral, and the plug is not polarized. It can be plugged in the wrong way around, with no way to tell from the outside, making the frame Live.

In such a situation, all it would take is for an over excited child to pull the volume knob off, and the metal shaft it was attached to would be ready and waiting to zap him.


To sum up:

  • 240V AC is a lie, it reaches about 340V for a little bit, and we need to design around that.
  • The Brown wire is Live, and will have the power switch and the fuse. It can zap you.
  • Neutral is the wire which completes the circuit under ordinary conditions. It usually can't zap you.
  • Earth is used to protect you from getting zapped.
  • It's possible to design something without an earth wire, if careful precautions are taken.
  • Many things without earth wires used to be designed without that protection.

I hope that this was a comprehensive and concise AC power 101. I apologize that it doesn't cover 110/120 Volt countries like the Americas. Eurasian readers should substitute 240V for 220/230V, and the plugs for their weird bad round ones.

Now onto the good stuff.

NEXT UP: Bench Power Supply Part 3: Putting AC power to use! Magnetism and transformers


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, spend more than half of that on rent alone, and so supplies and tools are a significant expense. Your support would be greatly appreciated! Who knows, if this really takes off I might buy a freezer.


You must log in to comment.

in reply to @-pegasus's post:

I found this doubly interesting because there was both stuff I didn’t know, and stuff I did know that was “wrong”, by which I mean “different than in North America” (wire colouring, and the charming assumption that we have safety features like plugs with fuses and household electrical that reliably has GFCI).

Looking forward to more!

You're gonna get more :>

What are the wire colours in North America? A long time ago they used to be Red Live, Black Neutral here. I've only ever owned one thing that was like that, a radio from the 1950s.

I know that at some point you transitioned to polarized plugs, and then finally put earthed sockets in every room. Large swathes of the EU have done neither. Bizarrely, an unearthed plug cannot fit into an earthed power socket, but earthed plugs can fit into unearthed ones.

Black for hot, white for neutral, green (or bare copper) for ground. (That’s “hot” = “live” and “ground” = “earth”.) Which is pretty strong whiplash from black being ground in DC electronics.

Polarized and grounded outlets have been commonplace for a while; polarized came first and grounded has been standard for probably 40 years. Non-polarized and ungrounded plugs are compatible with polarized/grounded sockets so there are no downsides.

Of course we don’t have fuses in plugs here; some appliances have built-in fuses but what sort and how they’re installed varies (a while ago I replaced one that was soldered in place deep within an appliance, clearly meant as a “should never fail” safety measure). We generally don’t have whole-home GFCI (RCD) protection; modern building code requires GFCI anywhere near water (kitchens, bathrooms, outdoors) and that’s sometimes at the breaker box and sometimes in the outlet. But builds more than 20(???) years old or so may not have any at all. ⚡️

The nature of harmonization means that everything (of decent quality) sold in the UK or europe has a fuse inside too. One sized exactly to that device.

In the UK the plug fuse is meant as much for the power cord as it is for the appliance, traditionally sized to the wire gauge. The standard sizes are 3A, 5A, and 13A. If you buy a plug to wire on yourself it'll have a 13A in it.

It causes a lot of e-waste because when something conks out, people replace the plug fuse. When it still doesn't work, they toss it and buy an entire new thing. It never occurs to anyone there's an internal fuse that's probably like 1A.

I think I'm one of the youngest to be taught how to wire a plug. Even in the late 80s stuff came without one here. I don't know if this was to make it easier on foreign suppliers, bloody mindedness, or a nod to people who's houses still had those weird round pinned sockets from before WWII.

Fun side note to this, you can also find blue live wires in the UK too (But again you're unlikely to see it as someone just tinkering with stuff in the home) in older 3 phase installations using pre-harmonisation colours. (A fair amount of which is still around, in installations older than, like... 2004?)

3 Phase wires used to be red, yellow, blue, with a black neutral and a green (or bare copper) earth. Turns out, tho, this is a Problem for colourblind electricians; hence the European/harmonised colours being brown, grey, black for phase, with blue neutral.

...of course, you can see a potential comedy option with putting those two combos together, can't you~? (I love standards, there's so many to choose from.)

[This user contains wiring colours to two versions of BS7671]

One small note:
In installations without RCDs or in TN-C when PE and N are joined together into 1 wire (making it PEN), PE connection to external conductive parts is a safety feature because it provides a low-impedance path that causes a short, which trips the current breaker. The current flowing through you at that moment isn't really decreased, unless you count the voltage drop created by hundreds of Amps in the wiring. Essentially it uses a fire safety device (current breaker) for protection against electrocution.
However, it's pretty common to touch the L directly and that's when an RCD is needed.

Anyone working on such an installation does not need to read a beginners guide.

my intention is only to illustrate the idea of earthing from the perspective of someone who's plugging something into the wall. All the different schemes don't matter right now.

Pinned Tags