Author Topic: Maths question about ADC result  (Read 5192 times)

0 Members and 1 Guest are viewing this topic.

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Maths question about ADC result
« Reply #25 on: October 17, 2017, 01:52:02 am »
While that works, it doesn't help with short-period variations of the VCC rail, which can degrade accuracy, and it halves the maximum sample rate, assuming you read ADC0 before every reading.  Consider using a 4.096V reference - it gives you a decent ADC input voltage range, and 4mV per ADC count for easy maths, but remember the Atmega's AREF input also outputs its internal reference, so a 1K resistor between the reference and the pin + 0.1uF decoupling rght at the pin is strongly advises to prevent disasters if you misconfigure  the ADMUX REFS bits.
 
The following users thanked this post: rs20

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3442
  • Country: us
Re: Maths question about ADC result
« Reply #26 on: October 17, 2017, 07:37:22 pm »
While that works, it doesn't help with short-period variations of the VCC rail, which can degrade accuracy, and it halves the maximum sample rate, assuming you read ADC0 before every reading.  Consider using a 4.096V reference - it gives you a decent ADC input voltage range, and 4mV per ADC count for easy maths, but remember the Atmega's AREF input also outputs its internal reference, so a 1K resistor between the reference and the pin + 0.1uF decoupling rght at the pin is strongly advises to prevent disasters if you misconfigure  the ADMUX REFS bits.

re: "Consider using a 4.096V reference"
I thought about that one for a while.   Since my stuff is hobbyist stuff, I rework the board a lot.  Adding a voltage divider to a populated board is not always easy.  So I wanted an implementation that is safe to solder to anywhere on the board without having to rework an entire area to add a voltage divider.  Well, of course, safe but excluding the external Vin which is known to be > board's "may be +5V".

re: "...short-period variations of the VCC rail, which can degrade accuracy, and it halves the maximum sample rate..."
Yeah, that bugs me but something has to give.  When I really really wants best quality I can achieve, I would go over to my 16bit ADS1115 which incidentally uses an internal 4.096V reference.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf