Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADC reading

Status
Not open for further replies.

chris414

New Member
I recently looked at one of the application notes on Microchip for doing some ADC with a PIC18 microcontroller. I can't find the link again, but basically what it did was create a loop which ran 16 times. In the loop the ADC reading was done and the result added to a total which at the end was divided by 16. Is it necessary to perform the ADC this many times? Is one reading not accurate enough?
 
Depends on the application, there's generally a decent amount of noise on an onboard ADC. Averaging is a simple way of reducing it.
 
Averaging the ADC reading works if the noise being averaged is asynchronous with the rate at which the ADC is being read. For example, if the noise is coming from the AC power line, you would have to read the ADC at a rate much slower than 60 Hz.

Dividing by 16 is as easy as right shifting by four bits.
 
Last edited:
60hz is noise to some signal to others, it really depends on what noise you're talking about, all sources of noise are not created equal. On most micro controller ADCs you can't even technically get the full precision that it's bit depth would suggest without special shut down modes and capacitors for the voltage reference, the least one or two significant bits will effectively be random, you can get those bits back by averaging over time without additional circuit components however if you do 16 sample averaging you lower the effective sampling rate by 16 as well.
 
Even the second bit is a bit sketchy if precautions aren't taken.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top