# How to Build a Computer 23: Magnets

Hard Disk Drives record data using a technology long known to baffle juggalos. The read/write head uses magnets to store information on those disks. How? Why? What does that even mean? Let’s jump in.

What makes a magnet a magnet? Moving electricity. When you get down to the atomic level atoms are magnetic because their electrons are spinning. Glomp a bunch of those atoms together (like sticking magnets one to another) and you have a grain. Get enough grains lined up in the same direction and you have a permanent magnet.

It’s not just spinning electrons; any movement of charge creates a magnetic field. Let’s say you have a wire (lucky you!) and you’re running electricity through it. Don’t ask me what for; you’re the one with the wire. But that current in the wire will produce a magnetic field in circles around the wire. Or you can take a coil of wire, send electricity through it. That gives you a strong magnetic field inside the coil, all pointing in the same direction. The word for that, incidentally, is a ‘solenoid.’

Merry Christmas; I got you a wire from a busted pair of earbuds.

In that picture, the candy-canes represent magnetic field lines and the wire represents, well, a wire. To represent an actual solenoid the candy canes ought to continue on all the way around and join back up on the other side. Magnets don’t get a start and a finish, they only work in loops. The model does work very well in one respect though, look at those candy canes. The space inside the wire is mostly candy cane. The space outside the wire is mostly not. You have the same number of lines inside the cylinder as outside, but the outside they have so much more volume to spread across. What that means is you have a strong magnetic field in the middle of the loops of wire and a weaker one looping around outside.

The whole electricity-and-magnetism thing works in reverse too; if you wave a wire through a magnetic field you’ll get a current in the wire.

Actually, if you’ll excuse a brief side trip, a great deal of modern technology is based on getting currents by waving wires at magnets or pushing magnets around with electricity. A generator makes electricity by using an engine (burning gasoline, or what have you) to turn a wheel of magnets past wires. Most power plants do the same thing, only varying what they’re using to turn the crank. An electric motor (like, say, in your car windows) does its thing by using currents to pull magnets in a circle. I’d go into more details but all that’s ancillary to my main discussion. The point is you can use a magnet to produce current in a wire, and you can use a current in a wire to magnetize something.

Okay, let’s move this back in the direction of hard drives. What happens if you apply a magnetic field to a bit of iron? Well, the iron moves, right? I mean that’s what makes a magnet a magnet. Let’s say though, that you wrap a bit of iron in a coil of wire and you run electricity through it. Here, let me show you what I’m talking about:

My scientific research indicates you’re probably better off going the traditional spaghetti-and-meatballs route for dinner.

Okay, ignore the sausage for a moment. What happens if you run a current through the noodles? You’d get a magnetic field through the center (remember the solenoid up there?) Only now we’ve got a hunk of kielbasa (iron) taking up that space. The magnetic field lines will follow the metal; instead of coiling around the solenoid the field lines will run through the iron until that’s no longer an option. The magnetized metal acts like a horseshoe magnet, and you get your magnetic field lines in between the prongs.

Now here’s the kicker. What happens if you move that kielbasa magnet next to a surface that you could magnetize? Recall how we were talking about the grains up above? If you push enough current through that wire you get a large enough magnetic field that you can use it to align the grains in your surface. Presto change-o you’ve got a magnetic field embedded in that surface. Move your sausage away, turn off the power and you’ll still have magnetism there. You want to flip a bit? Run the current through the wire the opposite way. The polarity flips on your magnet (yeah, polarity actually means something outside of Star Trek technobabble) and your magnetic chunk in that surface points in the other direction.

And that’s how you can store information on a metal platter. Great! I’ve got all kinds of things I want to write down. But how do I read them once they’re on there? That’s a story for another day. Join us fortnight next when we explore the practical implications of reading information off of disk drives in “Kelvin can’t wait” or “Spinning sausages at 7200 rpm”

This is part 23 of my ongoing series on building a computer, the Christmas Miracle way. You may find previous parts under the tag How to Build a Computer. This week’s post has (again!) been brought to you by Ricochet’s own Group Writing! December’s theme is Veneration and there are plenty of spots waiting for you to fill one. Do your Group Writing today!

1. Member
RightAngles
@RightAngles

Okay, ignore the sausage for a moment.
Sure.

But never mind that, we have the same candy canes! So now I can make one of those doodads right here at home! I can’t wait to get started.

2. Member
The Reticulator
@TheReticulator

So does the magnetic field explain why the kielbasa sticks to your ribs?

3. Contributor
Gary McVey
@GaryMcVey

Okay, another brilliant Hank Rhody post. That makes me really hungry.

Someday, I’ll finally understand how making and breaking a DC current fast enough can dramatically raise its voltage (which I thought only transformers, which run on AC, can do) because “the collapsing field of magnetic flux” creates some motion that…oh, I don’t know…means the voltage is raised. Like spark plugs.

4. Coolidge
Flicker
@Flicker

How do you wrap the spaghetti around the meatball?

5. Member
:thinking:
@TheRoyalFamily

Someday, I’ll finally understand how making and breaking a DC current fast enough can dramatically raise its voltage (which I thought only transformers, which run on AC, can do) because “the collapsing field of magnetic flux” creates some motion that…oh, I don’t know…means the voltage is raised. Like spark plugs.

Any current makes a magnetic field, whether that current be AC or DC. That’s why you can create a magnet with a battery, which is DC. Also, any changing magnetic field produces a current (or rather, a change in electric field, which creates a current whenever there are free charges about – like in metal wire) – they’re paired (thus, elctro-magnetism) – which is why generators generate.

So, when you pull out the plug from the wall, that creates a big change of electric field in an instant (from 120V to 0V). That creates a correspondingly big change in the magnetic field around the wire. And that change in magnetic field creates a big change in the electric field, to the tune of thousands of volts – thus, the spark. This is why you should turn off a thing before you unplug it.

6. Coolidge
dnewlander
@dnewlander

Man, I got a D on the first test in E&M because I did all the “right-hand rule” problems using my left hand, holding my pen in the right.

When I got an A on the next test, despite almost everyone else in the class doing, um, poorly, my TA told me to see him after recitation. Halfway through our review of the test, our professor, Hugh D Young (yeah, the guy whose name is on the book) came into our room and sat in the back. Apparently, I made a good impression being able to actually answer the questions the TA brought up, because at the end of class, when everyone was getting up to leave and the TA again told me to see him, Hugh D just looked at him, shook his head, and walked out.

think that’s how Hugh D learned my name, because after that he’d always say hi to me in the hall. Which is pretty impressive considering everyone at CMU had to take his Physics classes.

Incidentally, my dad had the same textbook in college, back when Sears and Zemansky were the only names on the cover. I checked it out visiting his office once and recognized many of the questions.

7. Contributor
Hank Rhody, Red Hunter
@HankRhody

RightAngles (View Comment):
But never mind that, we have the same candy canes! So now I can make one of those doodads right here at home! I can’t wait to get started.

Okay, if you want to do it my way, here’s how:

Buy candy canes for a holiday display. Have multiple people think you spelled “Humble”

Wear earbuds while listening to phone music with your phone in your pocket. Take earbuds off to talk with coworker. Forget you’re wearing earbuds.

Absent-mindedly roll your chair backwards. This will ensure your earbuds are no longer usable for their primary purpse, freeing you up to use them in your experiment. With me so far?

Use a scissors to cut the wire. If you rolled back properly you’ll have a damaged section you can cut out near one end of the cord.  Don’t use a good scissors. Crack open the earbuds themselves and harvest the magnets. Magnets are fun.

Realize you’ve still got a length of perfectly good earbud cable hanging around. Take your candy canes off of the “H” in your holiday display (They’re just hanging there, and it’s easy to get it to look right when putting candy canes back after you’re done.)

Wrap your candy canes carefully in the wire. No, not like that, further up the candy canes. Try to slide the wire up the candy canes. Rewrap the wire as the sliding didn’t work. Watch the wire get all loose when you let it go. Rewrap it again. Fish out some tape to keep it wrapped (you can keep the tape out of the photo, no one will ever need to know). Rewrap your candy canes because you let it loose. Realize that you wrapped it so that the current goes left to right, when you’d prefer it to go right to left. Decide it’s good enough.

Presto change-o, you’ve got your own solenoid!

8. Contributor
Hank Rhody, Red Hunter
@HankRhody

How do you wrap the spaghetti around the meatball?

Use the fork, Luke! Pile spaghetti on the meatball, then stab the meatball with your fork. Twirl the fork; the meatball prevents the spaghetti from sliding off. Doesn’t wrap spaghetti all around the meatball but it does work for efficient consumption.

9. Contributor
Hank Rhody, Red Hunter
@HankRhody

dnewlander (View Comment):
Man, I got a D on the first test in E&M because I did all the “right-hand rule” problems using my left hand, holding my pen in the right.

You’re far from the only one. I also like the guys who keep twisting their hand to get it into a position that matches the problem and twist themselves right out of their seat.

When I went through the Physics degree I found the 400 level E&M harder than the 400 level Quantum Mechanics.

10. Coolidge
dnewlander
@dnewlander

dnewlander (View Comment):
Man, I got a D on the first test in E&M because I did all the “right-hand rule” problems using my left hand, holding my pen in the right.

You’re far from the only one. I also like the guys who keep twisting their hand to get it into a position that matches the problem and twist themselves right out of their seat.

When I went through the Physics degree I found the 400 level E&M harder than the 400 level Quantum Mechanics.

That’s because Quantum Mechanics is magic that doesn’t pretend it’s not magic, whereas E&M is magic equations purporting to be science.

11. Member
Matt Balzer, Straw Bootlegger
@MattBalzer

Hank Rhody, Red Hunter: The polarity flips on your magnet (yeah, polarity actually means something outside of Star Trek technobabble

12. Contributor
Gary McVey
@GaryMcVey

I love hanging out with intelligent people who are deeply knowledgeable but also practical. I don’t get why I have to go to an obscure political website to find them, thousands of miles away.

13. Member
Matt Balzer, Straw Bootlegger
@MattBalzer

I love hanging out with intelligent people who are deeply knowledgeable but also practical. I don’t get why I have to go to an obscure political website to find them, thousands of miles away.

You mean besides the obvious?