0% found this document useful (0 votes)
35 views

Input Scaling For Arduino Analog Readings

The Arduino Uno can read analog voltages between 0-5V with a 10-bit resolution of 1024 values from 0-1023. To convert these analog readings to voltages, the correct scaling is 5V/1023 rather than 5V/1024 because there are 1023 intervals between 0-5V on the 10-bit scale, not 1024 intervals. This is analogous to a 4-bit scale having 15 intervals between 0-5V rather than 16 intervals.

Uploaded by

Hrushi Kesan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Input Scaling For Arduino Analog Readings

The Arduino Uno can read analog voltages between 0-5V with a 10-bit resolution of 1024 values from 0-1023. To convert these analog readings to voltages, the correct scaling is 5V/1023 rather than 5V/1024 because there are 1023 intervals between 0-5V on the 10-bit scale, not 1024 intervals. This is analogous to a 4-bit scale having 15 intervals between 0-5V rather than 16 intervals.

Uploaded by

Hrushi Kesan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Scaling of Arduino Analog Input Readings

The Arduino Uno can read voltages on one of six analog input pins. The maximum input
voltage is 5V, and the analog input readings are returned as 10-bit integer values. The
maximum numerical value for a (unsigned) 10-bit number is 1023. Therefore, when the
maximum input of 5 V is applied to one of the input pins, the maximum numerical value
for an analog reading is 1023.
On a 10-bit scale there are 1024 numbers starting with 0 and ending with 1023. To
convert a numerical value returned by the analogRead function to a voltage, should the
scaling be 5V/1023 or 5V/1024?

Answer: The correct scaling is 5V/1023.

Consider a 4-bit analog to digital converter. An unsigned 4-bit number can have the
values 0, 1, 2, 15 as depicted by the following number line.

Although there are 16 numbers that label points on the line, there are only 15 equal-
length segments. Therefore, the scale factor for a 4-bit analog-to-digital converter is
5V/15 because the 5V range is divided into 15 intervals. By analogy, the correct scaling
for a 10-bit analog to digital converter having a maximum input range of 5V is 5V/1023.
There are 16 values on the 4-bit number line, but the first value, 0, just marks the
beginning of the line. The other values, 1, 2, 3, 15 are labels for the right hand
endpoints of the intervals.
Yet another way to think about this is to consider the question: How many years
have you lived when you reach your nth birthday? For example, on your twenty-first
birthday, you have lived 21 years. The day you were born is birthday 0.

Scaling of analog inputs p. 1/1


LWTL: Fall 2012

You might also like