Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AdcErrorStudy.txt 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. Static Tests of the Arduino Internal ADC.
  2. Several people have asked about the DC accuracy of the Arduino ADC when used in my data logging applications at slow sample rates.
  3. Here are my results of some "hobby level" measurements of the Arduino ADC.
  4. One question is how important is the ADC clock rate. I did measurents for an ADC clock rate of 125 kHz to 2MHz.
  5. Another question is how much does Noise Reduction Mode help. I did a series of measurements using this mode.
  6. Noise Reduction Mode only reduced the mean absolute error slightly.
  7. I do calibration to remove Offset Error and Gain Error. Calibration is very important for good accuracy.
  8. These tests depend on the Arduino voltage regulator providing a stable voltage during the tests. The Arduino ADC reference voltage is Vcc for these tests. This may not be realistic for practical applications
  9. Integral Non-linearity (INL) is the main remaining source of error.
  10. Here are my results for static (DC) tests of the internal ADC for three UNOs.
  11. The Arduinos are powered by a high quality nine volt power supply.
  12. These tests measure a DC level so do not include problems due to time jitter, S/H time, and other dynamic errors.
  13. There are several studies of the dynamic behavior of the Arduino ADC that determine ENOB (Effective Number Of Bits).
  14. I used a shield with a 12-bit MCP4921 DAC to generate voltage levels. This ADC has an output buffer so it provides a very low impedance source.
  15. I measured the voltage of the DAC with a calibrated 18-bit MCP3422 ADC on the shield.
  16. I used DAC levels from 20 to 4075 to avoid zero offset errors at low voltages and DAC buffer problems at high voltages.
  17. Each series of measurements has 4056 data points.
  18. This is a voltage range of about 0.023 to 4.972 volts.
  19. I calibrated the Arduino ADC for each series of measurements with a linear fit of the form.
  20. v = a + b*adcValue
  21. Errors are the difference between the value measured with the 18-bit ADC and the calibrated value measured with the AVR ADC.
  22. I also show the results for no calibration, the NoCal column, using the datasheet formula.
  23. Vin = Vref*adcValue/1024
  24. The rows in the tables tables are.
  25. Min - minimum error in millivolts
  26. Max - maximum error in millivolts
  27. MAE - mean absolute error in millivolts
  28. The columns in the tables are:
  29. Ideal - results for a perfect 10-bit ADC for comparison.
  30. NoCal - datasheet formula (5/1024)*adcValue with Noise Reduction Mode.
  31. NR128 - Noise Reduction mode with Prescaler of 128 (ADC clock of 125 kHz).
  32. PS128 - analogRead with Prescaler of 128 (ADC clock of 125 kHz).
  33. PS64 - analogRead with Prescaler of 64 (ADC clock of 250 kHz).
  34. PS32 - analogRead with Prescaler of 32 (ADC clock of 500 kHz).
  35. PS16 - analogRead with Prescaler of 16 (ADC clock of 1 MHz).
  36. PS8 - analogRead with Prescaler of 8 (ADC clock of 2 MHz).
  37. Results for three UNO Arduinos
  38. First Arduino - Error Millivolts
  39. Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
  40. Min -2.44 -2.43 -3.72 -4.01 -3.88 -4.53 -6.57 -27.18
  41. Max 2.44 11.69 3.74 4.24 4.15 5.17 8.69 23.21
  42. MAE 1.22 5.02 1.33 1.38 1.37 1.44 1.96 4.11
  43. Second Arduino - Error Millivolts
  44. Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
  45. Min -2.44 -9.24 -4.87 -4.86 -5.05 -5.34 -6.52 -24.04
  46. Max 2.44 11.62 3.95 4.64 4.69 5.71 8.41 21.29
  47. MAE 1.22 5.33 1.41 1.43 1.44 1.53 2.02 4.05
  48. Third Arduino - Error Millivolts
  49. Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
  50. Min -2.44 -7.88 -4.12 -4.40 -4.32 -4.41 -6.97 -26.93
  51. Max 2.44 12.53 3.80 4.04 4.18 5.27 8.84 24.59
  52. MAE 1.22 4.85 1.29 1.33 1.34 1.42 1.91 4.10