Paganini wrote:
Osric wrote:
Like a lot of folks, as a teenager I thought of electricity like “water in a pipe”. But I think this analogy is fundamentally unhelpful because when you apply pressure (“voltage”) at one end of the pipe it is easiest to think of it as instantaneously appearing at the other end of the pipe (assuming the pipe is full of water). Perhaps if I had thought of it as “empty pipes” that would have been a better mental model.
That's also how I learned the basics in 4H club. I also think it's a bad analogy. Water runs downhill. The explanations and illustrative diagrams always confused me because I couldn't figure out how gravity fit into the picture. Nowadays I think of it as *air pressure.* This is not necessarily better, I guess, but at least it makes sense to me!
I guess if you want to think of electrical potential like gravity, it’s maybe worth looking at as a function of position. I think
https://www.youtube.com/watch?v=j3GrOKre__0 does a good job of advocating this point of view.
Paganini wrote:
One thing that might help, maybe, is to notice that there is not really any such thing as a "signal" moving in the wires. The idea of "signal" is an abstraction that lets us think about logic instead of electrons. Similarly, "voltage" is not a thing that moves around. Voltage is a measurement taken by us, the observers, that describes the relationship between two points in a circuit.
I guess we have different definitions or we disagree on both of these points. To me a “signal” has a clear definition as the measure of voltage or current over time. You can see a signal on your oscilloscope; you can “amplify” it with a transistor; you can send it through space with an antenna. The bits we send from a CPU to a RAM component are signals; in digital we exclusively concern ourselves with “logic signals” and try to define when the signal has to be read to make our imaginary clean world of 1s and 0s, but signals are not an abstraction, they are the underlying voltage levels and they are messy when things aren’t working. Similarly, “voltage” is a measurement of a signal value at a particular point in time between two particular locations; it’s what we plot on our oscilloscopes. And it
does take time to move around, because we are essentially measuring the force being applied by an electric field and the electric field builds up in the wires and in the space between them wires at something approaching the speed of light - so it’s moving, albeit very, very quickly. For steady state circuits we can pretend it’s everywhere like you describe but for fast transient circuits — like our computers running GHz speed — we can’t.
Paganini wrote:
What we are measuring, specifically, is the number of free electrons (or "electron holes" that free electrons could move into).
If you take this view, why don’t the electrons from the positive terminal of a battery flow into the negative terminal if I connect two batteries but don’t close the circuit? If there are “holes” in the negative terminal, and “free electrons” in the positive terminal, they should flow without a circuit…as indeed they do when you charge a comb on your hair and then touch it to a neutral object which is first attracted to the static and later repelled when the charge equalizes. But connecting two batteries in series does not ruin them.
Paganini wrote:
In the classical model, because Ben Franklin was a bit of a goober, the point that has more "electron holes" is positively charged, while the point that has more free electrons is negatively charged. If you connect the two points with a conductor, the free electrons will move from the negative point to fill in the holes at the positive point. Classical current is the movement of the "electron holes" in a conductor, but what is really happening is that electrons are zipping around in the *opposite direction.*
I think that’s a bit unfair to Franklin, who was 100 years ahead of electron theory and had to make some arbitrary choices about which particles moved and which were stationary. What’s a bit more surprising to me is that he had the notion that charge moved only in one direction (which I’m not sure is strictly true if we think about ions in solution subjected to a potential).
Paganini wrote:
Ideally, all points in a circuit that are electrically common have the same voltage (0V) when compared to each other. In reality, though, electrons move very quickly, but *not instantaneously.*
Actually I think it’s clearer to say that electromagnetic fields propagate quickly. The electrons themselves cause this propagation of the field by moving tiny distances; they do not “zip around” the circuit.
Paganini wrote:
So, it takes the tiniest bit of time for the battery to "suck" the electrons out of the circuit and charge up points B and C. How long this is depends on how big the wire is, what it's made of, and what else is going on around it.
In fact, the thing that matters is the distance between the point where the voltage is applied and the point where you’re interested in seeing if the electrons are moving, and what kind of dielectric fills that space. The wires dominate in channeling the fields to the destination, but there could be short cuts that don’t involve the wires and are problematic.
Paganini wrote:
But more importantly, to change the voltage at the 6502's clock input pin some electrons must move. Those electrons come from somewhere! Where? The answer is ground.
Eventualy the answer is ground. But initially, the electrons that are already there can just move around slightly to create the electric potential. This will happen whether there is a circuit or not, I believe.
Paganini wrote:
The ground side of a circuit is like a free electron reservoir. If some electrons go out from the clock input of the 6502 into the clock output of the oscillator, then the same amount of electrons must also go into the 6502 through its ground pin. This means that, temporarily, the 6502's local ground pin is slightly more positive than the rest of the ground side of the circuit. Meanwhile, the oscillator has a few extra free electrons that it just received from the 6502. It has to send those electrons back to the 6502 so that the free electron reservoir can settle down. If you don't suck, you can't blow.
This is the signal return path. Unfortunately (in some ways) for us, electrons like to take the path of least resistance. If the loop back between the ground pins of the oscillator and 6502 is long or windy those electrons will try to find some other way to go, which can include through other ICs that might happen to be in the way. Havoc may ensue.
I think the return path is via the path of least inductance but I have a weak understanding of this point. I also don’t think it is the circulation of current that causes the ground levels not to match. Are you sure you are correct in your explanation?
Paganini wrote:
Moreover, as the oscillator switches voltage at its output pin and the 6502 follows almost (but not quite) instantaneously at its input pin, tiny amounts of current will be constantly flowing back and forth between those two pins, and also between the two ground pins of those ICs. Even though our (logic) signal is (abstractly) traveling in one direction (from oscillator to 6502), we are actually dealing with alternating current! We potentially have to think about capacitance, inductance, impedance and all kinds of complicated math. Because of electromagnetic fields we might experience intermittent glitches on a signal caused by complex relationships between switching patterns of *other signals.* This is why Ed keeps talking about rules of thumb. To debug these sorts of problems you need (often very expensive) equipment, and a real command of electronics math. This is something that most hobbyists (including me!) would rather avoid.
Finally, I guess it's worth pointing out that even the classical model is not "what's really going on." As Ed says, you can go all the way down to quantum mechanics, where electrons are not "things" that "move" but are more like ripples in fields. Every model is a description in some sort of language, more or less precise, of what we observe. There is no "what's really going on" that we can access independently from our perceptions. At some point you have to stop looking for the next turtle down and start building computers.
I think for my purposes getting as far as “electrons are tiny magnets that create electric and magnetic fields” will be sufficiently low-level in the stack of turtles, with possibly a tiny splash of relativity to understand how the charges create magnetic forces. I’m OK with doing the math to understand it at this level; but I don’t need to fully grok the new model as long as my partially constructed model can explain the problems I’m having at any given time. Because at the end, I do agree with you: at some point, I want to be building things, not studying