Read VCC

Post your cool example code here.
User avatar
RogerClark
Posts: 6893
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Read VCC

Post by RogerClark » Tue Apr 26, 2016 6:05 am

Thanks

User avatar
ahull
Posts: 1597
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Read VCC

Post by ahull » Tue Apr 26, 2016 11:55 am

If you are looking for a voltage reference to compare with, one of these may help when calibrating.
(other suppliers are available of course).

Image

The datasheed claims 15 ppm/°C maximum, 0°C to 70°C which should be sufficiently accurate for most applications, including calibrating a cheap multimeter.
- Andy Hull -

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Read VCC

Post by madias » Tue Apr 26, 2016 1:05 pm

Ahull: There are also smaller IC's for that, just google for 1.25 voltage reference shunt ic and you get back thousands of results like REF1112
I believe a bigger problem is, that there is no "real" VREF input on the maple mini's, so you need always a REF analog in pin and the need for a SW calculation (compare with another input pin). Correct me, if I'm wrong...

User avatar
ahull
Posts: 1597
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Read VCC

Post by ahull » Tue Apr 26, 2016 1:14 pm

madias wrote:Ahull: There are also smaller IC's for that, just google for 1.25 voltage reference shunt ic and you get back thousands of results like REF1112
I believe a bigger problem is, that there is no "real" VREF input on the maple mini's, so you need always a REF analog in pin and the need for a SW calculation (compare with another input pin). Correct me, if I'm wrong...
I think you are correct regarding the STM not having a suitable internal voltage reference, however you can roughly calibrate the STM by measuring its VCC and comparing with the 2V5 vref from one of these precision voltage sources.

A lot depends on how precisely you need to measure voltages. For example, with the Pig-O-Scope, you could trim and calibrate a bunch of resitive voltage dividers, and get acceptable precision for most hobby projects. If however you need ultra precise measurements, you would need to spend a bit more time, money and effort, and in those cases, the blue pills would not be a suitable choice, even if calibrated, due to the fact that the adc VREF is VCC, and they do not have a separate analog ground plane, and therefore noise is a significant factor.
- Andy Hull -

User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Read VCC

Post by mrburnette » Tue Apr 26, 2016 1:35 pm

Or...
After graduation, I managed a State University EE lab - mainly watched over undergrads and graduate students to make sure none of the equipment grew legs :lol: But, I also did some minimum calibration, etc. Research: Fun Job == lousy financial compensation.

A good overview of what calibration IS and ISNOT

One of the locked-up toys was a Standard Cell ... a liquid battery in sealed glass with far too many decimal points to be comfortable. If you are an amateur chemist and want to do your own standard voltage battery, the math is pretty simple. Just be certain that you have access to chemical pure reagents and a high accuracy lab balance. Here is the link to the online calculator.


Ray

User avatar
Pito
Posts: 1522
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Read VCC

Post by Pito » Wed Apr 27, 2016 7:02 am

The cheapest and easiest way is a venerable TL431 ($0.0something, you may find it in almost all scrap switching power sources). You need a 10k resistor in addition.
Input to +5V via 10k and Vka=Vref=2.5V, 6mV drift over temp range, good for 12bit.
tl431ref.JPG
Pukao Hats Cleaning Services Ltd.

User avatar
Slammer
Posts: 243
Joined: Tue Mar 01, 2016 10:35 pm
Location: Athens, Greece

Re: Read VCC

Post by Slammer » Wed Apr 27, 2016 10:09 am

In addition of TL431, there is also another very common reference device, the LM336-2.5
Attachments
4906.png
4906.png (9.73 KiB) Viewed 917 times

User avatar
zoomx
Posts: 491
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Read VCC

Post by zoomx » Wed Apr 27, 2016 10:43 am

ahull wrote: The datasheed claims 15 ppm/°C maximum, 0°C to 70°C which should be sufficiently accurate for most applications, including calibrating a cheap multimeter.
Got one, it seems very cheap, thanks!

zmemw16
Posts: 1413
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Read VCC

Post by zmemw16 » Sat Apr 30, 2016 12:49 am

mcp1525 2.56v
mcp1541 4.096v
aliexpress £0.18 & £0.26

srp

smithy
Posts: 37
Joined: Sat Aug 13, 2016 7:02 pm
Location: Gießen, Germany

Re: Read VCC

Post by smithy » Mon Aug 29, 2016 1:34 am

Guess you are using the led to surge current, i have an oled connected at 3.3V so i dont need to use the led for that ?

Post Reply