News:

;) This forum is the property of Proton software developers

Main Menu

Reference voltages.

Started by david, Sep 20, 2023, 11:21 AM

Previous topic - Next topic

david

What are people using to provide a reference voltage for applications like low battery sensing?  I know many PICs have built-in references but the tolerance is about +/-5% which is probably a little worse than the jelly-bean regulator they use to power the PIC.
For very low volume applications is it acceptable to use the supply regulator and have a compensation factor in software?  This could accommodate both the tolerance of any resistive divider needed and also the actual regulator variance, provided the unit was calibrated off a known supply voltage.

Cheers,
David

trastikata

Hello david,

I think I posted that somewhere before, but can't find it now.

If the PIC has internal Vref it is usually internally connected to one of the ADC channels. To measure the actual output from the regulator, for example if the 3.3v is actually 3.3v:

- Enable the internal Vref to 2.048 or 1.024 v
- Set the ADC VREF+ to the PIC's Vdd
- Measure the internal Vref as if measuring one of the ADC channels, say ADIn 13 for example
- Then you can reverse calculate the actual VDD which has been used as reference

On PICs without internal Vref I think you will need an external voltage reference and voltage divider from the battery or the voltage regulator.

tumbleweed

I think David's point is the internal references aren't spec'd as very accurate, and usually the 5V regulator used to supply VDD is more accurate.

Of course those specs are over the entire VDD and temp range, so you'd probably find they're typically much better than the spec (for all the good THAT does you).


david

Yes indeed.  No problem if the reference was 1.024V or 2.048V but it comes with typically a +/3% tolerance over supply and temperature range. This is no better than a small regulator.  I'm thinking I may be better to use the supply regulator as a reference, apply a known voltage and measure the output with a good multimeter.  I can then apply a software correction factor.   The numbers of units are small enough to take such a custom approach.  For serious numbers I think a precision reference would be needed, especially where battery source is LiFePO4 which has a very flat discharge curve.

Cheers,
David

trastikata

Quote from: tumbleweed on Sep 20, 2023, 11:53 AMI think David's point is the internal references aren't spec'd as very accurate, and usually the 5V regulator used to supply VDD is more accurate.

The thing is with those LDO or VLDO regulators the voltage output starts dropping when the battery voltage is lower than the VDD+LDO voltage but the PIC is still working. Thus using the VDD as VREF+ and voltage divider from the battery to measure low battery voltage might lead to unpredictable results.

david

One of my specific applications would be a low battery indicator for a 6 cell Lithium Polymer battery.  Fully charged this is around 25.2V.  Good voltage is 25.2V down to 23.5V.  OK voltage would be 23.5V down to 22.7V.  Operation below this becomes a lucky dip but the PIC certainly won't mind until its regulator get close to dropout.
With a suitable divider this becomes something like
ADC count>856 is good
ADC count>827 and <856 is usable
ADC count<827 is dodgy.
To make it simple for an operator I had thought of a dual colour panel LED providing Green, Orange, Red indications.  That's about when I found you can buy a 4 digit LED panel voltmeter for about US$1.40.  No idea about accuracy but it has to be at least as good as +/-3%?

Cheers,
David

top204

#6
In the older generation televisions and satellite receivers and test equipment, a common component for voltage reference was the TL431, and it is still an active component.

There is an online article using it in Nuts and Volts for a voltage reference that is, apparently, 0.01% accurate?

Build a 0.01% Accurate Voltage Reference

I built a lithium battery monitor many years ago, and I got good results using a standard LDO regulator as the external +Vref for the microcontroller's 10-bit ADC. It allowed the unit to monitor the tiny window of voltage difference that occurs with lithium batteries when they start to loose power. Also remember, the ADC is not 100% accurate, so going to the levels of tiny percentages of voltage reference accuracy is not going to give excellent overall accuracy, but a good LDO will give the results you require.

I do agree, the internal Vref regulator in the PIC microcontrollers is rather dreadful and I have had problems with them with temperature changes, so I would use a good quality dedicated vref chip, or a good quality LDO regulator for measuring lithium battery voltages.

david

Hello Les,
Many thanks for the excellent link there.  Probably more precision than I need right now but you just never know when a new challenge comes up.
I remember back to my early days using a simple circuit from the National Semiconductor Op-Amp Handbook.  It used a low tempco Zener diode and an Op-Amp in non-inverting gain mode - something like the attached.  Because the output was around 10V (could be adjusted) the zener was constant current fed and proved quite stable for a reference in power supplies without having to resort to exotic chips.

Cheers,
David

JonW

Some of the PICs have the reference value in the DIA memory area. PIC16F1537x Clip.
Microchip also make some good buffered bandgaps MCP1502/1501. 
Another really good flexible IC is XC6118 from torex.  This has a bandgap, comparator with external time delay (these are very cheap)


david

Many thanks for that.  All interesting devices.
Is the PIC16F1537x using some sort of preset factory gain adjust on a bandgap multiplier?   That would be very convenient.

Cheers,
David