Arduino UNO R4 WiFi ADC Resolution
Learn how to change the ADC resolution on the UNO R4 WiFi.
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.
Goals
The goals of this tutorials are:
- Update the ADC resolution to 12/14-bit.
Hardware & Software Needed
- Arduino IDE (online or offline)
- Arduino UNO R4 WiFi
- UNO R4 Board Package
Analog-to-Digital Converter (ADC)
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}Summary
This short tutorial show how to update the resolution for your ADC, a new feature available on the UNO R4 WiFi board.
Suggested changes
The content on docs.arduino.cc is facilitated through a public GitHub repository. You can read more on how to contribute in the contribution policy.
License
The Arduino documentation is licensed under the Creative Commons Attribution-Share Alike 4.0 license.