Embedded

View Original

412: Inductors Don't Have Feelings

Transcript from 412: Inductors Don't Have Feelings with Tom Anderson, Elecia White, and Christopher White.

EW (00:00:07):

Welcome to Embedded. I'm Elecia White, alongside Christopher White. We talk about resistors and capacitors, inductors, and transistors, and diodes, as though they're just things that happen on a board, as though they don't affect our software. But it's kind of important to understand them.

EW (00:00:28):

And so we've asked Tom Anderson back to give us a basics of what these are. Hi, Tom.

CW (00:00:36):

Hi, Tom.

TA (00:00:37):

Hello. Good to be back.

EW (00:00:41):

For folks who haven't heard an episode with you before, could you give us an introduction?

TA (00:00:48):

Sure. I'm Tom Anderson, and I work during the day at Keysight Technologies, although I don't speak for Keysight. I always have to say that. And I also work some at Alembic, where they make bass guitars, which we talked about last time.

EW (00:01:08):

Do you want to do lightning round, or should we just skip straight to the resistors?

TA (00:01:12):

Well, I think that lightning round kind of is the most fun part of the show. So let's go.

EW (00:01:20):

Okay. Favorite fictional animal or cryptid?

TA (00:01:24):

Bigfoot.

CW (00:01:26):

Least favorite software application?

TA (00:01:30):

Excel.

CW (00:01:32):

[Ooh]. Some people will write their entire platforms in Excel.

TA (00:01:38):

Yeah, well it used to be good, but they nerfed it.

EW (00:01:42):

Complete one project or start a dozen?

TA (00:01:45):

Start 200.

CW (00:01:49):

Best gauge of bass string?

TA (00:01:54):

I don't know.

CW (00:01:55):

Roundwound or flatwound? Did I already ask that one last time?

TA (00:01:59):

No, I don't think so. I like half round.

CW (00:02:01):

[Ah], yes. Ground wound, I think they're called sometimes?

TA (00:02:04):

You can call it that too.

EW (00:02:06):

If you could teach a college course, what would you want to teach?

TA (00:02:10):

I would probably have some projects in it, or maybe I would be the old curmudgeon that comes in and explains things in a totally different way and confuses everyone.

CW (00:02:21):

Do you think electronics can be taught at high school or lower level?

TA (00:02:27):

Well, that's when I learned it, and I was taught, so I think so.

EW (00:02:31):

Okay. Well, those last two kind of lead into what we're going to talk about today, and you are going to explain why there are resistors, capacitors, and inductors.

EW (00:02:45):

I mean, I remember from systems class resistors, and inductors, and dashpots, and springs, and tube pipes are smaller and all kinds of things that they said were all the same, but I don't think they are.

CW (00:03:07):

Wait, wait. Pipes? I think you took a plumbing class.

EW (00:03:09):

Well, that was the thing. They did resistors, and something was a capacitor sponge? That seems weird.

CW (00:03:15):

I thought a capacitor was like a water tank -

EW (00:03:18):

That makes more sense.

CW (00:03:19):

- that went uphill, and you pump water into it. And then, yeah.

EW (00:03:22):

What was the sponge then? That's not an inductor.

CW (00:03:25):

Resistor maybe?

EW (00:03:28):

Tom -

CW (00:03:28):

Tom, was it a sponge?

TA (00:03:30):

Those analogies are not that great.

CW (00:03:31):

No, they aren't. That's why I got a "D" in systems engineering.

TA (00:03:35):

They all have limitations. All analogies eventually break down, and some are better than others and break down later. In the water one, there is a pretty good one, but it doesn't give you any intuition. Because the plumbing doesn't work like any plumbing we've ever seen in our day-to-day life. A capacitor is like a water balloon.

CW (00:03:59):

Yeah, okay.

TA (00:04:00):

And pipes cannot be opened. So you can't make a siphon, for example, because they're all closed loop pipes. And so yeah, plumbing, it's not intuitive. So I'm actually going to start in a completely different direction. And if I don't get hung up on Boltzmann's constant, we'll get through it.

EW (00:04:25):

Remember we can't see any equations you're putting on that board there. So be gentle.

TA (00:04:27):

Yeah.

CW (00:04:28):

I mean, getting hung up on Boltzmann's constant was my entire 2005.

TA (00:04:34):

Okay. So I'm a huge fan of Boltzmann's constant, and, matter of fact, I think I can tell what somebody does for a living by the units that they use for Boltzmann's constant. So what it is is a proportionality constant to temperature.

TA (00:04:58):

Because temperature is really kind of based on what, boiling point of water, freezing point, something like that. It's not really ... a fundamental thing of nature other than it happens to be what water does, the way we normally measure it. And so you get into absolute temperature, kelvin starts at absolute zero and goes up.

TA (00:05:21):

And that's a little bit better, but it still has a slope that's the same as the degree centigrade, right? It's just one degree kelvin changes to one degree C change. So they need to put in a proportionality constant to make temperature do something useful.

TA (00:05:38):

And so that kind of asks the question, "Well, what really is temperature exactly from a physics point of view?" And people usually learn the ideal gas law, PV=nRT, and Boltzmann's constant is in there somewhere.

EW (00:05:53):

But not directly. Boltzmann's constant isn't the "n". PV= -

TA (00:05:59):

I think it's the R.

EW (00:06:00):

- nRT. Oh, is it the R?

TA (00:06:02):

Yeah, yeah. That's Boltzmann's constant, or it's a version of it. It has it in it, certainly. And so basically it's higher temperatures, more motion of the atoms, or something like that, more energy moving around. So work per degree C, maybe joules per kelvin, is kind of a common one.

TA (00:06:29):

You hear a lot in semiconductors when you turn on a transistor. ... kT/q is this term that comes up a lot. That's 26 millivolts or so for turning on transistors.

TA (00:06:47):

And so what is all that stuff? I mean, how do we use that to understand anything? And where I'm going with this is that we're going to tell how transistors and diodes work before we do resistors, capacitors, and inductors.

EW (00:07:07):

What?

TA (00:07:08):

Yeah, yeah.

EW (00:07:09):

I mean, I always thought it went the other way.

TA (00:07:11):

Well, I'm going to do it backwards.

EW (00:07:14):

Okay. And Boltzmann's constant, energy divided by temperature? That's not what you said, but -

TA (00:07:23):

That's one way to look at it. And, in fact, in physics, if you're a physicist, you might say that Boltzmann's constant can be totally normalized out, and you just set it to one.

CW (00:07:36):

Well, everyone does that from speed of light and Boltzmann's constant.

TA (00:07:40):

Yeah, exactly.

EW (00:07:40):

But not at the same time.

CW (00:07:42):

Well, you can -

TA (00:07:43):

Yeah.

CW (00:07:43):

- if you're doing relativistic statistical mechanics, I suppose.

TA (00:07:48):

Yeah. It's very strange. And temperature and information turn out to be the same thing when you do that. So it gets into information theory as well. And so it pops up in all these places. It must be this really deep concept.

TA (00:08:05):

And so I won't pretend to explain it. Anyway, but there is some jargon, and it has to do with the motion of electrons or carriers or whatever, something moving charge around. Because all we're going to talk today is about moving electrons around. And so there's this jargon called diffusion and drift.

TA (00:08:30):

It's very confusing. If you take semiconductor physics in college, it's very confusing. I think I know the reason why it's so confusing. I think it was invented very quickly. The people who were deriving all the equations for it were in a really big hurry. And so they just slapped it all together. And then they kind of left us with a mess.

TA (00:08:56):

So diffusion current is caused by the things like electrons repel each other. And so whenever you have a charge moving around and things repel or attract, that's diffusion current, is the cause. And then there's drift, which is caused by electric fields.

TA (00:09:22):

And so normally when I think of drift, I think like drift aimlessly, like you're just wandering around. But drift doesn't mean that. It means more like blown by the wind, like a drift of snow or something, or carried by water, like your water analogy, where you're in a current. And so the field is moving you around.

TA (00:09:44):

So in explaining these things, they have all these terms. I'm not going to actually use them probably so much, because I'm going to actually explain something that's a little simpler, which is a vacuum tube. Because that's how I understand transistors is, I start with vacuum tubes.

TA (00:10:06):

And so what vacuum tubes are is actually really pretty simple. You can imagine just having a little can of a vacuum with a little chunk of metal in it. And you light a fire underneath the can, and the metal heats up, and the electrons spew off of the metal into the vacuum.

CW (00:10:29):

Now, why do they do that?

TA (00:10:31):

They come off because when they get really hot, they get enough energy to leave the metal.

TA (00:10:39):

Because they're bouncing around so quickly that the thermal motion overcomes the charge, the balance of charge, that is holding the metal together when it gets up to a high enough energy, which varies depending on the material, and metals being pretty good at it.

TA (00:11:03):

So the electrons are held on pretty loosely in a metal. It's a conductor. They're flying around, and the electron zings right off with the thermal energy.

TA (00:11:14):

And then it leaves behind a positive charge, because the electrons are negative. And so you get this little cloud of electrons above the chunk of metal. But you don't get too many electrons, because you left behind a positive charge, and you're in a negatively-charged cloud.

TA (00:11:33):

And so the cloud is attracted back to the metal, which is positively charged. So the electrons boil off and then come and slam back down into the metal.

EW (00:11:44):

Like when I boil water in a closed pot, the water turns into steam. But since it's closed, none of the water escapes, and at the end, I haven't lost very much.

TA (00:11:56):

Right. It comes back, particularly if it's in a vacuum there, like in a pressure cooker. Yeah, sure. The steam goes back into the stuff, back into the liquid.

EW (00:12:11):

And so the steam here is electrons.

TA (00:12:14):

Yes. Yes. So we've boiled off these electrons. So if at the top of my can where I'm doing this experiment, if the top of the can is a bit cooler, because that's not where the fire is, some of the electrons will stick to the top. Now, I said it's a can. That makes it sound like it's metal. So I need to switch it to glass now.

TA (00:12:41):

So I've got a glass tube with a metal plate at the top and a pile of hot metal at the bottom. And so I take my plate, and some of the electrons fly out into the vacuum. And they hit the plate, and they stick to it.

EW (00:12:58):

Is this plate on the glass, in the glass, through the glass?

TA (00:13:01):

It's inside the glass.

EW (00:13:02):

Okay.

TA (00:13:04):

And now it's got electrons stuck to it. And it's not as hot, and so the electrons don't come off as easy. And so ... it gets electrons on it. So it has a negative charge which gives it a positive voltage, because of -

CW (00:13:23):

Right.

TA (00:13:24):

- the electrons. Because everything is backwards. I'm sorry.

EW (00:13:26):

Is this actually Ben Franklin's fault?

TA (00:13:28):

Yes. Well, I've heard it is, but I wasn't there.

EW (00:13:33):

Wasn't suggesting it.

CW (00:13:37):

Now I want to interject just for a second, because you started with "the vessel is a vacuum" or as close as we can get. And that's important, because if there were gas in there, the electrons would run into the gas in strange ways and do thermodynamic things you don't want, right?

TA (00:13:53):

Yeah, they would do other things. Yeah. We would be inventing something else. We would be inventing, I don't know, neon signs or something, -

CW (00:14:00):

Okay.

TA (00:14:02):

- or most likely the gas would react with the metal and spoil it. Because it gets really hot in there. And so if there was oxygen in there, it would tend to oxidize, make a mess. It would rust. We'd have a rusty can. And it needs to be very clean, because the ability for the electrons to fly off the metal counts on having very clean metal.

CW (00:14:29):

Okay.

TA (00:14:30):

It's very sensitive to contamination. Yeah. I made it sound like you just sort of start with a campfire and a can of beans, but really these are all very pure substances. Okay. So now we have this plate on the top, and it's got these electrons on it.

TA (00:14:46):

And they're really pretty good at repelling those electrons, because remember now it's negatively charged. And so the electrons are negatively charged. Like charges repel. And so it's going to kind of force some of those electrons in the vacuum down closer to my boiling piece. That boiling piece of metal is called the cathode.

TA (00:15:11):

So that cathode, yeah, it sits there, and then the electrons are closer to it. Now, if I take a wire, and I run it from the plate outside the tube and then back to the cathode underneath, and it makes a little loop around, then what can happen is the electrons that hit that plate can get a free ride down the loop.

TA (00:15:42):

And so they can go down the sliding board and say, "Whee!" And they get a free ride back down to the cathode ... It's been left with a positive charge, and there's a negative charge on the plate. And so they like to do that. And so now I have a little current source. And so that's a thermal electric generator.

EW (00:16:05):

Because you still have the campfire going.

TA (00:16:08):

Yes, I'm putting energy in, and I'm turning it into electricity. I'm putting in heat, and I'm getting out electricity. And so there we go.

EW (00:16:18):

Okay, let me make sure I've got this.

TA (00:16:20):

Okay.

EW (00:16:20):

We have a vacuum in a light bulb sort of looking thing, and at the small end of the light bulb, we have some wires coming out and a campfire. And at the top, inside the glass, inside the light bulb, I have a metal plate that's very clean and a wire coming out of the top through the glass.

EW (00:16:47):

And now the bottom of the light bulb, the small end, it gets heated. And so the metal sends off electrons, because it's too hot. It needs to take off its electrons.

EW (00:16:59):

And then those electrons have to hang out, because they don't really have any place to go, and because now they're next to this thing that is ... positively charged. And they want to go back home. But some of them escape that, and they go to the plates. And then the plate is negatively charged.

EW (00:17:17):

And so it eventually doesn't want to get any more, or ... the electrons don't want to stay together. So it can go out its wire. And then if you hook the top wire all the way down to the little end wire, then they go around and around, because the bottom end is positively charged and the top end is negatively charged.

TA (00:17:40):

Right.

EW (00:17:40):

Okay.

TA (00:17:42):

And so now if I cut the wire, I could do some things with it. I could put a resistor in it. And since I'd have a little bit of current, I could get a little bit of voltage. That would work. Another thing I could do is, if I put a positive voltage, and I mean more positive than the cathode on the plate, it would attract the electrons even better.

TA (00:18:11):

So the current would flow in that direction. If I put a negative voltage on it, it would repel the electrons even better. And so I would get no current or even less current.

EW (00:18:26):

Because they can't stay on the plate that they came from, because they don't like each other. And they can't go to the new place with more electrons, because they don't like those electrons either. So they just kind of sit there.

TA (00:18:38):

Yeah. The electrons would be pressed back more towards the cathode, the boiling spot, if I put a negative voltage on it, on the plate. So it would be even more electrons on the plate that would repel the electrons that were coming off of the cathode.

TA (00:19:00):

And so very little current would flow, whereas if I put a positive voltage on there, it'll attract the electrons on there, and they'll flow right through. So what I've just made is a diode, because it conducts in one direction, but not the other.

CW (00:19:18):

Oh. Okay.

EW (00:19:20):

That is what diodes do.

TA (00:19:21):

It is.

EW (00:19:21):

They make sure that you can only go one way, which is very handy for those of us who tend to plug things in backwards.

TA (00:19:27):

Exactly. Okay. And so now that I have a diode, I can really start to have fun, because I can put in a third terminal. And so all of really charge control and electronics is based on the idea that we have some current flowing somewhere, and we want to control it with a third wire.

TA (00:19:55):

And when you do that, all this math happens, and you can do all this physics analysis. And it all has this Boltzmann's constant thing in it, which is this kT/q. And it's the same kT/q no matter what kind of electronic device it is. And as a result, you can kind of say some general things that are generally true.

TA (00:20:18):

And I'm not talking about tubes because I like tubes, although I do. I'm talking about them because they're the simplest device to explain. And since we don't have any video, well, I don't like to explain transistors anyway. But they're even worse without a whiteboard.

EW (00:20:42):

kT/q.

TA (00:20:43):

Yeah.

EW (00:20:44):

k there is Boltzmann's constant. q is the coulomb -

TA (00:20:48):

The charge of the electron.

EW (00:20:49):

Okay.

TA (00:20:49):

Yeah. And so that's this 26 millivolts thing. So it comes out to a voltage. And so that voltage is kind of a scale factor that gets into figuring out the equation for how much current you get through a diode based on the voltage that's on it.

EW (00:21:09):

Is T time?

CW (00:21:11):

Temperature.

EW (00:21:12):

Temperature. Oh, that makes more sense. Yes. Okay.

TA (00:21:16):

So kT/q. k is the Boltzmann's constant. T is absolute temperature in Kelvin, usually, and q is charge in coulombs.

EW (00:21:26):

Right. Because whenever you have Boltzmann's constant, it's about temperature, not about time. Usually.

TA (00:21:31):

Right.

CW (00:21:32):

Yes.

TA (00:21:32):

Yes, yes. Yeah. You never really see Boltzmann's constant unless it's next to a temperature. And you hardly ever see a temperature in physics unless it's next to Boltzmann's constant.

CW (00:21:43):

The thing about Boltzmann's constant is it came from Boltzmann, who was a tortured genius, who invented all of statistical mechanics. And statistical mechanics is the formulation that kind of explains thermodynamics. Thermodynamics was initially developed experimentally.

CW (00:22:01):

And so all those weird equations about enthalpy, and entropy, and whatever, were just there in all those definitions. And Boltzmann, ... he redeveloped thermodynamics through a more normal physics approach that people are used to with kinetic energy of gases and things.

CW (00:22:22):

And so all of that got developed into statistical mechanics, and Boltzmann's constant comes out of that. And it relates the things in statistical mechanics, which talk about kinetic energy and things bouncing around, to the temperature and other concepts from thermodynamics, if that makes any sense.

TA (00:22:39):

Sure. Well, it does. And it'll make even more sense if you read the Wikipedia entry on Boltzmann's constant, because it's actually pretty good. There's a lot there, and it's not very long.

EW (00:22:53):

Okay. So we have a diode, we know how to make a diode, but we're getting input from a third thing.

TA (00:23:02):

Yeah. And the thing to add is called the grid. And so it's a third wire that comes in and you put a mesh, a wire mesh, between the cathode and the plate at the top.

TA (00:23:19):

So what that does is, when you put a voltage on it, you can put a slightly negative voltage on it to repel some of the electrons, but not all of them. So you put in a small negative voltage and set it up so that it repels about half of the electrons.

EW (00:23:49):

So this is going into a mesh around the cathode, which is throwing off electrons because of the campfire. And it's surrounded by a cloud. Is the mesh inside the cloud?

TA (00:24:06):

Yes. The mesh is inside the cloud between the cathode and the plate.

EW (00:24:14):

Okay. And so if it's negative, then all the electrons that are wandering around surrounding the cathode will now be pushed more into the plate?

TA (00:24:29):

No, we're going to make it so that it's repelling the electrons. And it will repel about half of them and send them back.

EW (00:24:41):

Back to the cathode?

TA (00:24:43):

Back to the cathode.

EW (00:24:43):

Okay.

TA (00:24:44):

Yeah. And the other half are going to go through to the plate. And what that lets me do is to control that current with a voltage, because -

CW (00:24:55):

Oh, I see. Okay. I see where we're heading. Yeah. Okay.

TA (00:24:57):

If I changed that voltage a little bit, it changed the field inside the tube, and it adjusts the flow of electrons through it.

EW (00:25:09):

I thought diodes were on or off.

CW (00:25:11):

We're beyond diodes now.

EW (00:25:14):

Oh.

CW (00:25:15):

I think we're moving to -

TA (00:25:16):

Yeah. We've just gotten into a triode.

EW (00:25:19):

Okay.

TA (00:25:20):

So the grid has a slightly negative voltage to repel with respect to the cathode. I think that's the way it, yeah, that's the way it works out. I think I got that sign right. It's so confusing with the currents and charges, everything being reversed.

TA (00:25:39):

... And that basically was the beginning of modern electronics, right, is the ability to electrically control a current. And then solid state came along later, and it actually works kind of the same way. There's a few more effects. Instead of having vacuum, it's silicon.

TA (00:26:08):

And instead of just having electrons, there's holes and electrons, where a hole is a spot in the silicon where an electron is missing., So the transistor is a little more complicated because one of the things that can happen is an electron can wander into a hole, and it becomes neutral then.

TA (00:26:32):

So it causes another current called recombination current. That's where a hole gets filled up by an electron. And so some of the current ends up going that way. And so when you do the physics of these things, you've got to make all the equations balance, conservation of charge, and conservation of energy, and all that.

TA (00:26:55):

And so, before in the physics of a vacuum tube, you've got to balance this drift in diffusion currents. Well, add to that recombination current.

TA (00:27:07):

And then there's still some thermal effects a little bit in transistors, not as much, because they don't work the same way as by thermionic emission usually. And so in an NPN transistor, let's start at the top, the collector, that N is kind of like the plate of a vacuum tube.

TA (00:27:33):

The P is a lot like a grid, except in this case, instead of repelling half the electrons, when you turn on the P, when you put a voltage on the P with respect to the emitter, it attracts the electrons. And what happens is the electrons come up from the emitter through diffusion actually.

EW (00:28:00):

Is the emitter the cathode?

TA (00:28:03):

The emitter is like the cathode down on the bottom. It's another piece of N silicon. So it's NPN, and the P is going to be the base. And so it attracts electrons, but it's very clever, because it's thin. And it's so thin that when it attracts the electrons, the electrons fly right through it, and then get sucked up into the collector.

CW (00:28:29):

So it's more of a traffic cop ... It's directing a flow, but it's not -

TA (00:28:36):

Well, it gets some of the flow.

CW (00:28:38):

Okay.

TA (00:28:39):

Because some of the traffic hits it.

CW (00:28:40):

Okay.

TA (00:28:41):

So it would be an injured traffic cop, because -

CW (00:28:44):

Got you.

TA (00:28:44):

- it's got some current. 1% of the current or something flows into it, and 99% flies right through it.

CW (00:28:54):

But that's different from the grid in a vacuum tube.

TA (00:28:56):

Yeah. Yeah. That is. Now a JFET is more like the grid in a vacuum tube. It's actually very similar, and the equations are the same also. It's kind of spookily similar. So a JFET being a different type of transistor. And the emitter is sitting there emitting electrons just like a cathode.

TA (00:29:20):

And so every time now and then you'll hear an old timer who's learned tubes first use the wrong word, and they talk about the plate of a transistor or the cathode. And they're talking about the collector for the plate, or the emitter is the cathode.

EW (00:29:39):

The emitter is the cathode. Collector is the plate. The P is the mesh.

TA (00:29:48):

Yeah. The grid. Yeah.

EW (00:29:49):

The grid.

TA (00:29:50):

Except it works the backwards way in that it attracts -

CW (00:29:54):

Okay.

TA (00:29:54):

- things, and they zip right through. And so you get jargon about whether it works based on attraction or repulsion in things like enhancement mode and depletion mode, which you may have heard of in transistor datasheets, for FETs anyway.

EW (00:30:13):

I don't read them that closely. If I'm reading them that closely, something has gone horribly wrong with my hardware.

TA (00:30:17):

There you go. And then there's PNP, which work like NPN, but they swap the holes in the electrons, the dopants. And so really ... I just gave you all of device physics right there. I mean, I think you get a PhD now, everybody who's listening.

EW (00:30:41):

It's all just diodes with whether or not the mesh is positive or negative, and NPN, and PNP?

TA (00:30:52):

Yeah. Yeah. That's all there is to it. Yeah. Yeah. It's trivial.

CW (00:30:56):

Okay. So what do I do with this? Okay. I've got one of these things, and I know how I could use a diode. But once I've got the triode, theoretically, I'm supposed to be able to understand how to make an amplifier or a switch out of this?

EW (00:31:10):

Well, because you can have one thing controlling five of these, and then you get more current than you got before.

CW (00:31:18):

Okay.

TA (00:31:19):

Right. And so the idea is actually, "I need to make an inverter." To make a computer, what you do is first you make an inverter. And then you kind of stack the inverters, and you can make a OR gate, or a NAND gate, or something out of them, where you put two devices in the bottom instead of one.

TA (00:31:45):

An inverter ... , whatever input it takes, it gives you the opposite, right? So if you put in a one, you get a zero, or say you put in three volts, you get out zero, or put in zero volts, you get three volts out. So if you had that, they have transistors inside them that pull the signal up or down.

TA (00:32:10):

And so if you get two inputs where either signal can pull the output down, then say, "Well, now I've got an OR gate or a NOR gate," and then you can make all of logic based out of that, or you can do the same thing with NAND gates. And so that's the basis for all chips, and computing, and stuff, is just that one gate.

EW (00:32:34):

All you need to do any of this is an inverter, which we don't how to make, but that's probably easy, and a diode.

TA (00:32:43):

Yeah. You can actually do it just out of diodes and resistors, but the computers aren't very good. The original one started that way, resistor, diode, logic. Yeah. It was kind of rough.

EW (00:32:57):

How do you make the inverter? What's it made out of?

TA (00:33:00):

Oh -

EW (00:33:00):

Or in our vacuum tube version.

TA (00:33:03):

In our vacuum tube, ... well, let's make it out of a regular transistor. Because the tubes were just to explain how transistors work really. ... Well, first of all, I'm going to ground the emitter, and then I'm going to put an input signal into the base, an input current into the base. And I'm going to take the output current out of the collector.

TA (00:33:38):

And so when I put more voltage on the base, it's going to turn the collector current up. But I'm going to cheat, and I'm going to put a resistor in the collector of that transistor. I'll do it with a resistor, because it's easier to explain. And when I pull that, it's like a pull-up resistor.

TA (00:34:02):

So when the transistor is off, my output is high. It's up near the supply voltage. And when the transistor is on it, it pulls the current through that resistor, and there's voltage drop across it. Because the voltage drop across the resistor is the current times the resistance. And so that voltage goes down.

TA (00:34:32):

So if we think of a transistor as being on or off like a switch, then that's because it's either going to be pulled up with the resistor or when the switch is on, it's going to be down at the low voltage at the ground where the emitter is. And that's in that state where the base voltage is high. So I've made an inverter.

EW (00:34:57):

I don't think I got all of that.

TA (00:35:00):

Okay. So let me try it again. I'm going to design a circuit with one transistor and one resistor.

EW (00:35:08):

Okay.

TA (00:35:08):

I'm going to have my power supply, power at one end of the resistor. And then the other end of the resistor goes to the collector of the NPN transistor. If it was a tube, it'd be the plate.

EW (00:35:22):

Thank you.

TA (00:35:24):

And then I'm going to have my input signal on the base or the grid, and I'm going to ground the emitter.

EW (00:35:35):

And so now instead of going from emitter to plate, we are going grid to plate.

TA (00:35:46):

So the input voltage is between the grid and ground or the base and ground really. And since NPN transistors kind of work the other way from tubes as far as which way the signals go for positive and negative, ... let's just switch to NPN transistors.

TA (00:36:09):

So when the base voltage is high, I have some base current. It turns on the transistor and -

EW (00:36:19):

Current can flow.

TA (00:36:21):

- current flows through the collector, and it pulls the voltage down that's on the collector.

CW (00:36:31):

Because it flows to the ground.

TA (00:36:32):

It's like a regular open collector output in a digital circuit with a pull-up resistor on it.

EW (00:36:40):

I mean, part of my problem is that I think about diodes as one way things and switches. And if you think about a light switch, there's no way I can put the power in through the light switch and set my wall power. So there's just a mental model here that I'm not quite getting, but it's becoming clearer.

TA (00:37:04):

Yeah. It's not quite a switch, because it only conducts current one way. And so that's the same as your open collector output, right? ... Oh, here's an example. Let's say, "Here's a circuit that you shouldn't build. Instead of a pull-up resistor on your open collector output, your nice digital output, let's put a motor."

TA (00:37:45):

And that'll work for a little while, because what'll happen is, when you turn the transistor on, the collector will go down to ground, and your power supply will be, say at five volts or whatever. And you'll have five volts across your motor, and it'll spin up.

TA (00:38:04):

It'll be fine. When you turn off the motor, the energy from the motor gets dumped back into the transistor, and it doesn't like that. But you can actually add an extra diode, and it'll fix that. You can solve that problem.

TA (00:38:21):

So that's an example of where it's not just a switch is because when you're actually driving a motor, you really need to be able to both source and sync current whereas these open collector outputs only sync current. That is the only thing they know how to do, is take the voltage, it's usually a pull-up resistor.

TA (00:38:45):

It could be something else like a motor or an LED, and they pull that one end down to ground. And so that's why, for example, in an LED circuit, a lot of times you'll put the plus supply, and then the LED, and then a dropping resistor. And then it goes into your open collector output, right?

TA (00:39:06):

Is this working for you? Is this too hard to do on the radio?

EW (00:39:09):

No, no. This is mostly working. I didn't mean the diode was like a switch. I meant that the grid was like a switch. You turned it on, and things flow. You turn it off, and things don't flow. What you're saying makes sense.

TA (00:39:24):

[Ah], yes.

EW (00:39:25):

It's just that I have trouble making the emitter go to ground, because that should be emitting. But that's not what this is doing. It's about current flowing.

CW (00:39:36):

Well, the transistor works differently physically than the tubes.

EW (00:39:43):

Well, yes. But I can't get past that.

TA (00:39:43):

And also the electrons are going in the wrong direction.

CW (00:39:46):

Right. Yeah.

EW (00:39:48):

That part I'm okay with. I don't care which way the electrons go, because they're imaginary.

TA (00:39:53):

Okay. Okay.

EW (00:39:53):

Oh, actually -

CW (00:39:53):

I assure you, electrons are quite real. There might be only one of them, but they're quite real.

EW (00:39:59):

Is having NPN and PNP transistors like byte ordering. Why? It confuses everything? Why do you need both?

TA (00:40:16):

Well, you remember how I said that NPN transistors, the current only flows one way in them?

EW (00:40:23):

Yeah.

TA (00:40:24):

In PNPs it flows the other way.

EW (00:40:27):

Yeah. So why don't you just turn it around?

CW (00:40:29):

[Laugh]. Turn it around.

TA (00:40:30):

Well, that's the PNP. It's a turned around NPN.

CW (00:40:37):

Because you can't turn it around, because ... you have to turn inside out.

EW (00:40:43):

Okay.

TA (00:40:46):

So instead of using a pull-up resistor, I could put a PNP up there. And then I'd have a push-pull circuit, which you see a lot in audio, and you also see in logic, except they use FETs normally. And there's two switches in a FET output in a regular CMOS output. The C in CMOS stands for complimentary.

TA (00:41:15):

And that means it has both end channel and P-channel, as opposed to say NMOS, which only has N type, or PMOS, which only has P type. So CMOS has both N and P. And so the little transistor to make the output go low turns on, and that's the N.

TA (00:41:40):

And then at that same output, if you turn on the P, then it makes the logic go high. And if you turn them both on at the same time, it lets the smoke out.

EW (00:41:57):

Okay. So push-pull, I have two diodes, and they are opposite each other. I mean, what does that do? What does that make? Is it just a power thing? Is it just making higher voltages?

TA (00:42:18):

Oh, the push-pull?

EW (00:42:19):

Yeah.

TA (00:42:20):

Oh, well, the push-pull amplifier is actually normally kind of audio terminology where they say they have a P-channel device that's pulling the speaker in one direction and an N-channel device that's, say, pushing it in the other direction.

CW (00:42:39):

Because if you only have one direction, you could only push a speaker out.

TA (00:42:42):

Yes.

EW (00:42:43):

Oh, oh right. Because speakers need to go both ways in order -

CW (00:42:47):

For highest efficiency, I assume. Yeah.

EW (00:42:48):

- to make waves.

TA (00:42:50):

Yeah.

CW (00:42:50):

I mean, you could do it one way, but it would be giving up half of the speaker's travel.

EW (00:42:54):

Oh, okay. So push-pull is a music thing and a power thing. Does it relate to transistors on their own?

TA (00:43:07):

Well, it's that complimentary circuit, just like in a logic gate, in a CMOS gate.

CW (00:43:15):

And you can configure push-pull on the outputs of your favorite microcontroller usually.

TA (00:43:21):

Right, right. You can configure them either to be open-collector or ... open-drain.

CW (00:43:30):

Open-drain or push-pull.

TA (00:43:32):

Yeah. Yeah. So in FETs the plate gets called the drain and the emitter or the cathode is the source.

CW (00:43:40):

Why are there so many words, Tom?

TA (00:43:45):

I blame marketing. But I'm not sure. I think actually it's because people were in a hurry, and they just used whatever they thought of first.

CW (00:43:54):

"Drain sounds good."

EW (00:43:56):

I mean, they were inventing stuff. So it seemed like, "Okay, it's not exactly what that was. So let's come up with a new name." And it turns out it was close enough. Why did you confuse us?

TA (00:44:07):

Exactly. Alright, so now I'm going to get to capacitance, and I'm going to come at it from this strange direction of device physics.

EW (00:44:17):

I was really hoping it was going to come from etymology, from incapacitate.

TA (00:44:22):

That's a good one. I'll have to look that one up. So what is a capacitor, really? W`ell, it's a way to store charge, right?

TA (00:44:31):

And so we say, Q, the charge, is equal to capacitance times voltage, which just means if I have a constant capacitance, which is what I like to have, that is to say one that doesn't vary with voltage, then if I double the voltage, I can store twice the charge, or if I double the capacitance, I can store twice the charge.

TA (00:44:55):

And so it really says how much charge is stored in a device for a given voltage. And so you remember what we're doing here is charge control, right? We're moving all these charges around in the device. We have electrons flying around, and there's all these carriers and currents.

TA (00:45:19):

And so we can't have these transistors without some capacitance. There would be nothing to control if we didn't have some charge in there.

TA (00:45:33):

And so my concern is when people call them parasitic capacitance, ... well, that's actually how it works. It's not like it's some extra thing that they couldn't get rid of. It's the basis for what the thing is. Now, if you wanted to anthropomorphize, I could say, it hurts their feelings when you call them parasitics.

TA (00:45:59):

And really, I guess it's not really the feelings. It's the care that people put into their construction, right, has capacitance in it. And so to reflect the care of their construction the word parasitic is, I don't know, maybe not the best choice. So it's how they work. Now inductors, maybe inductors don't have feelings.

EW (00:46:30):

Wait a minute. Wait minute. Let's go back to capacitors as capacitors, not as part of a transistor.

TA (00:46:37):

Okay.

EW (00:46:39):

Chris mentioned water towers, where a water tower gets filled up, and then ... if there's no more input, it can come from the water tower. So it's storage.

EW (00:46:55):

And I think it was Electronics for Earthlings, likened it to a forced carpool parking lot where if it was full, you got to drive by and go over the bridge on your own. But if there were any parking spots in the lot, you had to go there and then carpool over the bridge.

TA (00:47:17):

Wow. Two analogies I really don't like. Okay. Yeah, analogies.

EW (00:47:25):

It's the way I think. I don't know why, but I usually need some analogy to make it work.

CW (00:47:32):

They can help for the first step, but, yeah.

EW (00:47:34):

Yeah. It's just the first step.

TA (00:47:35):

What you need is a large capacitor, and a pair of safety glasses -

EW (00:47:41):

I've done this.

TA (00:47:41):

- and a power supply. And you can see directly how to store a charge, because you carefully charge the capacitor. You put the plus terminal of the capacitor on the plus end of the supply, and you turn up the voltage, and you can see all the current.

TA (00:47:59):

If you have a nice lab meter that has a meter on how much current goes in, you can watch the current flow into the capacitor and charge it up. And then you disconnect the capacitor, and you put a screwdriver across it and pow, you get a big old spark as it discharges through the screwdriver.

EW (00:48:19):

So it's like a tiny battery.

TA (00:48:21):

Yes. They're very battery-like, and matter of fact, the larger the capacitor is, the more it sort of becomes like a battery. You can get some really large, very nice capacitors these days. There's lots of one farad capacitors on Digi-Key, and even larger values like 10 farads is something you can definitely have.

CW (00:48:44):

The nice thing about most batteries though is they kind of self-limit the amount of current they can put out if you short them.

TA (00:48:52):

Well, don't drop a wrench across a car battery charger.

CW (00:48:55):

Well, true. True. True. Yes. But I'm talking consumer AAs and what have you.

TA (00:48:59):

Oh, right. Yeah. They're very nice. Although if you put a 9-volt battery in your pocket -

CW (00:49:05):

Yes.

TA (00:49:05):

- along with your car keys -

CW (00:49:06):

It gets a little warm.

TA (00:49:07):

It gets very warm very quickly. Because a 9-volt will put out about five amps.

EW (00:49:13):

It just tingles on your tongue though.

TA (00:49:15):

Right. Right.

CW (00:49:15):

Yeah, okay.

EW (00:49:17):

It's spicy. 9-volt batteries are spicy.

TA (00:49:24):

Yes, they are.

EW (00:49:25):

Where were we?

CW (00:49:26):

Capacitors.

EW (00:49:27):

Capacitors are like batteries. Okay.

TA (00:49:29):

Right. And so one of the things that you can say that I like to say is we talk about storing charge, but you can also talk about the current in a capacitor. Now I like differential equations. So current is the change in charge with time, dQ/dt. And so that I have Q = CV.

TA (00:49:57):

So if I differentiate both sides with respect to time, I get dQ/dt on the left, which is current. That's pretty cool. And then on the right, I have C times V and I said that C is a constant, so nothing is changing it.

TA (00:50:11):

So I = C times ... and then I've got to differentiate V. So I = C dv/dt. So if I want change a voltage across a capacitor, I've got to give it a current.

CW (00:50:26):

Okay.

TA (00:50:27):

I've got to put current into it to change its voltage. And ... you can use that to smooth out a voltage, like having your bypass capacitors, where you have local charge to store for your digital device.

EW (00:50:48):

I never understood. I just went to bypass capacitors, and I was like, "Okay, all I know is that you need to treat capacitors like salt. They should be all over the board, and it makes the board better," not taste better, but better.

TA (00:51:02):

Right.

CW (00:51:04):

I know we talked a lot about bypass capacitors in earlier incarnations -

EW (00:51:08):

Yeah.

CW (00:51:08):

- of this show, but I do think that bypass is kind of a terrible name.

EW (00:51:12):

It is.

CW (00:51:12):

Because they're filters to a certain extent. They're filters, and they also provide -

EW (00:51:17):

They smooth your power signal.

CW (00:51:18):

They provide power when power drops out some.

TA (00:51:21):

Yeah. And they provide local energy storage -

CW (00:51:24):

Yeah.

TA (00:51:25):

- also, another way to look at it.

EW (00:51:29):

But if you've got signals going all over, and we talked last time with you about everything's an antenna, which means everything is radiating, which means power is being lost. And so the capacitors just keep everything normal.

TA (00:51:44):

Well, we need the capacitors because we have inductors, in part. But actually, we get capacitors because we have charge, and we want to move it around. And then the limit to that then becomes inductance, because in order to start to move the charge around, we've got to accelerate it.

EW (00:52:09):

Okay. So inductors in the physics model are dashpots. My question there is, "What the heck is a dashpot?"

TA (00:52:17):

Well, the problem with the good analogies, and by good, I mean the ones that work, is that you don't have any intuition for the devices that are in the analogies that work.

CW (00:52:33):

That's right.

EW (00:52:33):

Yes, exactly.

TA (00:52:33):

And the ones where you have intuition, the analogies are really poor, and they don't work.

CW (00:52:38):

The analogy is close enough. You should just stop using it, because it's close enough. You might as well use the real thing.

TA (00:52:44):

So I'm going to go a different way. ... I said Q = CV, and there's a similar equation for inductors. But hardly anybody uses it, because it has flux in it. And nobody wants to talk about flux, magnetic flux. So you just start right with a differential equation, which is V = Ldi/dt.

TA (00:53:07):

But I already just said that... I is the derivative of Q. Q is the charge. I is the moving charge. And now I'm talking about a moving moving charge.

EW (00:53:20):

The acceleration of charge.

TA (00:53:22):

It's acceleration of charge. Right. So V = Ldi/dt. Well, di/dt, that's ddt of I, which is already dV/dt. So I've got two derivatives there, a second derivative. And the second derivative is acceleration. So what the heck does that mean? So V = L times the acceleration of charge.

EW (00:53:47):

What was L again?

TA (00:53:48):

Inductance.

EW (00:53:49):

Oh, right. That was what we were talking about.

TA (00:53:51):

Yeah. So ... how much voltage you need to accelerate a charge is determined by inductance.

EW (00:54:03):

And like the transistors, we have capacitance associated with them. There's also inductance, isn't there? Why isn't it called parasitic inductance?

TA (00:54:14):

Well, there is parasitic inductance, and it's usually not right inside the device, because in transistors and whatnot the distances are pretty small. And the inductance goes kind of with distance.

TA (00:54:37):

There are some cases where the inductance inside the semiconductors is important, but it's at really high frequencies that we normally don't have to worry about, I don't know, 50 gigahertz or something. People worry about that sort of thing.

EW (00:54:54):

When I have inductors on a board, it's usually associated with FCC testing.

TA (00:55:03):

[Ah], yes.

EW (00:55:04):

You need an inductor to stop it from radiating.

TA (00:55:07):

Right. And so in that case, they're smoothing out the current by making it well, V = Ldi/dt.

EW (00:55:22):

No more equations.

TA (00:55:24):

Oh, okay. Yeah. Alright. Alright.

CW (00:55:26):

One way I learned to think about it is, all of these devices oppose certain things. So capacitors oppose changes in voltage. Inductors oppose changes in current. So if there's a change in current, an inductor tends to want to smooth out that change.

CW (00:55:48):

If there's a change in voltage, a capacitor tends to want to smooth out that change. A resistor does something else, and I forget what it is.

EW (00:55:55):

Resists.

TA (00:55:56):

Right.

CW (00:55:56):

Resists. It doesn't like anything. That's a simplistic way of looking at it.

TA (00:56:01):

Yes, that's very good.

CW (00:56:01):

A capacitor has this chart that has this charge pool that it can use to inject new voltage in if voltage has dropped on its terminals. An inductor has energy stored in a magnetic field, and that will be drained to oppose a change in current.

EW (00:56:24):

Why don't metal things stick to my electronics if I've got inductors?

CW (00:56:29):

Well, because the magnetic field is like a solenoid. It's inside the thing, and it's not coming out really.

EW (00:56:38):

I'm not sure you should do that -

CW (00:56:40):

The field lines are very, I mean, it's a very small -

EW (00:56:42):

- hand motion in public.

CW (00:56:44):

I'm not in public, and I'm not on video, so no one knows what I just did.

EW (00:56:50):

Pretty sure they do.

CW (00:56:53):

Anyway.

TA (00:56:54):

So I think you got it right in that you could say that the capacitor smooths out voltage and the inductor smooths out current. Another way to say it is that when you have a circuit, at every point in the circuit, every node, every piece of wire, there's something that's limiting how fast that voltage can rise.

EW (00:57:21):

Is that capacitance?

TA (00:57:23):

Yeah.

EW (00:57:24):

Okay.

TA (00:57:24):

And in every conductor that you have, every piece of wire, there's something limiting how fast that current can rise.

EW (00:57:34):

And that's inductance.

TA (00:57:35):

Yeah.

EW (00:57:36):

What do resistors resist?

TA (00:57:40):

Well, the little electrons, when they fly around inside the metal, they're very free and loose. And we like that, because you pop one electron in one side of the wire, and they all shift over by one, and one comes popping out the other end.

TA (00:58:01):

And so that's really great, but some of the wires bump into something on the way, like a copper ion or a crystal boundary between the little metallic crystals of copper or whatever the conductor is.

TA (00:58:21):

And so normally at room temperatures, what you're getting is some of the electrons hit the copper ions and bounce off. And there's a little bit of loss associated with that, where it into heat. So it becomes a vibration. And that is another one of these kT/q things.

TA (00:58:46):

And so at higher temperatures, you get more resistance for a given conductor. Now to make a resistor, you don't normally use copper unless you want a really small value of resistance. So people use different metals, or oxides, or whatever to control the collisions, so that they happen in a way to give a nice constant resistance.

EW (00:59:17):

So resistors resist electron flow, and they do that by making the electrons bump into things. And then some of those electrons end up getting sent out into the world as heat.

TA (00:59:36):

Well, they emit, I guess it's photons or whatever. They're still electrons. They're still inside the wire. They're just causing heat to flow.

CW (00:59:47):

They've lost energy.

TA (00:59:49):

Right, right. Yes. They've given their energy to the copper ion.

EW (00:59:54):

And the way we make resistors is we take something that has good flow, like a metal, and then we put things in between, like trash.

CW (01:00:07):

Trash.

TA (01:00:08):

Yeah, yeah, yeah.

CW (01:00:10):

McDonald's wrappers, cigarette butts, old cans.

TA (01:00:14):

Oxygen. Yeah.

EW (01:00:15):

And good resistors are high quality trash.

CW (01:00:20):

Right.

EW (01:00:20):

More consistent, actually.

CW (01:00:22):

Yeah. Like very expensive coffee grounds.

EW (01:00:26):

Alright. Yes. You heard it here. Resistors are made of coffee grounds.

TA (01:00:31):

I think that's Mr. Fusion, right?

CW (01:00:34):

Yeah.

TA (01:00:36):

Yeah. Eggshells and coffee grounds. So yeah, the crystal boundaries another way to do it. And that's why I said that this resistance is related to kT/q. And so why don't I just set T equal to zero, and then I'll have zero resistance, and it'll be a superconductor.

TA (01:00:57):

But the reason that copper isn't a superconductor is because it has these crystal boundaries. And so that's another source of friction.

EW (01:01:06):

Okay. I have copper laid down on my board, and it's flat. And you're telling me it's a crystal. I thought it was a metal.

TA (01:01:16):

If you look with a metallurgical microscope, you see these little crystals. Yeah. It's a metal. Yeah. But it's kind of got a crystalline structure to it. Another word for it is a grain, I guess, in metal. They call them grains.

CW (01:01:35):

If you think that's bad, let me tell you what iron does.

EW (01:01:40):

I mean, really most metals are crystals. They organize in a certain way. And as you said, it's grain. Most things are crystals, aren't they?

CW (01:01:51):

I'm not.

EW (01:01:54):

Not at a macroscopic level, but at a -

TA (01:01:56):

Well, we're sort of a liquid crystal, which is sort of a cheat way to say it.

EW (01:02:03):

That's true. I mean, it's crystal when it's a solid. Things that aren't solids have the potential to crystallize, but -

CW (01:02:11):

I don't think we have to find what a crystal is.

EW (01:02:13):

Alright. Anyway.

TA (01:02:14):

Alright. So I have one more thing, which is why parasitics are not really parasitic. And why we need them, and we can't survive without them. Much like ... the capacitance is a feature of having charge around and voltage, we need inductance in resistance as well.

TA (01:02:40):

And when we leave them out, we can get the wrong answer. It's not like there's some ideal state of the world that doesn't have these things. And to do this, I want to say a paradox, and it has a little bit of math in it. But it's a circuit, but it's a really simple circuit.

TA (01:03:02):

I'm going to take a capacitor, and I'm going to charge it up. And I'm going to connect it to an across another capacitor. And so they're ideal capacitors. They don't have any resistance. There's no inductance. And we're going to show that that causes a problem.

EW (01:03:23):

Wait a minute. Doesn't half of the capacitor's charge go to the other one?

TA (01:03:29):

Yeah. Yeah. Let's say that. So ... we'll make the math easy. So I'll put one as many places as I can. So let's take two one-farad capacitors capacitors, and I'm going to charge one of them to one volt. And the other one is at zero volts.

TA (01:03:49):

I'm going to connect them together. And half the charge should go to the other one, right? Half the charge stays in the original one and half goes to the other one. So they each have half a volt on them, right?

EW (01:04:02):

I'm starting to think this isn't going to work.

TA (01:04:04):

Well, let's try it. Well, so the thing that I like to do is to see how the equations work out. So let's take charge, conservation of charge. Okay. Q = CV. I've got one-farad times one volt is one coulomb, is what I started with in one capacitor.

TA (01:04:28):

And then I went to the other one, and I've got Q is still equal to CV. And each one of them has half a coulomb, -

EW (01:04:35):

And there are two.

TA (01:04:36):

- because it's half a volt. So that works out fine, right?

EW (01:04:39):

Two times a half is still one.

TA (01:04:42):

Yep. Okay. Now let's see if it conserves energy. Well, the energy in a capacitor is one half CV squared.

EW (01:04:53):

See, I wouldn't know that one, but okay. We can pretend I looked that up.

TA (01:04:57):

Okay. Yeah, it's kind of like kinetic energy. One half mv squared.

EW (01:05:02):

I should remember that one.

TA (01:05:03):

So there's a lot of these one half something squared. So one half CV squared is, one half times one farad is a half, and then V squared in my original one is one.

EW (01:05:22):

One.

TA (01:05:22):

One squared is one. So my energy is one half -

EW (01:05:27):

One half.

TA (01:05:27):

- of a joule.

EW (01:05:28):

Okay.

TA (01:05:29):

One half of a joule. Okay. And now, okay. And now let's look at it in the second state where both of them are at a half of volt.

EW (01:05:41):

Okay. So V squared is one half times one half. So it's a quarter.

TA (01:05:45):

It's a quarter. And then -

EW (01:05:46):

And C is one is still one, because they were both. And there's nothing that cancels out there being two of them.

TA (01:05:57):

Right? Well, it's one half CV squared. So I have an eighth of a joule.

EW (01:06:01):

Which is much less than one joule.

TA (01:06:04):

Well, I started with half a joule.

EW (01:06:06):

Right, right.

TA (01:06:06):

And ... my first capacitor, I had half a joule, because one half CV squared, and C is one, and V is one. So I got half a joule.

EW (01:06:16):

Okay.

TA (01:06:16):

And then I went to one half CV squared, and I got one half times one times a quarter. Because ... V is a half, and so I squared it, and I got a quarter. So now I have an eighth.

EW (01:06:30):

Right

TA (01:06:31):

In each capacitor, I have an eighth of a joule.

EW (01:06:33):

So if you add them together -

TA (01:06:36):

I get a quarter of a joule.

EW (01:06:37):

- which is not a half of a joule.

TA (01:06:39):

Yeah. So I don't conserve energy.

EW (01:06:42):

So that's not what happens.

TA (01:06:44):

Well, what happened? Well, the problem is I can't have this circuit.

EW (01:06:49):

Well, it's not really a circuit. We have it charged up on one side, and it doesn't lead to anything, or was there a circuit that I didn't know about?

TA (01:06:56):

When I close the switch, if it's an ideal switch, what happened to the energy? I mean, I lost half of my energy. Where'd it go? I don't have any resistors. I don't have any -

EW (01:07:11):

Well, that means that that wasn't what happened.

CW (01:07:14):

No, it means it went to a loud trumpet sound.

EW (01:07:17):

I think maybe it just stayed in the first capacitor. I don't think there was any reason for it to go to the second capacitor.

TA (01:07:24):

Well, they're connected through a wire to the same voltage. This ideal wire, it's supposed to have the same -

CW (01:07:32):

Has to have the same, yeah.

TA (01:07:32):

- voltage all the way across it.

CW (01:07:34):

Where'd it go, Tom?

EW (01:07:35):

Where'd it go?

TA (01:07:37):

So what it is is a paradox, right? And the problem with the paradox is, is that just because I made a circuit, and I have schematic symbols for it, doesn't mean that it's real, that it can actually be built. And so this is an example of a circuit that you can't have, because it doesn't have its parasitics in it.

TA (01:08:03):

And in this case, I could solve the problem with some resistance in the wire. And what happens is that when you close the switch, the energy gets dissipated as heat in the resistor as the second capacitor charges up.

TA (01:08:24):

Another possibility is to put in some inductance, and then the energy kind of slashes back and forth between the two of them instead of dissipating. So it really doesn't get to a steady state, I don't think. And so that's another case where, in this case, if you don't include the parasitics, you actually get the wrong answer.

TA (01:08:51):

So you can design something and say, "Well, if I only had this ideal switch I could get," well, in this case, it'd be the opposite of free energy, right?

EW (01:09:05):

You just switch it the other way.

TA (01:09:07):

It would magically make energy disappear, but I'm sure I can -

CW (01:09:10):

Which is probably bad for the universe.

TA (01:09:12):

Yeah. So maybe I could come up with another one that would be one of these free energy circuits. ... I can't just go to some venture capitalist and say, "I really need to invent this ideal switch, because then I'll have free energy," or something. It doesn't get to work that way.

TA (01:09:39):

And partly it's because we don't have an ideal switch. Because as we just went through with the vacuum tube, there's always this kT/q kind of a thing that happens when you're doing switching. Even in a mechanical switch, it's limited.

TA (01:09:56):

And so people run into this in circuit simulators where they say, "Well, I'm doing some switching, and where's the model for an ideal switch?" And there typically is not one in the simulator.

TA (01:10:15):

Some simulators have one, but they actually put parasitics into it. Because if they didn't, it wouldn't conserve energy in their simulator and their simulation would give a horribly wrong answer.

EW (01:10:26):

It'd make that sound Christopher was mentioning earlier.

TA (01:10:28):

So that's why, yeah, we need all of these things that limit the voltage rising and current flowing. And so you have that expression, "Everything is a thermometer."

EW (01:10:49):

Everything is a temperature sensor. Sometimes they measure other things. Yes

TA (01:10:53):

Yeah. Everything is also a resistor, a capacitor, and an inductor.

EW (01:10:58):

Yes.

TA (01:11:01):

And that's good. Because if it wasn't, nothing would work.

EW (01:11:08):

I understand what you're saying about the math and how the simulation needs to work, but I I'm back to a light switch. Does that mean when I turn on and off the lights, there is some energy lost just by -?

CW (01:11:23):

Not lost. Energy's never lost, because in the example that doesn't work, energy truly was lost, which can never happen. So you have to be careful when you say energy lost.

EW (01:11:32):

So when I do the switch, there is some parasitic resistance, or capacitance, or inductance, that as things switch from on to off or off to on, energy goes in places I don't expect.

TA (01:11:51):

Yes.

EW (01:11:54):

Okay. I mean, we're pretty [inaudible].

TA (01:11:58):

And you can see it in the switch, because if you take apart a switch, you see that little spot where the spark goes every time you switch it. And that's why DC switches have that problem worse, actually, because the material plates from one contact into another usually.

TA (01:12:19):

And that's why you'll see a switch that's rated for ten amps AC or something. And then the DC rating will be a tenth of an amp. And that's because in AC you don't know which way it's going to plate the material in the switch.

TA (01:12:38):

It'll deposit it from one contact to another, but the next time you turn the switch, on the average, it balances out. Because the material goes from one contact back and forth, depending on what part of the cycle it got switched on. But it's actually pretty violent inside that switch, what happens.

TA (01:12:58):

And you can see it if you look in big power electronics in something. Switches are a really big deal. For DC they're great big things. And they're kind of explode-y when they switch.

EW (01:13:15):

True. I have seen switches spark, and I've always thought that was an error of some kind. But you're telling me the sparks are how the switches work.

TA (01:13:28):

Yeah. I think it needs those.

CW (01:13:30):

Well, you don't want to turn on a light switch if you smell gas in your kitchen.

TA (01:13:34):

Yes. Explosion-proof switches are a thing.

EW (01:13:39):

Okay. Okay. My brain is maybe getting full. We've covered the big three and transistors.

TA (01:13:48):

Yeah, I think we covered basically all of modern electronics.

EW (01:13:52):

Okay. Well, yes, then -

CW (01:13:55):

This is good.

EW (01:13:55):

This is good.

CW (01:13:56):

I learned a lot.

EW (01:13:57):

I did too. Then we should go about our days and let all this sink in a little further. Tom, do you have any thoughts you'd like to leave us with?

TA (01:14:07):

Yes. I do. So just like every node in a circuit has something that limits the voltage or the every wire has a current limit, people also have limits on how much they can do. And while people don't have good datasheets, that's up to you to figure out and figure out what your limits are.

TA (01:14:33):

And remember that just like in circuits, your limits are actually good. They're kind of the basis of cause and effect. And you can respect those and have a better life.

EW (01:14:49):

Our guest has been Tom Anderson, Engineer at Keysight Technologies.

CW (01:14:54):

Thanks again, Tom.

TA (01:14:55):

Thank you.

EW (01:14:57):

Thank you to Christopher for producing and co-hosting, and thank you for listening. You can always contact us at show at embedded.fm, or hit the contact link on embedded.fm.

EW (01:15:07):

And now a quote to leave you with. This one's from Ray Charles. "What is a soul? It's like electricity - we don't really know what it is, but it's a force that can light a room."