That is not how the AVR analog-to-digital converter works. A one bit successive approximation converter with a reference of 5 volts makes just a single comparison: Is the voltage less than 2.5 volts? If the answer is "yes" then the converted value is zero. If the answer is "no" then the converted value is one.
So you could get 0V or 5V, OFF or ON with just 1 bit?
No, that would be "less than or equal to 2.5V, or greater than 2.5V (including greater than 5V)". Or vice versa.Do try to keep up.
1/1024 = 0.0009765621/1023 = 0.000977517Difference when Vref is 5V is less than 5 microvolts.
Dividing by 1023 or 1024? The final verdict on analogRead
I see your failure to correctly quote / proofread your post and my failure to notice your failure lead us to this point. I would ask you to correct your mistake but I have a strong suspicion that you would simply ignore my request.In any case, I apologize for my mistake. My reply should have been direct to @Budvar10.
Nice. Thank you.That certainly seems insignificant. But, I wonder what happens when considered in the context of PID. More specifically what happens when we...Add a small error then add a small error then add a small error then add a small error... You know. Integrate.I wonder if that would be considered a systematic error. You know. The kind of error no self respecting engineer would ever make.
What /1023 does is to interpret the ADC range as from 0V to 5.0049V with the last step starting at 5V.
That would be "What /1023 does is to interpret the ADC range as from 0V to any voltage over five volts (that doesn't actually break the comparator), with the last step starting at 5V."
Surely 1-bit error in 12 isn't 'that serious'
That makes no sense to me.If Vref is 5v the ADC will treat give the highest possible value for anything greater than (5v - 5v / Nsteps) - and it is probably irrelevant for this comment whether N is 1023 or 1024.If your program then gets a reading of the highest value (let's say it gets 1023) your program must consider the real value to be between (5 - 5/N)volts and 5 volts.I remain of the view that is is easier to understand what is happening if you imagine an ADC that produces the values 0, 1, 2, 3, 4 and 5 for the range 0v to 5v because the errors are much more obvious....R
Of course not.But neither is a crossword-puzzle - that does not prevent it from being a puzzle for which one would like to find the correct answer....R