In this tutorial you will learn how to change the analog-to-digital converter (ADC) on an Arduino UNO R4 WiFi board. By default, the resolution is set to 10-bit, which can be updated to both 12-bit (0-4096) and 14-bit (0-16383) resolutions for improved accuracy on analog readings.
The goals of this tutorials are:
An analog-to-digital converter (ADC) transforms an analog signal to a digital one. The standard resolution on Arduino boards is set to 10-bit (0-1023). The UNO R4 WiFi supports up to 14-bit resolutions, which can provide a more precise value from analog signals.
To update the resolution, you will only need to use the analogReadResolution() command.
To use it, simply include it in your
setup()
, and use analogRead()
to retrieve a value from an analog pin.1void setup(){2 analogReadResolution(14); //change to 14-bit resolution3}4
5void loop(){6 int reading = analogRead(A3); // returns a value between 0-163837}
This short tutorial show how to update the resolution for your ADC, a new feature available on the UNO R4 WiFi board.