I have not run exhausting tests, however I seem to have found that on multiple Pro Mini boards, reading an analog input with a defined voltage produces large errors, for example on 4 different boards, reading a voltage of 0.91V with ref of 1.1V (internal) ought to produce a reading of 849. Instead I have measured: 859, 866, 874 and 889.
I have plenty of Nanos and Pro Minis here, and I would probably test in the future, but in the meantime if anyone knows more about this I'd appreciate some help.
The exact Aref voltage of the Arduino in use should be used in the maths line of your code that converts the A/D value to whatever you need. Voltage, pressure, etc.
You could write the Aref voltage in the board.
I think some store the exact value in flash.
Leo..
You could write the Aref voltage in the board.
I think some store the exact value in flash.
Leo..
So you are syaing that the 1.1V Internal Reference is not accurate, although it is stable, and I could find out the exact value and program it in my code?
Is there a programmatic way of determining the "1.1V" internal reference or do I just need to measure it on each new Arduino and then hardcode it in my code?
Yes. You could say 1.1volt Aref is not factory trimmed, but very stable.
Each Arduino is different.
I usually write some simple code that shows voltage on the serial monitor.
Then connect ~1volt to the analogue input (with DMM across).
And adjust the Aref value in the code untill the serial monitor displays the same as the DMM.
Leo..
I have done almost exactly the same except I saw noise on the scope which is present when the serial is connected and that throws the values out a bit.