Monday, January 29, 2024

Comparing ADCs on ESP32, Pico and Arduino #Arduino #ESP32 #RaspberryPi @monkmakes

After some inconsistent and unreliable results reading an analog input from an ESP32 board, Dr. Simon Monk decided to get scientific and do some experimenting.

Three boards were chosen: An ESP32, a Raspberry Pi Pico and the ATmega328p-based Arduino Uno R3.

I was particularly interested in three things:

  • finding any dead-zones at each end of the analog input voltage range
  • measuring the reproducibility of the readings
  • linearity through the range

On looking at the documentation in MicroPython and learning that the analog readings for a Pico and ESP32 come at a massive 16 bit precision (a number between 0 and 65536) it’s easy think that their analog inputs are much better than the paltry 10 bits of an Arduino (0 to 1023 reading range). But this is to confuse precision with accuracy. It’s why pure megapixels is not the best way to judge a camera. So much depends on the lens.

So, if you are trying to get decent accuracy and reproducibility from your analog readings, then you probably want to take a set of readings and average them — or use an Arduino Uno R3!

See the whole test series in the excellent post here.

 

No comments:

Post a Comment