Resistor-and-diode voltage references

January 28, 2013 12:00:15 PM CST

aka: Why I spent all that time explaining diodes:

One of the challenges in electronics is finding a reference value.. either current or voltage.

The most accurate components we have are resistors, but resistors are proportional devices. They can give you excellent ratios, but "50% of the input voltage, plus or minus .1%" still depends on the input voltage. The same is true for capacitors and inductors.. and the tolerances for those are usually worse.

Transistor circuits can deliver amazing precision, but getting that kind of precision usually requires a reference voltage (or current), and that turns the problem into an "Open crate with enclosed crowbar" kind of thing.

Diodes are our references.

The gap between the valence and conduction bands is a physical property of silicon. Vt changes with temperature, but you can build circuits where the thermal effects in one part cancel the thermal effects in another. The result is a circuit whose output depends on nothing but the difference in band energies, and is called a 'bandgap reference' for obvious reasons.

A high-precision bandgap reference is a subtle and complex beast, but even a 'bad' one will give you a reference point suitable for everyday use.

Before we talk about that though, let's look at something even simpler:

Not a bandgap reference (but still not bad):

If you're willing to accept 'reasonably close', you can build a reference point from just a resistor and a diode:

a resistor and a diode

That arrangement doesn't have enough pieces to be a bandgap reference (you need at least two diodes). Instead, it balances the diode's exponential voltage-to-current behavior against the resistor's linear current-to-voltage behavior.

The equations look like so:

diode voltage versus resistor 
voltage

As you recall, Vt is about 26mV at room temperature, and 1v / .026v =~ 39. The reverse saturation current (Is) is usually about 10^-13, so the formula for voltage across the resistor reduces to:

  • Vr = (Re^39Vf) / 10^13

In other words, the resistor voltage moves exponentially faster than the diode voltage. If Vcc changes, the resistor will absorb almost all of the change. As a result, Vf stays more or less constant.

As always, let's crunch some numbers:

To demonstrate that, let's start with the worst conditions reasonably possible and see how the circuit behaves:

Let's set Vcc to 1.2v (a single NiCad or a hearing-aid battery) and add 25% of ripple (Vcc swings between 1.2v and .9v). If you expose a circuit to those conditions you aren't even pretending to care about precision, but let's see what happens anyway.

We'll start by assuming Vf is a constant .6v. That means the resistor voltage swings between .6v and .3v. That puts the low-end current at half the high-end current, and the table at the end of the last article tells us that doubling the current through a diode changes Vf by 18mV.

.018v / .6v = .03, which means Vf only changes by 3%.

A more realistic scenario would limit the ripple to 10% (Vcc swings between 1.2v and 1.08v). That means the resistor swings between .6v and .48v, and .6v / .48v = 1.25, so the maximum current is about 25% higher than the minimum current.

A little guesstimation based on rules from the table says Vf will change by about 6mV, which is only a 1% change.

If we take Vcc up to 5v and still keep the 10% ripple, Vcc will swing between 5v and 4.5v. The resistor voltage will swing between 4.4v and 3.9v, and 4.4v / 3.9v =~ 1.13, so now the maximum current is only about 13% larger than the minimum current. That only changes Vf by about 3mV, or .5%.

Summing up:

It isn't perfect, but isn't bad, and it's hard to get much simpler.

So why not use Zener diodes?

I touched briefly on Zener diodes earlier, when talking about reverse bias, and when most people think 'voltage reference' they think 'Zener'.

Thing is, Zeners aren't really that accurate. If you read the datasheets, you'll see something like "rated to be within 5% of nominal voltage at some specified current," and the current in question is usually somewhere around 5mA.. kind of power-hungry for today's circuits.

If you look at the current-to-voltage curve for an actual Zener diode, you'll see something like this:

I-V curve for a Zener diode

Yes, the reverse breakdown voltage is exponential, but it doesn't change as sharply as the forward voltage.

The big advantage Zener diodes offer is convenience. If you want a 5v reference, you plug in a 5v Zener. If you want 12v, you plug in a 12v Zener.

The wide range of Zener voltages was a great deal when circuits were designed to run from +/-15v supply rails, and 5mA was nothing compared to the 100-300mA necessary to run the heater in a vacuum tube.

Even now, the best voltage references use Zener diodes, but they have laser-trimmed resistors feeding them exactly the right amount of current, and have to be tuned one by one at the factory. The results are fantastic, but you pay for them. I just bought a batch of voltage references for my own use. The ones that are accurate to 1% cost 60c each, the ones rated for .1% accuracy cost $1.60 each, and I was thrilled to find them. The really good parts I'd been looking at previously went for $6-13 each.

For lesser accuracy, Vf from a simple diode is a lot cheaper (2c, including the resistor), .6v will probably be a large enough fraction of the supply voltage to be useful, and you can get tolerably good results from a lot less than 5mA of current.

Besides, we have more flavors of Vf these days..

LEDs are diodes too:

'LED' is the acronym for Light Emitting Diode. LEDs work exactly the same way silicon diodes do, but they use materials whose bandgap is more than .6v. When electrons drop from the conduction band to the valence band, the photons they emit have enough energy to reach the visible light spectrum.

The color of the light depends on the energy necessary to cross the bandgap, which also determines the forward voltage. If you know the type of semiconductor and the color, you can make a reasonable guess of its forward voltage:

  • Red LEDs have a Vf between 1.6v and 2v
  • Orange LEDs have a Vf between 2v and 2.1v
  • Yellow LEDs have a Vf between 2.1v and 2.2v
  • Green LEDs have a Vf between 2.2v and 3v
  • Blue LEDs have a Vf between 3v and 3.5v

There are several different materials you can use to make LEDs, and there are wide bands of light frequencies that humans see as 'red' or 'green', so it's hard to predict the exact forward voltage for any specific LED. I wouldn't suggest trying to use LEDs if you want a specific voltage.

So what good are they?

Well, consider this circuit:

an LED biasing a diode-resistor 
reference

If the supply voltage changes, most of that change will show up across R1. The voltage across R2 and D1 will be the same as the voltage across LED1, which will be reasonably stable. Most of the change that occurs in the R2-D1 branch will appear across R2, so the voltage across D1 will stay more or less constant.

To calibrate that, remember that a 1mV change in the the voltage across D1 corresponds to a 4% change in the current going through it. If the nominal voltage across R2 is 1v, a 4% change would be 40mV. LED1 is also a diode though, so changing the voltage there by 40mV would change the current through LED1 by a factor of 5.

So.. as long as the change in supply voltage is less than 80% of the voltage across R1, the voltage at D1 will remain stable to within less than 1mV.

Let's flip that around:

If we swap D1 and R2, nothing really changes. The voltage at the point between them moves from 'the diode voltage' to 'the LED voltage minus the diode voltage', but that's just a matter of bookkeeping.

diode on top

If the supply voltage is even generally stable, the voltage across R2 will be even more stable. The wide tolerances on LED forward voltages mean we still can't say exactly what value the voltage across R2 will be, but whatever it is, it will be nearly constant.

If the voltage across a resistor is constant, the current through it will also be constant.

If there was some way to take the constant current through R2 and move it to some other part of the circuit, we'd have something useful.

Enter the transistor:

A bipolar junction transistor is basically a diode that leaks.

Actually, it's two diodes that point opposite directions, but share a depletion zone. The base terminal connects to the shared depletion zone, the collector and emitter connect to the bulk semiconductor at the far end of the diodes. For convenience, I'll call them the BE (base to emitter) diode and the BC (base to collector) diode.

To make a BJT work, you forward bias the BE diode and reverse-bias the BC diode.

Under those conditions, carriers diffuse from the emitter into the depletion zone, just like any other diode. Some of the carriers get caught in the BC diode's drift current though. Those get swept out of the depletion zone and into the collector before they can reach the base.

The upshot is that carriers go from the emitter to the collector according to diode mechanics, controlled by what happens at the base.

When I said 'some' of the carriers entering the depletion zone pass through to the collector, it was a bit of an understatement.. for most transistors, 'some' means 'more than 99%'. Only a small percentage of the carriers that flow through the emitter make it to the base.

If we replace D1 with a bipolar transistor:

a current source

More than 99% of the current that flows through R2 comes through the transistor's collector. If the current through R2 is constant, the transistor draws constant current from some other part of the circuit.

Plugging the leak:

There's another neat trick you can play with transistors though. If we short the collector to the base, we get a nearly perfect diode:

diode-connected transistor

Most diodes aren't built to be precision devices. They're just used as one-way valves for current. Transistors have to meet a wider range of stricter performance specs, so they're built more carefully.

In particular, people like to see good matching between the forward voltages from one transistor to another (at least for transistors in the same family) so the voltage-to-current performance is much more predictable.

That comes in handy when you want to bias another transistor.

This post has already taken longer to write than I like though, so I'll move that discussion to another page.

Random brain cookies:

You know you have a small apartment when Rice Krispies echo. -- S. Rickly Christian