Introduction To Transistor Logic By Pneumatic Analogy

Zachary Booth Simpson, substituting for Prof. John Davis
University of Texas at Austin, College of Electrical Engineering
3 Sep 1999

(c)2002 ZBS. http://www.mine-control.com/zack
Please sign my guestbo0k if you find this work useful.

 

So youíre in Electronics I. Iíve been told that youíve completed Circuit Theory. You guys must be geniuses, I donít think I could have finished that class. OK, Letís see what you know.

Whatís this?

[DEMOSTRATE LARGE REAL CAPACITOR]

That ainít no capacitor, THATís a capacitor!

Thatís a schematic of a capacitor. Donít ever forget the difference! It isnít just a symbol, it is a simplification! Real capacitors have, what?, capacitance!

[WRITE CAPACITANCE 6800microF]

There, now it is a little better. But real capacitors have internal resistance too.

[WRITE 3x10-6 Ohms]

There, a little better still. But real capacitors have break-down voltages too.

[WRITE 250kV]

There, still better. But wait! This capacitor has weight, color, size, failure rates, cost, etc. There are innumerable properties of real devices that schematics fail to mention such as color, weight, cost, reliability, and, of course, how cute the distributor is who sells them! Spending your education playing with pictures of electronics is no way to learn anything. Youíve to play with the real thing!

[SHOW UNINFLATED BALLOON]

Whatís this? A balloon?

No, itís a capacitor!

Look, I can inflate it, disconnect it from the power source, and then walk around holding the charge. Later, I can open the valve and do some useful work with it.

[SQUEAL]

Like annoying students! Thatís a pretty good use of a capacitor if Iíve ever heard of it.

Now, hereís a funny thing. How many leads does this [REAL CAP] capacitor have? 2. OK, how many does the balloon have? One?

Two also!

Thereís pressure on the inside and thereís pressure on the outside. It is meaningless to talk about a one-sided balloon. It canít exist. The very nature of a capacitor is that it separates two different volumes of gas. So, in fact, there are two sides just like an electrical capacitor.

What is the pressure on the outside of the balloon right now?

Atmospheric pressure.

What if we take this into space? There would be no pressure on the outside, but there would still be two sides to the balloon. The balloonís job is to keep the two volumes of air isolated from each other regardless of what the pressure differential is. Of course, when I take it into space we will probably exceed its ability to do this job and the balloon will pop.

A balloonís second lead is permanently connected to atmospheric pressure.

Letís talk about balloons for a bit.

As I put pressure into the nozzle, air begins to flow into the balloon. This air has higher pressure and this causes the balloon to expand. The elasticity of the balloon starts to fight back. In fact, it starts to fight back more and more as I inflate it. Thereís some wonderful differential equation for this, Iím sure, but, not being a mathematician, I donít know what it is. It must look something like this though:

Whatís this diagram look like?

A lot like the charge characteristics of an RC circuit youíve learned about in circuit theory, no doubt.

Now, thatís interesting! Nature often provides symmetry in the oddest places! Whoíd of thunk that a balloon would behave so much like an electrical capacitor? I wonder how many more similarities we can find between electronics and pneumatics?

Letís see if we canít build some kind of pneumatic circuit. Weíll need a pressure source. Weíre always using batteries in electrical circuits.

What does a battery do?

Despite what many people think, they do not STORE electricity. They convert chemical energy into electrical energy, right?

Can we convert chemical energy directly into air pressure? Sure!

[MIX BAKING SODA (NaHCO3) IN BOTTLE WITH VINEGAR, PRESSURIZES BOTTLE]

Cool! A pneumatic battery!

But this isnít going to do too much useful work. Despite what that annoying pink rabbit claims, electrical batteries donít either! What if I want a whole lot of work? In electronics weíd get power from the wall which in turn gets power from a power generator plant. These facilities have giant generators which convert mechanical energy into vast quantities of electrical energy. Letís do the same pneumatically.

OK, hereís a schematic for an air pump. As the piston moves back and forth in the pipe, we can make it move a lot of air. Unfortunately, it will suck in as much as it blows out. Itís an AC alternator! But we want a DC power supply like a battery. Thatís easy enough, add valves to create a rectifier!

Now, thereís a couple of important properties of this pump. Thereís the maximum pressure that it can deliver which is related to how hard the piston can push on the air and the diameter of the piston, and thereís the maximum current that it can deliver which is related to how fast the piston spins as well as the internal resistance. These are REAL properties which will be very important to us when we try to do real work with it. But for now, weíll just work in the virtual for a little while longer.

Letís build a simple pneumatic circuit.

What will this do?

The pump will inflate the balloon until the pressure inside of the balloon equals the maximum pressure of the power supply.

Letís see if we canít improve our design here a little bit. Letís say we run a party store and want our employees (who are kind of slow and tend to waste a lot of time and money) to be able to inflate the balloons very quickly. Once the balloon goes onto the nipple and we turn the valve, we want a lot of pressure and flow very quickly. Once it is filled we will close the valve, take it off, tie a knot in it and attach another balloon. During this down time, the air pump can still be working! So, as long as the average current requirements over time, including the down time, is less than the maximum current possible out of the power supply, then we ought to be able to build this optimization.

 

Now, while our employee is fumbling around tying a knot, the power supply is dutifully filling this new extra balloon. When we get the next empty balloon onto the machine, our employee will be able to inflate it very quickly as this new balloon will deflate rapidly helping to fill our balloon.

Now we have a truly useful pneumatic power supply. In fact, this is exactly how real pneumatic power supplies work. But, instead of using a balloon, they use steel tanks since balloons have a nasty habit of exploding at pretty meager pressures. This is also, as Iím sure you know, how useful electrical power supplies are built too. Thereís a capacitor inline with the voltage source to deal with smoothing out the pulse fluctuations from the rectifier.

Ok, so letís create a symbol for our air compressor so we can draw it on the board more easily.

How about this. The vertical lines will represent the sides of the piston pushing against the air in the pipe. The short side will be the side facing into the pipe, and the long side will be the one that gets pushed by the flywheel.

Is that right?

No! It needs to have two leads because thereís air coming into the pump as well as out of it!

Of course thereís really a bunch of valves and stuff in here. Letís just draw the input line here even though we know it doesnít really connect to the back side of the piston. And, hell, we can probably just leave off the arrow too.

OK, now how about a symbol for the balloon. It should have a nice curve to it, donít you think? And thereís an input lead to it. How about this?

Is this right?

No! It needs to have two leads! One needs to represent the other side of the balloon, the outside!

OK, much better.

We need a symbol to represent connecting to atmosphere. How about something that sort of looks like air blowing out.

OK, now letís build a little pneumatic circuit with our schematic symbols.

Does the current ever flow through the balloon and out the back lead?

[INFLATE BALLOON AND DEMONSTRATE]

No! Current does not flow though a capacitor. It pushes against the outside pressure, it doesnít allow any flow though it. It seems sometimes that a capacitor is allowing current to flow through it because you see the current come off the back side. But nothing is going through the capacitor. In the case of a balloon, you are displacing air as the balloon inflates and if it was inside of a can or something you would notice it, but since it is in the atmosphere you donít notice. So, nothing goes though a capacitor; thatís obvious when you look at a balloon, but not so obvious when you look at an electrical capacitor!

But wait!

[POP BALLOON]

Yes! Sometimes air can flow from one side to the other. When a capacitor fails, it shorts! Real devices have real properties. Capacitors have maximum pressure limits past which they deform and will start to conduct! Balloons do so catastrophically as do most electrical capacitors.

OK, enough of that, you get the idea Ė pneumatics are an excellent analogy of electronics. The flow of electrons is surprisingly similar to the flow of air. This is because they are really both fluids. Air is the fluid of gas molecules slamming into one another trying to spread out. Electrons are the same thing, they are also bouncing around trying to get away from one another. This is why it is not so surprising that they behave so similarly. Now, like any analogy, it can be taken too far. You can not start talking about pneumatic inductance without creating a real contrivance. Thereís just some things that are different about electrons and canít be forced into a model.

But anyway, what I really came here to talk about today is transistors.

[SHOW REAL TRANSITOR]

Transistors are totally obscure and magical devices as far as Iím concerned. You canít see into them. When you cut them apart and look at them under a microscope they are even less interesting. Letís see if we canít build a mechanical analogy to a transistor so we can have a really good intuition of how they work. Iím sure I donít have to tell you all how important transistors are. I mean, youíd have to have been living in a hole for the last 50 years not to know how useful these little guys are. Iím sure I donít have to tell you how transistors can be used as amplifiers or as switches since youíre in EE at UT after all, so letís get straight to the point.

OK, Letís imagine that we stick a little piston inside a closed pipe with a spring.

When we blow on the open end, the pressure will push the piston against the spring. When we depressurize the left side, the spring will kick the piston back.

Remember, although the piston is barely moving, the volume inside of the pipe (to the left of the piston) is increasing as the piston moves back. As it increases, there must be air which flows in to fill that space creating a movement of air, a current. So, we can SAY that pressure is moving the piston but that is a massive over-simplification! Pressure, current, resistance, and capacitance are all at work here. So, you canít just say: "Oh pressure moves the piston!" That is wrong, but it is easier to think about.

OK, now letís hook up a little pipe across this one and then drill a hole.

Letís imagine that we connect the top pipe to the power supply. Clearly, in this configuration, air is going to come rushing out of the power supply, though this gap, and out to the atmosphere here.

What will happen if we blow on the input end?

The piston will move in and as it does, it will plug up the hole. So, with just a little bit of pressure and a little tiny bit of current and capacitance, we can switch on and off a much larger current.

Cool! We just built a transistor! The voltage on this side switches the current though this path.

But this is only one kind of transistor. In this case, when there IS pressure on the input, the flow STOPS. Can we build the opposite? We need something so that when there IS pressure, the flow STARTS.

How about this. We drill a hole through the piston and align it so that it plugs the hole until it is pushed further into the tube, aligning the outside holes with the channel though the piston.

Hereís a couple of better cross-section pictures

 

Letís make a schematic for all of this. How about something which sort of represents the piston like we did for the power supply piston. The vertical lines will represent the piston. The piston sits inside of a cylinder represented by two horizontal lines, and then thereís three pipes connecting into it.

Letís give some names to the different parts of this thing. We should choose really nerdly names that sound technical so that nobody but other engineers will understand what weíre talking about. This is a very important principle. I mean, if we were to make everything we do simple, then we wouldnít be paid as much, would we?! This is an important part of the Dilbert principle. Remember, the purpose of all technical vocabulary is to keep people OUT of the CLUB. So, again, letís choose really weird names for these things. How about: SOURCE & DRAIN for the top and bottom, and GATE for the input. Those are especially good because they sound simple and that means that inevitably some dumb-shit sales or marketing person will misuse them (buy the new drain-master 2000!) then weíll be able to roll our eyes and make fun of them!

We need to give names to these two different types of transistors. Letís arbitrarily call them positive and negative. Weíll call the first one positive because we can use a pneumonic of the three Pís: Positive Pressure Plugs the hole. Weíll call the other one negative since it is the opposite. To be extra obscure, weíll call the positive one "P" and the negative one "N" just in case the salesmen start to catch on.

Oh, but we need to label the two types of transistors on the schematic. Letís put a little round dot on the P transistor to represent the fact that normally the channel hole is open. Remember, Positive Pressure Plugs the hole.

[SHOW REAL IMPLEMENTATION OF N GATE BUILT FROM PVC PIPE; STUDENT PARTICIPATION OPERATING IT.]

Hereís a real implementation using PVC pipes, tubes, and tape. Note that it works, but that when you blow into it, it leaks like a sieve. This is because as I blow, some of the air flows around the piston and out the source and drain. When you blow into the source, some flows out the drain and gate! Remember that real devices have real problems. There are similar problems on semiconductors! You are going to be dealing with REAL problems like this your whole career. This is what will make you highly paid engineers and not a bunch of whoosy and underpaid mathematicians!


Top and side view of functioning pnumatic transistor built from lucite

Get a million of these and you will have a pneumatic Pentium! Of course it will be gigantic and run at about 1 Hz, but nevertheless, it could be done.

OK, letís get to the cool stuff. Letís build a computer!

Are you skeptical that we can build a computer out of pneumatic parts?

Turns out that you only need two things to build a computer. One is called a "NOT gate" and the other one is called an "AND gate." This amazing fact was proven by George Boole in the mid 19th century! For those that donít know already, hereís how these gate work.

Let high pressure represent the number 1.

Let low pressure represent the number 0.

NOT

IN

OUT

0

1

1

0

AND

IN A

IN B

OUT

0

0

0

0

1

0

1

0

0

1

1

1

Thatís it. If you can build these two devices, you can build a computer. This fact never ceases to amaze me. Everything useful that can be done with a computer from downloading porn to playing Doom is nothing but NOTís and ANDís. That is just impossible to believe but is nevertheless true!

Letís try to build a "NOT gate". This is also called an "inverter" just to be technical sounding as Iíve already pointed out. Remember, we defined the number one to be high PRESSURE, not flow! In other words, we care about voltage, not current when we look at the logical operation of this thing.

Now, the point of this whole thing is that we want to connect a bunch of these logic gates together in long strings to do something useful (like download porn off the internet!). Remember that each transistor has a little bit of capacitance on the input, so when a gate switches, it has to fill all of the capacitances of the downstream gates. So, to simplify, we will represent all of the downstream gates with a single capacitor.

OK, when the input pressure is low the P transistor will allow air to flow from the power supply though the P channel and into the balloon. So, when the input is low, the output is high. So far, so good. Now, notice carefully here that the current will stop flowing once the balloon is full. But, even though the current is no longer flowing, we still have high pressure inside of the balloon and we defined the number one to be represented by high pressure, not current, so everythingís OK with this.

Now, what if we drive the input high by blowing into it? The P transistor will plug up and air will stop flowing into the balloon.

But! The air that is already inside of the balloon has nowhere to go, so it will just sit there, still inflated. So, high pressure on the input is still giving us high pressure on the output! This is WRONG! WRONG! WRONG!

We need a way of draining the air out of the balloon when the input goes high.

OK, easy enough. Letís just add another transistor.

OK, now when the input is high, the N transistor will open up. Any pressure inside of the balloon will force air to come rushing out though the N transistor to atmosphere.

So, when the input is LOW, the balloon is connected to the power supply and will thus be driven HIGH.

When the input is HIGH, the balloon is disconnected from the power supply and connected to atmosphere and will thus be pulled LOW.

Now, what weíve got here is a sort of mirror symmetry. On the top there is a P transistor whose job is to charge the output. On the bottom there is an N transistor whose job it is to discharge the output. Mirrored devices like this are often called: "complementary" for the nerdly reasons that Iíve keep talking about. In fact, this is what the ĎCí stands for in ĎCMOSí ("Complementary Metal Oxide Semiconductors") the electrical semiconductor technology that "real" computer are built from.


Functioning Pnumatic Inverter
P transistor on left, N on right
Valves at bottom are used to switch the input

Now we just need an AND gate to fulfill Booleís thesis. Turns out that it is hard to build an AND gate so instead weíll build the opposite: a NAND gate which is just an AND gate with a NOT stuck on it. We can turn this into an AND gate by just sticking yet another NOT on it since two negatives make a positive.

NAND

A

B

OUT

0

0

1

0

1

1

1

0

1

1

1

0

Note that again, there is a P side and an N side, (Iíve circled each one to make it clear). The P side charges and the N side discharges. Also notice how the two sides are logically opposite. The top has the two transistors in parallel so that current can flow through one or the other of them and the bottom is in series so that the current has to flow through both of them.

Thatís it. Now you know how transistors work. Turns out they arenít so complicated after all!