I am working on a project that is to have multiple analog sensors. Initial observations indicate that the readings were more inconsistent that hoped for. The spreads for a series of 24 reads was in the range of 10 to 14 counts.
No analog sensors were installed, just the potentiometers to provide an adjustable and steady input.
Some web pages state that the DUE has a 12 bit D/A and that the default mode is 10 bits. Ok, ten is sufficient. However, since the two LSBs are knocked off I expected rock solid measurements at ten bits. That is not the case.
I will upload a Excel workbook of the results. If I can I will also upload the code. Here is how the measurements were obtained.
I started with an Ethernet demo program found on line, left all the Ethernet stuff unchanged, then modified the code to make the measurements. It creates a two dimensional array and makes multiple measurements loading the results in the array. In the array I tracked the current/latest reading, min, the max, the sum, the average, and the spread (difference between min and max.)
I wired up three 20K pots. Pot 1 is wired to inputs 0, 3, 6, 9, Pot 2 is wired to 1, 4, 7, 10, Pot 3 is wired to 2, 5, 8, 11.
All three were set to zero volts, then pot 1 was set to max of 3.33. I ran the code and captured the data from the Chrome monitor and put in a text file. Then the pot was turned down to 3.0, 2.5, 2.0, etc, and the measurements taken. After some number of loops I used ctl-a and ctl-c to capture the data and put into Notebook. Then the data was imported into Excel. When the meter bobbled one digit I included that. My hands are not steady and I was unable to get the exact voltage desired but I think that matters little. Close enough should be good enough for this.
All the runs were repeated for Pots 2 and 3. The channels not being tested were kept a zero volts. I started putting in some statistics but decided that I would get little use from that. If anyone wants to massage the numbers any please feel free to do so.
Another post mentioned some pure digital temperatures sensors. I purchased three of those. As I get time I will connect them and see how they perform.
Edit: I see that only one attachment was accepted. And now I am not seeing a method to attach, upload, or link to the Excel workbook. If anyone is interested, please tell me how to add another attachment.
And since I cannot post that, here is one run at one voltage. This one is with an input of 3.01 volts on channels 0, 3, 6, and 9. They all had the same input.
meter = 3.01
0 array_count 24 current 922 lowest 913 highest 927 sum 22106 average 921.08 spread 14
1 array_count 24 current 0 lowest 0 highest 1 sum 1 average 0.04 spread 1
2 array_count 24 current 0 lowest 0 highest 2 sum 3 average 0.13 spread 2
3 array_count 24 current 920 lowest 916 highest 923 sum 22090 average 920.42 spread 7
4 array_count 24 current 0 lowest 0 highest 0 sum 0 average 0 spread 0
5 array_count 24 current 0 lowest 0 highest 2 sum 3 average 0.13 spread 2
6 array_count 24 current 916 lowest 916 highest 924 sum 22083 average 920.12 spread 8
7 array_count 24 current 0 lowest 0 highest 3 sum 3 average 0.13 spread 3
8 array_count 24 current 0 lowest 0 highest 4 sum 6 average 0.25 spread 4
9 array_count 24 current 923 lowest 916 highest 923 sum 22078 average 919.92 spread 7
10 array_count 24 current 0 lowest 0 highest 0 sum 0 average 0 spread 0
11 array_count 24 current 1 lowest 0 highest 1 sum 3 average 0.13 spread 1
analog_evaluations.ino (11.8 KB)