arduino / arduino/reference-en

1024 used instead of correct 1023 in `analogRead` reference

Open
#708 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
173
Forks
704
PR merge metrics
No merged PRs in 30d

Description

Dear reader,

I believe there is an error (typo) in the online documentation of
https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/
related to the number 1024 being used wrongly, instead of 1023 which is the correct one.

In my opinion the resolution of Arduino Uno is 5 Volt / 1023 = 4.8875855 mV per unit. This value will allow us to match the reading of 1023 into 5 Volt (not more, nor less).

Let's check the consequences of what is mentioned on the online site: Arduino "will map input voltages between 0 and the operating voltage(5V or 3.3V) into integer values between 0 and 1023. On an Arduino UNO, for example, this yields a resolution between readings of: 5 volts / 1024 units or, 0.0049 volts (4.9 mV) per unit. ". So if we do the maths, it means that if one gets a reading from the Arduino of 1023, if we multiply that by the resolution of 4.9 mV, we end up with 5.0127 Volt (i.e. more than 5 Volt). This contradicts the first statement.

Can we conclude there is a typo on Arduino's online documentation of arduinoread() function?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the analogRead reference page linked in the issue and locate the statement describing the 0–1023 range and resolution. Verify the reported 1024/1023 discrepancy, then update the documentation if confirmed; done means the resolution wording is consistent with the stated readings.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.