Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Poor man's voltage reference?

Status
Not open for further replies.

kpatz

New Member
For a project I'm working on I could use a voltage reference, of around 1.5-2 volts, maybe a tad less, the exact voltage isn't as important as that the voltage stays relatively stable even if the supply voltage or temperature changes.

The circuit has a 78L05 to power a PIC and I'm using a voltage divider to create the reference voltage from the Vdd. This works fine, as long as Vdd stays constant. But if Vdd changes, say due to a weak battery or because I'm testing and powering the circuit with my Pickit 2, my reference voltage changes as well, which throws off my A/D conversion accuracy.

I know that there are voltage reference ICs I can use. And there's zener diodes. Unfortunately, the only zeners I have are 5.1V, and RadioShack doesn't sell any lower-voltage zeners. They don't sell reference ICs either. I don't really want to order online just for one part (my wife's getting tired of all the packages from Mouser as it is).

So, excluding dedicated IC references and zener diodes, how can I create a reference voltage using run of the mill parts that is reasonably stable? Maybe using the voltage drop of a silicon diode? I measured some of my diodes and the drop seems to vary from one to the next, from 0.55 to 0.65 volts typical. Plus, I don't know how stable the voltage drop of a given diode is. If it varies too much once the firmware is calibrated, it can throw off my readings.

Any other suggestions?
 
Maybe using the voltage drop of a silicon diode? I measured some of my diodes and the drop seems to vary from one to the next, from 0.55 to 0.65 volts typical. Plus, I don't know how stable the voltage drop of a given diode is. If it varies too much once the firmware is calibrated, it can throw off my readings.

Any other suggestions?

A silicon diode changes at a rate of approx 2mV/Cdeg change in temperature, they are often used in temperature controllers.!!:)

Which PIC are you using and any special reason for not using the PIC's Vsupply as the internal Vref.?

You could consider using a button cell.
 
Last edited:
I'm using a PIC16F818. I'm running Vdd at 5V (circuit powered w/a 9V battery through a 78L05 regulator) and I need a lower Vref for one of my A/D conversions. Also, by having a Vref that doesn't change if Vdd drops, I can detect when the battery gets low by measuring the Vref relative to Vdd.

I figured a silicon diode wouldn't cut it. It's funny, the function I need the Vref for is for measuring temperature! I'm using a MCP9700 sensor IC. I'm using a lower Vref so I can get 0.1-degree accuracy from the A/D.

It's not super critical, since the 78L05 is pretty stable and I get decent accuracy with a voltage divider coming off Vdd that way. But when I use the PICkit 2 to power the circuit while developing the software, the Vdd is a bit lower, causing my temperature readings to be high.

I'll have to snag some reference ICs next time I do place an order, but in the meantime I just thought someone would know of a run of the mill part (e.g. diode, transistor junction, JFET circuit or something) that could provide a reasonably stable reference voltage without having to order something online and wait for shipping.

LM317 is a possibility, though I don't really want to put a bulky TO-220 part on the board just to use as a reference. :)
 
Last edited:
I don't have any old TVs or VCRs... ;)

Would an old busted PC PSU have one?
 
Last edited:
But RadioShack doesn't carry the TO-92 version of the LM317. I'm trying to avoid placing an online order if I can do it with parts I have kicking around.
 
Hi,


There is a PIC with a voltage reference built in, but i dont know how good
it is. You could look this up if you want, but again it may mean buying more
parts anyway.

It is very difficult to make a voltage reference without a voltage reference
diode because everything varies with temperature. The only way around
this really is to make an oven and control the temperature inside. The
temperature is kept higher than any possible ambient that would be encountered,
and that means the devices inside the box do not change as the surrounding
temperature changes.
To do this you would need to design a temperature controller, and that needs
a reference too. The reference for this would come from the reference inside
the box, although the slope of the error voltage for the temperature has to
be made greater than the slope of the change of error voltage for the reference
itself in order for this to work.
It's not that hard to make a small oven for something like three or four (or more)
si diodes in series, but it will take some work. A small cardboard box with some
insulation, a small light bulb inside to act as the heater, a small circuit with
an op amp and driver and thermistor to regulate temperature. If this runs from
battery power however it will use up some of the battery energy.
There is another way using discrete transistors, but it's a bit much too.
 
Last edited:
Hi,

A lot of them have the reference device built right into the controller chip
these days...maybe from an older power supply?
 
Dang... I thought it would be simpler than that.

Oh well, I can live without the reference for now. It just means my temperature display is inaccurate if Vdd is off, but that only happens when I power it with the Pickit 2. It could also happen if the battery gets too low for the regulator to maintain 5V. With a reference I could detect this and display a low-battery warning.

Oh well, my next Mouser order will include some reference voltage ICs. And some lower-voltage zeners. ;) It's like, my circuit runs on 5V and all my zeners are higher than that. ;)

Of course, I've thought of some exotic solutions, such as a charge pump + zener + voltage divider, or using the MPC9700 to calibrate a silicon diode reference (sort of a catch-22 there, if I need the reference to get an accurate voltage reading to make the adjustment!) One idea I had was to read the 9700 using Vdd as a reference, then using that value to calibrate for the diode reference. That would work unless the battery gets low and Vdd ends up off kilter. At this point it's easier to just order reference ICs online and deal with the wrath of the wife when it arrives.
 
Last edited:
Low voltage zeners have poor temperature stability. The most stable zener is 5.6V.
You could use another 78L05, running off your batteries, but it would still suffer when your batteries get low.
 
Last edited:
I think for now I'll live without the reference, and just make sure I don't let the battery get too drained. :)

Another idea I had is to use a voltage divider to measure the battery voltage directly and display a low-battery warning before it gets low enough to sag Vdd. That doesn't solve the Pickit 2 issue (not that it's a major issue, just for testing). It also means tying up another I/O pin which I can't spare, or switching to a PIC with more pins.

Dang... I just thought of something... my whole issue is that the MCP9700 sensor has an internal reference voltage so that it always outputs X volts for Y degrees of temperature. Of course, I can't access that reference, so I need another reference so that my readings are accurate.

But... someone said that silicon diodes have a pretty linear temperature response in its voltage drop. I could use that as my temp sensor, foregoing the 9700 entirely, and then by using Vdd as my A/D reference and the source power for the diode, the circuit would be self-referencing. Hmm... I might have to experiment with that.
 
Last edited:
Diodes do not have linear V-I curves, so they will not linearly track the bias voltage source (for self-referencing). They have a TC of ≈-2mV/deg C, but their forward voltage and exact TC varies from type to type and unit to unit within a type, and also with current. This means you would need to calibrate them with at least two temperature reference points.
 
But RadioShack doesn't carry the TO-92 version of the LM317. I'm trying to avoid placing an online order if I can do it with parts I have kicking around.

Use a resistive divider off the 5.1V zener to any voltage you want an put a cheap buffer on it using any cheap op-amp.
 
But... someone said that silicon diodes have a pretty linear temperature response in its voltage drop. I could use that as my temp sensor,

use an diode like a 1N914, put maybe 1mA through it. Dip it in boiling water and get the voltage at 100C. Let it cool, then do it with ice water for the 0C reading. You now have a calibrated temp sensor.
 
Hi again,


Some of the other posts reminded me of another way :)

Use a few diodes in series as a voltage reference (maybe >2.5v).
Use a thermistor and measure the temperature using the diode voltage reference
even though it will be off.
Using both measurements, calculate the real voltage of the diode and
include that in whatever actual measurements you have to make.

To calibrate this scheme, run the diode and thermistor at room temperature,
measure the voltage and the thermistor and record. Turn up the temperature
by 10 degrees C and measure both again and record. You may have to
do a third time if you need better accuracy.

What will happen is the diode voltage will change and so will the thermistor,
with the diode reacting to temperature mostly and the thermistor will vary
both because of temperature AND voltage so it should be possible to calculate
the true voltage on the diode knowing these two pieces of information because
for any given temperature the thermistor will still read the same resistance,
just a different divider voltage than when the source voltage is constant. In effect,
it will be like a thermistor squared :)
If you need help with the equations just yell.

It is also possible with this scheme to allow the reference voltage to vary widely,
and measure the voltage of a single diode, then do the calculation for what
the reference voltage is based on the measured voltage of the diode and of
the thermistor (in a voltage divider circuit).

It was also common practice a long while back to temperature compensate a circuit
with a thermistor. In this way it may be possible to compensate the diode(s) with
a thermistor, but it's not that easy to do.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top