Q re: ATMega328 bandgap reference
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Q re: ATMega328 bandgap reference

by fredwe on Tue Feb 02, 2010 6:16 pm

<warning> Arduino newbie </warning>

Both Adafruit & this forum being terrific resources, I'm posting to see if more experience users confirm my hesitation about relying on the internal voltage reference.

Starting with the great tutorial http://www.ladyada.net/learn/sensors/tmp36.html I found that the TMP36 sensor output voltage measured by the ATMega's ADC was different from what I measured directly using a Sperry DMM - difference of about 10-20mV. Then tried the self-calibration mentioned in the tutorial, but still a discrepancy. And the imputed V+ even with the self-calibration came to 5.14V but the DMM measured 5.03V.

Now the tutorial states the internal bandgap as 1.05; the 328 datasheet says 1.1V. And then (RTFM!) reading the datasheet again & nudged in that direction by another forum post, apparently the tolerance on that voltage is +/- 0.1V.

:?: So...here's the question: is it true then, that the bandgap is a pretty crappy reference? I'm tempted instead to rely on the stability of the onboard 5V regulator, measure it (in my case 5.03V), then code that value into the ADC calibration. Sure it applies only to my particular Arduino, but for one-off use seems a better way to go.

Thanks for any advice / correction.

Posts: 4
Joined: Tue Feb 02, 2010 5:34 pm

Re: Q re: ATMega328 bandgap reference

by adafruit on Tue Feb 02, 2010 10:20 pm

yes...the bandgap is a really crappy reference :)

however! its crappiness is better than the difference between 3.3V and 5V


Posts: 12131
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Q re: ATMega328 bandgap reference

by polymorph on Thu Sep 19, 2013 3:30 pm

I know this is a very old thread, but I felt I had to say something.

I would much rather rely on the internal bandgap voltage reference than the rather noisy Vcc. That 7805 or other voltage regulator almost certainly uses a bandgap voltage reference itself, but has large switched transients of current on it.

The internal reference on an Atmega328p is rated at 1.100V+-1mV, <90ppm from -10 to +70C.

But you must add a capacitor to ARef to bypass noise. And the Arduino does not have the Atmel suggested RC lowpass between Vcc and AVcc (pin 20 on a 328), which affects the ADC no matter what reference you use.

The tutorial is incorrect, probably victim of the typical DMM tolerance of ±3% or worse.


http://arduino.cc/en/uploads/Main/Ardui ... ematic.pdf

Steve Greenfield AE7HD

Posts: 1
Joined: Thu Sep 19, 2013 3:24 pm

Re: Q re: ATMega328 bandgap reference

by kscharf on Mon Sep 23, 2013 12:58 pm

It all depends on what you are using the A/D converter for.
If you are reading the positon of a joy stick, or buttons (using a voltage divider to put several buttons on one processor pin), or measuring relative light intensity using a simple photo cell in a voltage divider then the internal reference is probably good enough. If you are trying to read a precision sensor, then maybe you really want to use an external precision voltage reference.
I'm developing a custom application using the Arduino IDE on non-Arduino HW (either an atmega328 or an atmega1284p). In either case I'm using an LC filter to power the ADVCC pin. (56uh and .1 uf).

Posts: 209
Joined: Wed Sep 10, 2008 10:29 am

Please be positive and constructive with your questions and comments.