Embedded - 412: Inductors Don't Have Feelings

Episode Date: May 12, 2022

Tom Anderson returned to the show to describe how transistors and passives work. We discuss everything from vacuum tubes to diodes to transistors (PNP and NPN) to resistors and capacitors. We search f...or synonyms among the confusing terminology of cathodes, plates, emitters, anodes, grids, bases, and collectors.  This was a tech heavy episode so little bit of brushing up on terms may be useful before (or after): Boltzmann constant Physical constant Vacuum tube Diode logic Diode  Push–pull converter Transcript.

Transcript
Discussion (0)
Starting point is 00:00:00 Welcome to Embedded. I'm Amicia White, alongside Christopher White. We talk about resistors and capacitors, inductors and transistors and diodes, as though they're just, you know, things that happen on a board. As though they, you know, don't affect our software. But it's kind of important to understand them. And so we've asked Tom Anderson back to give us a basics of what these are. Hi, Tom.
Starting point is 00:00:36 Hi, Tom. Hello. Good to be back. For folks who haven't heard an episode with you before, could you give us an introduction? 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. Do you want to do lightning round, or should we just skip straight to the resistors? Well, I think the lightning round kind of is the most fun part of the show, so let's go. Okay, favorite fictional animal or cryptid?
Starting point is 00:01:24 Bigfoot. Least favorite software application? Excel. Ooh. You know, some people write their entire platforms in Excel. Yeah, well, it used to be good, but they nerfed it. Complete one project or start a dozen? Start 200.
Starting point is 00:01:48 Best gauge of bass string? I don't know. Round wound or flat wound? Did I already ask that one last time? No, I don't think so. I like half round. Ah, yes. Ground wound, I think they're called sometimes. You can call it that, too. If you could teach a college course, what would you want to teach? 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. Do you think electronics can be taught at high school or lower level?
Starting point is 00:02:26 Well, that's when I learned it, and I was taught, so I think so. 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. I mean, I remember from systems class, resistors and inductors and dashpots and springs and tube pipes that are smaller and all kinds of things that they said were all the same, but I don't think they are. Wait, wait, pipes?
Starting point is 00:03:07 I think you took a plumbing class. Well, that was the thing. They did resistors, and something was a capacitor, a sponge? That seems weird. I thought a capacitor was like a water tank. That makes more sense. That went uphill, and then you pump water into it, and then, yeah. I'm not sure.
Starting point is 00:03:22 What was the sponge then? That's not an inductor. Resistor, maybe? Tom tom was it a sponge those analogies are not that great no they aren't that's why i got a d in systems engineering the the they all have limitations um all you know analogies eventually break down and some are better than others and break down later um the 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 um in our day-to-day life uh capacitor is like a water balloon um and pipes cannot be opened uh so you can't make a siphon, for example, because they're all closed-loop pipes. And so, yeah, plumbing, it's not intuitive.
Starting point is 00:04:13 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. Remember, we can't see any equations you're putting on that board there. Getting hung up on Boltzmann's constant was my entire 2005. Okay. I'm a huge fan
Starting point is 00:04:36 of Boltzmann's constant. As a 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. And because temperature is really kind of based on what boiling point of? 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.
Starting point is 00:05:15 And so you get into absolute temperature. Kelvin starts at absolute zero and goes up. 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. And so that kind of asks the question,
Starting point is 00:05:42 well, what really is temperature exactly from like a physics point of view? And people usually learn the ideal gas law, PV equals NRT, and Boltzmann's constant is in there somewhere. But not directly. Boltzmann's constant isn't the N. I think it's the R. PV equals NRT. Oh, is it the R? Yeah, yeah, that's Boltzmann's constant.
Starting point is 00:06:03 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 kind of a common one um you hear a lot in semiconductors when you when you turn on a transistor you hear about kt over q is this um this term that comes up a lot uh that's that 26 millivolts or so uh for turning on transistors um and so what is all that stuff i mean how do we use that to understand anything and where i'm going with
Starting point is 00:06:56 this is is that we're going to tell uh how transistors and diodes work before we do resistors, capacitors, and inductors. What? Yeah. I mean, I always thought it went the other way. Well, I'm going to do it backwards. Okay. And Boltzmann's constant energy divided by temperature? That's not what you said.
Starting point is 00:07:22 That's one way to look at it and in fact in in physics uh if you're a physicist you might uh say that boltzmann's constant can be totally normalized out and you just set it to one well you know everyone does that from speed of light and boltzmann's constant yeah exactly time well you can yeah Yeah. If you're doing relativistic statistical mechanics, I suppose. 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.
Starting point is 00:08:04 It must be this really deep concept and so i i won't pretend to explain it anyway but there is some jargon uh 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 uh around uh and so there's this jargon called diffusion and drift uh it's very confusing because if you take uh the semiconductor physics in college it's very confusing because they i i think that i 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.
Starting point is 00:08:55 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. 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. So in explaining these things, they have all these terms. I'm not going to actually use them probably so much because
Starting point is 00:09:54 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. 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 now why do they do that uh why do they they come off because when they get really hot they get enough energy to leave the metal uh 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. So the electrons are held on pretty loosely in a metal.
Starting point is 00:11:07 It's a conductor. They're flying around. And an electron zings right off with the thermal energy, 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. And so the cloud is attracted back to the metal, which is positively charged. So the electrons boil off and then come slam back down into the metal. Like when I boil water in a closed pot, the water turns into steam. But since it's closed, none of the water escapes.
Starting point is 00:11:53 And at the end, I haven't lost very much. Right. It comes back into, particularly if it's in a vacuum there, it'll, like in a pressure cooker. Yeah, sure, the steam goes back into the stuff, back into the liquid. And so the steam here is electrons. Yes, yes.
Starting point is 00:12:17 So we've boiled off these electrons. So if I, 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. 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. Is this plate on the glass, in the glass, through the glass?
Starting point is 00:13:01 It's inside the glass. Okay. 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 uh let's see it gets electrons on it so it has a negative charge and which gives it a positive voltage electrons because everything is backwards. Is this actually Ben Franklin's fault? Yes. Well, I've heard it is, but I wasn't there. Wasn't suggesting it.
Starting point is 00:13:36 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 they would yeah they would do other things yeah you would you would we would be inventing something else we would be inventing like i don't know neon signs or something okay um or most likely it we would be the gas would react with the metal and spoil it um because it gets really hot in there and so if there was oxygen in there it would tend
Starting point is 00:14:13 to oxidize um make a mess it would rust we'd have a rusty can uh and we need it needs to be very clean because the ability for the electrons to fly off the metal counts on having very clean metal. Okay. 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. And they're really pretty good at repelling those electrons, because remember now it's negatively charged. And so the electrons are negatively charged, so charges repel.
Starting point is 00:15:00 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. So that cathode sits there and boils, 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 makes a little loop around. Then what can happen is the electrons that hit that plate can get a free ride down the loop. And so they can go down the sliding board and say, whee, and they get a free ride back down to the cathode, which has, it's been left with a positive charge,
Starting point is 00:15:55 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. Because you still have the campfire going. Yes. I'm putting energy in, and I'm turning it into electricity. I'm putting in heat, and I'm getting out electricity.
Starting point is 00:16:15 And so, there we go. Okay. Let me make sure I got this. Okay. 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, I have 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. And now the bottom of the light bulb, the small end, it gets heated. And so the
Starting point is 00:16:53 metal sends off electrons because it's too hot. It needs to take off its electrons. 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 negatively charged or positively charged, they want to go back home because they don't. But some of them escape it and they go to the plate. And then the plate is negatively charged. And so it eventually doesn't want to get any more or it wants to go away from the electrons don't want to stay together so it can go out its wire and then if you hook the 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
Starting point is 00:17:38 end is negatively charged right okay 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. If I put a positive voltage, and I mean more positive than the cathode on the plate, it would attract the electrons even better. 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. Because they can't stay on the plate that they came from because they don't like each other
Starting point is 00:18:32 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. 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 and so very little current would flow. Whereas if I put
Starting point is 00:19:04 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. Oh, okay. That is what diodes do. It makes sure that you can only go one way,
Starting point is 00:19:23 which is very handy for those of us who tend to plug things in backwards. Exactly. Okay. And so now that I have a diode, I can really flowing somewhere and we want to control it with a third wire. 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 over q. And it's the same kT over 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. 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.
Starting point is 00:20:28 And since we don't have any video, well, I don't like to explain transistors anyway, but they're even worse than without a whiteboard. So... KT over Q. Yeah. K there is Boltzmann's constant. Q is the Coulomb. The charge of the electron.
Starting point is 00:20:49 Okay. 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 the, you know, figuring out the equation for how much current you get through a diode based on the voltage that's on it. Is T time? Temperature. Temperature. Oh, that makes more sense. Yes. Okay.
Starting point is 00:21:16 So, KT over Q. K is the Boltzmann's constant. T is absolute temperature in Kelvin, usually, and Q is charge in coulombs. Right, because whenever you have Boltzmann's constant, it's about temperature, not about time. Right, 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 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 like thermodynamics was initially uh developed experimentally and so all those weird equations about enthalpy and entropy and whatever uh were just, and all those definitions. And Boltzmann defined it through, he redeveloped
Starting point is 00:22:11 thermodynamics through a more normal physics approach that people are used to with kinetic energy of gases and things. 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. Sure. Well, it does. And it'll make even more sense if you read the wikipedia entry on boltzmann's
Starting point is 00:22:46 constant because um there's actually it's actually pretty good there's a lot there uh and it's not very long okay so we have a diode we know how to make a diode but we're getting input from a third thing yeah and the the thing to add is called the grid and so it's a third thing 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 between a wire 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. 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.
Starting point is 00:24:02 Is the mesh inside the cloud? Yes. The mesh is inside the cloud between the cathode and the plate. 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? 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.
Starting point is 00:24:40 Back to the cathode? Back to the cathode, yeah. And the other half we're going to go through to the plate and what that lets me do is to to control that current with a voltage oh okay i see where we're heading yeah okay if i if i change that that voltage a little bit it changed the field inside the the tube and it adjusts the flow of electrons. I thought diodes were on or off. We're beyond diodes now.
Starting point is 00:25:13 Oh. I think we're moving to... Yeah, we've just gotten into a triode. Okay. So, the grid has a slightly negative voltage to repel with respect to the cathode. I think that's the way it works out. I think I got that sign right. It's so confusing with the currents to electrically control a current.
Starting point is 00:25:52 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. way. There's a few more effects. Instead of having vacuum, it's silicon. And instead of just having electrons, there's holes in 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.
Starting point is 00:26:29 And it becomes neutral then. 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, you know, conservation of charge and conservation of energy and all that. And so before in the physics like of a vacuum tube,
Starting point is 00:27:00 you've got to balance this drift and diffusion currents. Well, there's add to that recombination current and then there's still some thermal effects a little bit in transistors not as much because they don't work um the same way as by um thermionic emission usually and so like an npn transistor uh the n let's start at the top of the collector. That N is kind of like the plate of a vacuum tube. 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
Starting point is 00:27:45 P with respect to the emitter, it attracts the electrons. And what happens is the electrons come up from the emitter through diffusion, actually. Is the emitter the cathode? 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
Starting point is 00:28:25 and then get sucked up into the collector. So it's more of a traffic cop than... I don't know. It's directing a flow, but it's not... Well, it gets some of the flow because some of the traffic hits it. So it would be an injured traffic cop because it's got some current um a little like one percent
Starting point is 00:28:48 of the current or something flows into it and um 99 flies right through it but that's different from the grid in a vacuum tube yeah yeah that is now a um 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. So, and the emitter is sitting there emitting electrons just like a cathode. And so every time, now and then,
Starting point is 00:29:22 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. Emitter is the cathode. Collector is the plate. The P is the mesh. Yeah, the mesh yeah the grid yeah the grid except it works the backwards way and that it attracts things and they zip right through um and so you get jargon about like whether it works based on attraction and repulsion in things like enhancement mode and depletion mode, which you may have heard of in transistor data sheets, for FETs anyway.
Starting point is 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. 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, that's the whole – that's basically – I just gave you all of device physics right there. I mean, I think you get a PhD now, everybody who's listening. It's all just diodes with whether or not the the mesh is positive or negative and npn and pn yeah yeah that's all there is to it yeah yeah it's trivial okay so what do i
Starting point is 00:30:57 do with this like like like okay i've got one of these things uh 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 well because you you can have one thing controlling five of these and then you get more current than you got before okay right and so the idea is, 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 like an Orgate or a NANDgate or something out of them,
Starting point is 00:31:45 where you put two devices in the bottom instead of one. An inverter has got whatever input it takes, it gives you the opposite, right? So if you put in a one, you get a zero. Or say, 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 um pull the signal up or down 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
Starting point is 00:32:22 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. All you need to do any of this is an inverter, which we don't know how to make, but that's probably easy, and a diode. Yeah, you can actually do it just out of diodes and resistors. But the computers aren't very good. The original ones started that way. Resistor diode logic. Yeah, it was kind of rough.
Starting point is 00:32:57 How do you make the inverter? What's it made out of? Or in our vacuum tube version. In our vacuum tube, what we would do is we would say, well, let's make it out of a regular transistor because the tubes were just to explain how transistors work, really. So when the base voltage goes up, the collector, 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.
Starting point is 00:33:35 And I'm going to take the output current out of the collector. 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. 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. So when the transistor is off,
Starting point is 00:34:07 my output is high. It's up near the supply voltage. And when the transistor is on, 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. So we think of a transistor as being on or off like a switch.
Starting point is 00:34:36 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, the ground where the emitter is. And that's in that state where the base voltage is high. So I've made an inverter. I don't think I got all of that. Okay, so let me try it again. I'm going to design a circuit with one transistor and one resistor.
Starting point is 00:35:07 Okay. I'm going to have my power supply power 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 would be the plate. Thank you. And then I'm going to have my input signal on the base or the grid, and I'm going to ground the emitter. And so we're now, instead of going from emitter to plate, we are going grid to plate. So the input voltage is between the grid and ground, or the base and ground, really.
Starting point is 00:35:54 And we kind of, since NPN transistors kind of work the other way from tubes, as far as which way the signals go for positive and negative, we need to, let's just switch to NPN transistors. So when the base voltage is high, I have some base current. It turns on the transistor. And current can flow. And current flows through the collector, and it pulls the voltage down that's on the collector.
Starting point is 00:36:30 Because it's flowing to ground. It's like a regular open collector output in a digital circuit with a pull-up resistor on it. 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. Yeah, it's not quite a switch because it only conducts current one way uh and so that's the same as your open collector output right if you want to um if you wanted to to put a uh a load uh that's something other you know something other than a...
Starting point is 00:37:25 Like, oh, here's an example. Let's say here's a circuit that you shouldn't build. Let's put, instead of a pull-up resistor on your open collector output, your nice digital output, let's put a motor. That's the... And that'll work for a little while uh because what'll happen is when you turn the transistor on the uh 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. It'll be fine. When you turn off the motor, the energy from the motor gets dumped back into the
Starting point is 00:38:10 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. So that's an example of where it's not just a switch. It's 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. It could be something else like a motor or an LED,
Starting point is 00:38:47 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? Is this working for you? Is this too hard to do on the radio? No, this is mostly working.
Starting point is 00:39:10 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. It's just that it's, 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.
Starting point is 00:39:36 Well, the transistor works differently than the, physically than the tube. Well, yes, but I can't get past that. And also the electrons are going in the wrong direction. Right, yeah. That part I'm okay with. I don't care which way the electrons go because they're imaginary, but... Okay.
Starting point is 00:39:53 I assure you, electrons are quite real. There might be only one of them, but they're quite real. Is having NPN and PNP transistors like having, like, byte ordering? Why? It confuses everything. Why do you need both?
Starting point is 00:40:16 Well, you remember how I said that NPN transistors, the current only flows one way in them? Yeah. And PNPs, it flows the other way. Yeah, so why don't you just turn it around? Turn it around. Well, that's the PNP. It's a turned around NPN. Because you can't turn it around
Starting point is 00:40:38 because you'd be switching. You have to turn inside out. Okay. 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 complementary, and that means it has both N-channel and P-channel,
Starting point is 00:41:18 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. And then at the 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. Okay.
Starting point is 00:41:58 So, push-pull. I have two diodes, and they are opposite each other. What does that do? What does that make? Is it just a power thing? Is it just making higher voltages? The push-pull? Yeah.
Starting point is 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. Because if you only have one direction, you could only push a speaker out. Oh, right, because speakers need to go both ways in order for highest efficiency i assume to make waves i mean you could do it one way but it would be giving up half of the speaker's travel oh okay so push pull is a music thing and a power thing it does it relate to transistors on their own? Well, it's that complementary circuit, just like in a logic gate, in a CMOS gate. And you can configure push-pull on the outputs of your favorite microcontroller, usually.
Starting point is 00:43:21 Right, right. right right you can configure them either to be open collector or um or open what is it the drain open drain open drain or push pull yeah yeah so in fets they call it the the plate that's called the drain and the emitter or the cathode is the source why are there so many words, Tom? 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. Drain sounds good. 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
Starting point is 00:44:05 confuse us? Exactly. So, all right. So now I'm going to get to, you know, capacitance. And I'm going to come at it from this strange direction of device physics. I was really hoping it was going to come from etymology, from incapacitate. That's a good one. I'll have to look that one up so so that what is a capacitor really well it's a way to store charge right and so we say you know q the charge is equal to capacitance times voltage which just means if i if i uh have a constant capacitance which is what i like to have uh that is to say one that doesn't vary with voltage, then if I double the voltage, I can store twice the charge.
Starting point is 00:44:50 Or if I double the capacitance, I can store twice the charge. 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, you know, carriers and currents. 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. And so my concern is, you know, when people call them parasitic capacitance, it's like, well, that's actually how it works. It's not like it's some extra thing that they couldn't get rid of.
Starting point is 00:45:44 It's the basis for what the thing is. Now, if you wanted to anthropomorphize, I could say, you know, it hurts their feelings when you call them parasitics. 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 know, maybe not the best choice. So, it's how they work.
Starting point is 00:46:26 Now, inductors, maybe inductors don't have feelings. Wait a minute, wait a minute. Let's go back to capacitors as capacitors, not as part of a transistor. Okay. Chris mentioned the water towers, where a water tower gets filled up and then if there is a need for or if there's no more input it can come from the water tower so it's a storage 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,
Starting point is 00:47:12 you had to go there and then carpool over the bridge. Wow. Two analogies I really don't like. Okay. Yeah, analogies. It's the way I think. I don't know why, but I usually need some analogy to make it work. They can help for the first step. Yeah, it's just the first step. What you need is a large capacitor and a pair of safety glasses. I've done this. And a power supply. And you can see directly how to store a charge because
Starting point is 00:47:48 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. If you have a nice lab meter, you know, 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 so it's like a tiny battery yes they're they're very battery-like. As a 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 1-farad capacitors on
Starting point is 00:48:39 Digi-Key, and even larger values, like 10 farads, is something you can definitely have. The nice thing about most batteries though is they're kind of self-limited the amount of current they can put out if you short them don't drop a wrench across a car battery well true true yes but like i'm talking like consumer double a's and what have you oh right yeah they're very nice although if you put a nine volt battery in your pocket along with your car keys... It gets a little warm. It gets very warm very quickly. Because a 9-volt will put out about 5 amps.
Starting point is 00:49:12 It just tingles on your tongue, though. Right. It's spicy. 9-volt batteries are spicy. Yes, they are. Where were we? Capacitors. Capacitors are like batteries are spicy. Yes, they are. Where were we? Capacitors.
Starting point is 00:49:28 Capacitors are like batteries. Okay. Right. And so one of the things that you can say, that I like to say, is to talk about, you know, 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 I have q equals cv. So if I differentiate both sides with respect to time, I get dq dt on the left, 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 so i equals c times and then what I got to differentiate v so i equals c dv dt so if I want to change a voltage across a capacitor I got to give it a current okay um got to put current into it to change a voltage across a capacitor, I got to give it a current.
Starting point is 00:50:25 Okay. Got to put current into it to change its voltage. And that keeps the capacitor, 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? 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. Right. I know we talked a lot about bypass capacitors in earlier incarnations of this show, but I do think that bypass is kind of a terrible name. It is.
Starting point is 00:51:12 Because they're filters, and to a certain extent. They're filters, and they also provide... They smooth your power signal. They provide power when power drops out some. Yeah, and they provide local energy storage also. That's another way to look at it. 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
Starting point is 00:51:39 just keep everything normal. Well, we need the capacitors because we have inductors in part. But we need, 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. Okay, so inductors in the physics model are dashpots. My question there is, what know, the ones, 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. And the ones where you have intuition, the analogies are really poor and they don't work.
Starting point is 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. So I'm going to go a different way i'm going to say that you know i said q equals cv and there's a similar equation for inductors but hardly anybody uses it because there's because it has flux in it and nobody wants to talk about flux um magnetic flux so you just start right with the differential equation, which is V equals LDI DT. But I already just said that I is the derivative of Q. Q is a charge.
Starting point is 00:53:15 I is a moving charge. And now I'm talking about a moving, moving charge. The acceleration of charge. The acceleration of charge, right. So V equals LDIDT. Well, DIDT is DDT of I, which is already DVDT. So, I got two derivatives there, a second derivative. And second derivative is acceleration.
Starting point is 00:53:38 So, V, so what the heck does that mean? So, V equals L times the acceleration of charge. What was L again? Inductance. Oh, right. That was what we were talking about. Yeah. So, the voltage that you use to accelerate a charge is determined.
Starting point is 00:53:58 How much voltage you need to accelerate a charge is determined by inductance. And like the transistors have capacitance associated with them, there's also inductance, isn't there? Why isn't it called parasitic inductance? Well, there is parasitic inductance. 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.
Starting point is 00:54:36 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. Like, I don't know, 50 gigahertz or something, people worry about that sort of thing. When I have inductors on a board, it's usually associated with FCC testing. Like, you need an inductor to stop it from radiating. Right.
Starting point is 00:55:07 And so, in that case, they're smoothing out the current by making it, well, V equals L DIDT. No more equations. Oh, okay. Yeah. The way I learned to think about it is, 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.
Starting point is 00:55:42 So, if there's a change in current, an inductor tends to want to smooth out that change. 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. Resists. Resists. It doesn't like anything. That's a simplistic way of looking at it, but if you've got these— Yes, that's very good. Like, a capacitor has this charge pool that it can use to inject new voltage in if voltage has dropped on its terminals.
Starting point is 00:56:13 An inductor has energy stored in a magnetic field, and that will oppose a change, will be drained to oppose a change in current. Why don't metal things stick to my electronics if I've got inductors? Well, because the magnetic field is like a solenoid. It's inside the thing and it's not coming out really. I'm not sure you should do that. The field lines are very small. Hand motion in public. I'm not in public.
Starting point is 00:56:47 And I'm not on video, so no one knows what I just did. Pretty sure they do. Anyway. 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. Is that capacitance?
Starting point is 00:57:24 Yeah. Okay. And in every conductor that you have, every piece of wire, there's something limiting how fast that current can rise. And that's inductance. Yeah. What do resistors resist? Um, well, the little electrons, when they fly around inside the metal, um, they're very free and loose. Uh, 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. 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. And so normally at room temperatures, what you're getting is some of the electrons hit the copper ions and bounce off.
Starting point is 00:58:33 And there's a little bit of loss associated with that where it turns into heat. So it becomes a vibration. And that is another one of these KT over Q things. 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. resist electron flow. And they do that by making the electrons bump into things.
Starting point is 00:59:29 And then some of those electrons end up getting sent out into the world as heat. 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 they've lost energy
Starting point is 00:59:47 right right yes they've given their energy to the copper ion and
Starting point is 00:59:55 the way we make resistors is we take something that has good flow
Starting point is 01:00:01 like a metal and then we put things in between like trash trash yeah yeah yeah has good flow, like a metal, and then we put things in between, like trash.
Starting point is 01:00:08 Yeah, yeah, yeah. McDonald's wrappers, cigarette butts, old cans. Oxygen, yeah. And good resistors are, you know, high quality trash. Or more consistent, actually. Yeah, like very expensive coffee
Starting point is 01:00:24 grounds. Yes, you heard it here. Resistors are made of coffee grounds. I think that's Mr. Fusion. Yeah. Yeah, eggshells and coffee grounds. So, yeah, the crystal boundaries are another way to do it. And that's why I said that this resistance is related to KT over 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. But the reason that copper isn't a superconductor is because it has these crystal boundaries.
Starting point is 01:01:02 And so that's another source of friction. 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. 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.
Starting point is 01:01:28 It has another word for it is a grain, I guess, in metal. They call them grains. If you think that's bad, let me tell you what iron does. 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? I'm not.
Starting point is 01:01:54 Not at a macroscopic level, but at a... Well, we're sort of a liquid crystal, which is sort of a cheat way to say it. That's true. I mean, it's crystal when it's a solid. Things that aren't solids have the potential to crystallize. I don't think we can find what a crystal is. All right. Anyway.
Starting point is 01:02:14 All right. 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 charge is a feature of the capacitance is a feature of having charge around and voltage, inductance, we need inductance and resistance as well. 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 I'm going to, to do this, I'm going to, I want to say a paradox. And it has a little bit of math in it.
Starting point is 01:02:59 But it's a circuit. But it's a really simple circuit. 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.
Starting point is 01:03:23 Doesn't half of the capacitors charge go to the other one? Yeah. Yeah, let's say that. So let's say 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. And I'm going to charge one of them to one volt, and the other one is at zero volts. I'm going to connect them together, and half the charge should go to the other one, right?
Starting point is 01:03:55 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? I'm starting to think this isn't going to work. Well, let's try it. 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 equals CV. I've got one farad times one volt is one coulomb, is what I started with in one capacitor. 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. And there are two. Because it's half a volt.
Starting point is 01:04:37 So that works out fine, right? Two times a half is still one. Yep. Okay, now let's see if it conserves energy. Well, the energy in a capacitor is one half CV squared. See, I wouldn't know that one, but okay. We can pretend I looked that up. Okay.
Starting point is 01:04:57 It's like, yeah, it's kind of like kinetic energy, one half MV squared. It's, it's, it's. I can't remember that one. There's a lot of these one half something something squared um so one half cv squared is one half times one farad is a half and then v squared in my original one is uh one one one squared is one so my energy is energy is 1 half of a joule. 1 half of a joule. Okay. And now let's look at it after
Starting point is 01:05:35 in the second state where both of them are at 1 half a volt. Okay, so V squared is 1 half times 1 half so it's a quarter. It's a quarter. And C is still one, because they were both. And there's nothing that cancels out there being two of them. Right? Well, it's one half C V squared, so I have an eighth of a joule. Which is much less than one joule. Well, I started with half a joule.
Starting point is 01:06:06 And now I've got two. 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. Okay. And then I went to one half CV squared. And I got one half times one times a quarter.
Starting point is 01:06:21 Because V squared is a half. Or V squared. V is a half, and so I squared it and I got a quarter. So now I have an eighth. Right. In each capacitor, I have an eighth of a joule. So that if you add them together... I got a quarter of a joule. Which is not a half of a joule. Yeah. So I don't conserve energy. So that's not what happens. Well, what happened? Well, the problem is I can't have this circuit.
Starting point is 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? 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.
Starting point is 01:07:11 Well, that means that that wasn't what happened. No, it means it went to a loud trumpet sound. 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. Well, they're connected through a wire to the same voltage. This ideal wire, it's supposed to have the same voltage all the way across it. Where'd it go, Tom? Where'd it go?
Starting point is 01:07:37 So what it is is a paradox, right? And the problem with the paradox 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. 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. Another possibility is to put in some inductance and then the energy kind of slashes back and forth between the two of them
Starting point is 01:08:34 instead of dissipating. So it really doesn't get to a steady state, I don't think. And so that's another case where if in this case, if you don't include the parasitics, you actually get the wrong answer. 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? You just switch it the other way. It would magically make energy disappear. But I'm sure I can— Which is probably bad for the universe.
Starting point is 01:09:14 Yeah. So, maybe I could come up with another one that would be one of these free energy circuits, you know, where, um, where just because, you know, if I, I can't just, you know, go to some venture capitalists and say, you know, I really need to invent this, this ideal switch because then I'll have, you know, free energy or something. Um, it, you don't, it doesn't get to work that way. And partly it's, 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 over Q kind of a thing that happens when you're doing switching. Even in a mechanical switch, it's limited.
Starting point is 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. 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 could make that sound christopher was mentioning earlier so so that's why um yeah we need all of all of these things that that limit um you know the voltage rising and current flowing. And so everything,
Starting point is 01:10:46 you know, you have that expression, everything is a thermometer. Everything is a temperature sensor. Sometimes they measure other things. Yes. Yeah. Everything is also a resistor,
Starting point is 01:10:57 a capacitor and an inductor. Yes. And that's, that's good. Because if it wasn't,'t, nothing would work. I understand what you're saying about the math and how the simulation needs to work, but 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... Not lost. Energy is never lost.
Starting point is 01:11:26 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. 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. Yes. Okay. I mean, we're pretty lost.
Starting point is 01:11:57 And you can see it in the switch because if you take apart a switch, you see that little spot where the spark um goes you know every time you switch it and that's why um dc switches are have that problem worse actually because they they kind of the material plates from one contact into another usually uh and that's why you'll see a switch that's rated for like 10 amps AC or something and then the DC rating will be like 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 it's gonna it's it'll deposit it from one contact to another but the next time you turn the switch it on the average it it balances out because the material goes from one contact to another but the next time you turn the switch it on the average it it balances out because the material goes from one contact back and forth depending on what part of the
Starting point is 01:12:51 the cycle it got switched on but it's actually pretty violent inside that switch what happens and you can see it in like if you look in big power electronics and something, switches are a really big deal. Like for DC, they're great big things and they're kind of explodey when they switch. 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. Yeah, I think it needs those.
Starting point is 01:13:30 Well, you don't want to turn on a light switch if you smell gas in your kitchen. Yes, explosion-proof switches are a thing. Okay, okay. My brain is maybe getting full. Are there... We've covered the big three and transistors. Yeah, I think we covered basically all of modern electronics.
Starting point is 01:13:52 Okay. Well, yes. This is good. This is good. I learned a lot. 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?
Starting point is 01:14:07 Yes, I do. So, you know, just like every node in a circuit has something that limits the voltage or every wire has a current limit, people also have limits on how much they can do. And while people don't have good data sheets, that's up to you to figure out and figure out what your limits are.
Starting point is 01:14:32 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. Our guest has been Tom Anderson, engineer at Keysight Technologies. Thanks again, Tom. Thank you.
Starting point is 01:14:56 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. And now a quote to leave you with. This one's from Ray Charles. What is a soul? It's like electricity.
Starting point is 01:15:16 We don't really know what it is, but it's a force that can light a room.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.