5.12V reference question

Thread Starter

tracecom

Joined Apr 16, 2010
3,944
Is there any problem using a 5.12V reference with a PIC that is running on less than 5.12V, 4.5V or 4.9V, e.g.?

Thanks.
 

Thread Starter

tracecom

Joined Apr 16, 2010
3,944
Thanks.

I snagged a circuit off the web, made a couple of mods, and built it; the schematic is attached. Using a 10 turn pot for R2, I can adjust Vout to either 4.096V or 5.12V.

However, I don't really know if the R values are optimum. In addition, R1 gets hot, so I need to either increase the resistance or the wattage.

What changes do I need to make?

And is C1 needed, and is it just a .1uF?
 

Attachments

Last edited:

bertus

Joined Apr 5, 2008
22,278
Hello,

R2 and R3 are rather low valued.
Looking at the datasheet R3 is between 5K and 10K.
R2 would be 10K or 20K in your case.

How much current is needed from this reference.
For good regulation the TL needs 0.5 mA itself.
You have a total current of about 15 mA now.

Bertus
 

John P

Joined Oct 14, 2008
2,026
Right, no pin of a processor should ever exceed the power supply voltage. But you could run the processor on 5.12 Volts and use the power supply as reference, which would save a pin. Is that an idea worth pursuing?
 

Thread Starter

tracecom

Joined Apr 16, 2010
3,944
Thanks for all the input. The processor that I plan to use is the 16F88, and I need to stick with a LM7805 or LM78L05 regulator, which will be very close to 5.0V. However, I looked at the 16F88 datasheet, and it seems to say that the minimum reference voltage is 2.0V and the maximum is Vdd + 0.3V, so I should be okay at 5.12Vref.

Thanks again.
 

THE_RB

Joined Feb 11, 2008
5,438
Another option is to just use the Vdd as the Vref, and measure it with a multimeter. Once you know what the Vdd voltage is you can just do the ADC correction in the software.
 

John P

Joined Oct 14, 2008
2,026
I was wrong earlier: it should be OK to apply more voltage to a processor pin than the power supply, provided that the input protection diode doesn't conduct, which would be at about half a volt of difference. Even if applying that voltage to the chip doesn't damage anything, I'd be interested in hearing whether an analog input works throughout the reference range, particularly the part above 5.0V. But most of the time, probably it doesn't need to--the aim would be to get a nice relationship between input voltage and A/D counts. With a 5.12V reference and a 10-bit A/D, that's exactly 5mV per count. Yes, you could do some math and use a 5V reference, but I imagine there would be some quantization errors.
 

RamaD

Joined Dec 4, 2009
328
TL431 stability is with a load cap of <5nF or >5uF approximately. Varies with Ika and Vka, but the above range covers the forbidden region. 10uF low esr or tantalum is my preference.
For R2, 5.1K is preferable, so that while adjusting the voltage does not go above 5.3V.
 

THE_RB

Joined Feb 11, 2008
5,438
(re my suggestion); ... Yes, you could do some math and use a 5V reference, but I imagine there would be some quantization errors.
Sure but it's probably not as bad as it first sounds. Generally the ADC value is used for some real world task, and has to go through a scaling math procedure anyway (like; result = ADC *X /Y) which itself produces quantising errors. So in that case you can just include the calibration value as part of that scaling procedure.

If more accurate ADC is required it is generally a good idea to add together a lot of ADC samples, which gives a much higher data resolution so that increases accuracy, reduces the effect of HF noise and greatly reduces any quantisation errors caused by later scaling and/or calibration.
 

#12

Joined Nov 30, 2010
18,224
Your mistake was assuming the first circuit was set up for something besides the maximum survivable current for the TL431. You don't need 150 ma for a reference voltage. Thus, you trimmed it down to 26 ma. I suspect that is still way more current than your 16F88 chip needs for a reference voltage.

Page 188 of the PIC 16F88 dtatsheet: Vref input current = 150 ua
Using my usual standards for a precision reference, 100 x 150 ua = 15ma
On a lesser quality job, 10X would be sufficient.
The TL431 probably contributes a lot to the stability of your reference voltage.
I don't know enough about PICs to say whether you could get excellent results with less current than 15 ma in your reference circuit. That would be a good topic for a new thread. How much TL431 shunt current is really necessary for x% precision on a PIC ADC reference pin?
 

Attachments

Last edited:

MikeML

Joined Oct 2, 2009
5,444
...
Page 188 of the PIC 16F88 dtatsheet: Vref input current = 150 ua
Using my usual standards for a precision reference, 100 x 150 ua = 15ma
On a lesser quality job, 10X would be sufficient.
...
Why would you need 100X or even 10X? Just hang a bypass (energy storage) capacitor between the TL431 output and the reference input. If the Ref input pin draws a transient current larger than 150uA, it can come out of the capacitor. If you are worried about ESR in the capacitor, hang a low esr, low inductance disc ceramic across the larger capacitor...
 

RamaD

Joined Dec 4, 2009
328
Why would you need 100X or even 10X? Just hang a bypass (energy storage) capacitor between the TL431 output and the reference input. If the Ref input pin draws a transient current larger than 150uA, it can come out of the capacitor. If you are worried about ESR in the capacitor, hang a low esr, low inductance disc ceramic across the larger capacitor...
I agree with you fully on providing current just marginally higher than what is required, and not way higher than what is required.
TL431 is a shunt regulator, and requires atleast 0.6mA through the cathode for regulation. The resistor divider would require 0.5mA. And then the load current of 160uA. All this at lowest Vin. With all the margins, couple of mA should be ok. So, a 3.3K instead of 470 Ohms!
BTW, the point I was mentioning about R2, is that, if the wiper is moved so that the resistance is 10K, output voltage could go to above 7.5V, which could damage the microcontroller. That is why I suggested 5.1K.
 

#12

Joined Nov 30, 2010
18,224
Good job!
Some people that know responded to my idea.:)

(That 10X and 100X stuff came from the old days of simple resistive dividers.)
I remembered where that came from. In this circuit, the TL431 is improperly used and the resistive divider on the right should carry a lot more current than the load in order that it doesn't change much when the load, as seen on the datasheet, changes from 50ua to 150ua.
 

Attachments

Last edited:
Top