Current Per Pin - Part 1
In this series of posts, we’re going to investigate how much current can be supplied by the I/O pins of our processors.
On our way to talking about the I/O pins we need to talk about some basic electronics. It’s stuff that we should know about, because embedded systems exist at the intersection of software and electronics.
We’ll start with an explanation of what current is and give you a feel for the amount of current that various things have. We’ll dip our toes into resistors and how resistance interacts with current. Then we’ll take a look at some typical processor capabilities, and finally some workarounds to avoid blowing up our processors.
Getting Current
What we call “current” is a measure of the rate of electron flow.
So we don’t offend all of the physicists in the room, we will use a billiard ball like, highly simplified model of electrons, and assume that they can flow along a wire, like balls in a pipe. The current would be the rate at which the electrons flow past an arbitrary point on the wire.
The unit of electric current flow is the ampere, or amp for short, and 1 ampere is defined as electric charge flowing at a rate of 1 coulomb per second. A coulomb is a quantity of electrons so, in more useful units, an ampere is defined as a flow of 6.24x10^18 electrons per second (6.24 quintillion for our American friends, or 6.24 trillion for our British friends).
Current Usage
A few years ago, when you could buy incandescent light bulbs, a 60 watt light bulb was a common size. 60 watts is the measure of this bulb’s power consumption, power being current multiplied by voltage. In our billiards ball model, voltage would be analogous to a force being applied, pushing the balls down the pipe.
Here in The Great White North, our wall socket power is provided at 120 volts, so these bulbs would glow white hot when a current of ½ amp was flowing through them.
½ amp x 120 volts = 60 watts
The incandescent light bulbs in your car are given 12 to 15 volts . An 1156 brake light bulb is rated at 27 watts, so each bulb will draw about 2 amps when lit.
Resistance to the Current Regime
Incandescent light bulbs are great, they are simply a piece of wire that gets really hot when you pass current through it. They keep it in a glass vial that has all of the air sucked out to keep it from oxidizing when it gets hot. But why does it get hot? The wire has resistance.
Resistance is the opposition to current flow. In our billiard ball model, resistance would be like having the balls scrape against the walls of the pipe as they get pushed along.
A hockey puck has a really high resistance to current flow. Electricity really has a hard time flowing through rubber. You’d need a lightning bolt to flow electricity through a hockey puck.
Metals, like copper and silver have really low resistance and will readily flow electricity.
In the middle are most of the other substances; water can have a pretty low resistance if you add salt; pickles, pretty low resistance due to the acids and salt; tungsten, conductive but about 3.33 times the resistance of copper. Basically, everything resists electrical flow, the question is only how much?
Since resistance gives an oppositional force to current flow, the force has to get dissipated some how, and it comes out as heat (and squealing noises in the case of pickles).
An incandescent light bulb’s tungsten wire has a really cool trick, it’s resistance increases as it gets hotter, so less current flows through a light bulb. Initially it will let current flow quite freely, but its resistance generates heat, reducing the flow, until it reaches a stable equilibrium, glowing white hot.
Experiment Experiment Experiment
I used a 100 watt incandescent bulb to take some measurements.
I screwed my bulb into an Ikea desk lamp. I plugged the lamp into something that we at CBF Systems call “The Killer Cord”, which is an extension cord with the hot (black) lead exposed so we can clip in a current measuring transformer. This transformer is calibrated to give one volt per amp and is plugged into my Tek oscilloscope.
Using my DMM, I measured the resistance of the filament on a bulb at room temperature to be 10.4 ohms. If maintained, this resistance would theoretically restrict the current to 11.5 amps. At 120 volts, 11.5 amps yields 1380 watts (ignoring the complexities of AC power).
However, this bulb is rated at 100 watts. Working backwards from 100 watts, the resistance should be 144 ohms, to get 0.83 amps. That is an order of magnitude difference on the resistance and two on the current consumption!
Our alternating current is 120 volt mains voltage and is a sine wave on the hot wire. It swings above and below 0 volts. At the zero volt crossing points, no current flows, and at the peaks, we have maximum current flow.
In this oscilloscope trace, the power to the lamp was turned on late in the negative portion of the wave. It spikes to 7 amps then reduces quite rapidly. I can’t be sure if this is simply a rapid increase in the resistance, the effect of the voltage reducing, or both.
In my testing I saw values up to 11.2 amps. These very high values are seen when the lamp is turned on when the voltage is at a peak. If the lamp is turned on when the voltage is at zero, the current spike on the next wave is minimal, about 2 amps.
Once the bulb is up to running temperature, the current wave has this form. Every half-wave pulse is visible and goes to a peak of 0.88 A positive and negative. This corresponds nicely to the expected current for a theoretical 100 watt bulb.
The oscilloscope shows that the current, being drawn by the light bulb, falls rapidly with each half-wave of electricity. Using ohm’s law, we can see that the resistance increases rapidly and eventually reaches an equilibrium at about 120 volts / 0.88 amps = 136 ohms, very close to the 144 ohms we calculated earlier.
This is just a rough demonstration to give you a feel for the amount of current that flows through a lightbulb and to show that it definitely isn’t constant.
Future Current Events
Next time, we'll discuss the current consumption of LEDs, how a British rebel leader gets it all wrong, and how to light up a processor for a satisfying smoke. Until then, Happy 150th Birthday Canada, Happy 241st USA, and to all of the Ukrainians out there go finish your taxes.
This post is part of a series. Please see the other posts here.
Music to work by: An internet radio station from Mexico City, crossfader.net