Skip to content

Commit 3f7f5cd

Browse files
committed
Initial Commit
0 parents  commit 3f7f5cd

File tree

392 files changed

+81873
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+81873
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+215
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
46+
[Dd]ebug/
47+
[Rr]elease/
48+
x64/
49+
build/
50+
[Bb]in/
51+
[Oo]bj/
52+
53+
# MSTest test Results
54+
[Tt]est[Rr]esult*/
55+
[Bb]uild[Ll]og.*
56+
57+
*_i.c
58+
*_p.c
59+
*.ilk
60+
*.meta
61+
*.obj
62+
*.pch
63+
*.pdb
64+
*.pgc
65+
*.pgd
66+
*.rsp
67+
*.sbr
68+
*.tlb
69+
*.tli
70+
*.tlh
71+
*.tmp
72+
*.tmp_proj
73+
*.log
74+
*.vspscc
75+
*.vssscc
76+
.builds
77+
*.pidb
78+
*.log
79+
*.scc
80+
81+
# Visual C++ cache files
82+
ipch/
83+
*.aps
84+
*.ncb
85+
*.opensdf
86+
*.sdf
87+
*.cachefile
88+
89+
# Visual Studio profiler
90+
*.psess
91+
*.vsp
92+
*.vspx
93+
94+
# Guidance Automation Toolkit
95+
*.gpState
96+
97+
# ReSharper is a .NET coding add-in
98+
_ReSharper*/
99+
*.[Rr]e[Ss]harper
100+
101+
# TeamCity is a build add-in
102+
_TeamCity*
103+
104+
# DotCover is a Code Coverage Tool
105+
*.dotCover
106+
107+
# NCrunch
108+
*.ncrunch*
109+
.*crunch*.local.xml
110+
111+
# Installshield output folder
112+
[Ee]xpress/
113+
114+
# DocProject is a documentation generator add-in
115+
DocProject/buildhelp/
116+
DocProject/Help/*.HxT
117+
DocProject/Help/*.HxC
118+
DocProject/Help/*.hhc
119+
DocProject/Help/*.hhk
120+
DocProject/Help/*.hhp
121+
DocProject/Help/Html2
122+
DocProject/Help/html
123+
124+
# Click-Once directory
125+
publish/
126+
127+
# Publish Web Output
128+
*.Publish.xml
129+
*.pubxml
130+
131+
# NuGet Packages Directory
132+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133+
#packages/
134+
135+
# Windows Azure Build Output
136+
csx
137+
*.build.csdef
138+
139+
# Windows Store app package directory
140+
AppPackages/
141+
142+
# Others
143+
sql/
144+
*.Cache
145+
ClientBin/
146+
[Ss]tyle[Cc]op.*
147+
~$*
148+
*~
149+
*.dbmdl
150+
*.[Pp]ublish.xml
151+
*.pfx
152+
*.publishsettings
153+
154+
# RIA/Silverlight projects
155+
Generated_Code/
156+
157+
# Backup & report files from converting an old project file to a newer
158+
# Visual Studio version. Backup files are not needed, because we have git ;-)
159+
_UpgradeReport_Files/
160+
Backup*/
161+
UpgradeLog*.XML
162+
UpgradeLog*.htm
163+
164+
# SQL Server files
165+
App_Data/*.mdf
166+
App_Data/*.ldf
167+
168+
#############
169+
## Windows detritus
170+
#############
171+
172+
# Windows image file caches
173+
Thumbs.db
174+
ehthumbs.db
175+
176+
# Folder config file
177+
Desktop.ini
178+
179+
# Recycle Bin used on file shares
180+
$RECYCLE.BIN/
181+
182+
# Mac crap
183+
.DS_Store
184+
185+
186+
#############
187+
## Python
188+
#############
189+
190+
*.py[co]
191+
192+
# Packages
193+
*.egg
194+
*.egg-info
195+
dist/
196+
build/
197+
eggs/
198+
parts/
199+
var/
200+
sdist/
201+
develop-eggs/
202+
.installed.cfg
203+
204+
# Installer logs
205+
pip-log.txt
206+
207+
# Unit test / coverage reports
208+
.coverage
209+
.tox
210+
211+
#Translations
212+
*.mo
213+
214+
#Mr Developer
215+
.mr.developer.cfg

AnalogBinLoggerExtras/ADC_ENOB.PNG

86.9 KB
Loading
Binary file not shown.
124 KB
Binary file not shown.
+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Static Tests of the Arduino Internal ADC.
2+
3+
Several people have asked about the DC accuracy of the Arduino ADC when used in my data logging applications at slow sample rates.
4+
5+
Here are my results of some "hobby level" measurements of the Arduino ADC.
6+
7+
One question is how important is the ADC clock rate. I did measurents for an ADC clock rate of 125 kHz to 2MHz.
8+
9+
Another question is how much does Noise Reduction Mode help. I did a series of measurements using this mode.
10+
11+
Noise Reduction Mode only reduced the mean absolute error slightly.
12+
13+
I do calibration to remove Offset Error and Gain Error. Calibration is very important for good accuracy.
14+
15+
These tests depend on the Arduino voltage regulator providing a stable voltage during the tests. The Arduino ADC reference voltage is Vcc for these tests. This may not be realistic for practical applications
16+
17+
Integral Non-linearity (INL) is the main remaining source of error.
18+
19+
Here are my results for static (DC) tests of the internal ADC for three UNOs.
20+
21+
The Arduinos are powered by a high quality nine volt power supply.
22+
23+
These tests measure a DC level so do not include problems due to time jitter, S/H time, and other dynamic errors.
24+
There are several studies of the dynamic behavior of the Arduino ADC that determine ENOB (Effective Number Of Bits).
25+
26+
I used a shield with a 12-bit MCP4921 DAC to generate voltage levels. This ADC has an output buffer so it provides a very low impedance source.
27+
28+
I measured the voltage of the DAC with a calibrated 18-bit MCP3422 ADC on the shield.
29+
30+
I used DAC levels from 20 to 4075 to avoid zero offset errors at low voltages and DAC buffer problems at high voltages.
31+
32+
Each series of measurements has 4056 data points.
33+
34+
This is a voltage range of about 0.023 to 4.972 volts.
35+
36+
I calibrated the Arduino ADC for each series of measurements with a linear fit of the form.
37+
38+
v = a + b*adcValue
39+
40+
Errors are the difference between the value measured with the 18-bit ADC and the calibrated value measured with the AVR ADC.
41+
42+
I also show the results for no calibration, the NoCal column, using the datasheet formula.
43+
44+
Vin = Vref*adcValue/1024
45+
46+
47+
The rows in the tables tables are.
48+
49+
Min - minimum error in millivolts
50+
51+
Max - maximum error in millivolts
52+
53+
MAE - mean absolute error in millivolts
54+
55+
56+
The columns in the tables are:
57+
58+
Ideal - results for a perfect 10-bit ADC for comparison.
59+
60+
NoCal - datasheet formula (5/1024)*adcValue with Noise Reduction Mode.
61+
62+
NR128 - Noise Reduction mode with Prescaler of 128 (ADC clock of 125 kHz).
63+
64+
PS128 - analogRead with Prescaler of 128 (ADC clock of 125 kHz).
65+
66+
PS64 - analogRead with Prescaler of 64 (ADC clock of 250 kHz).
67+
68+
PS32 - analogRead with Prescaler of 32 (ADC clock of 500 kHz).
69+
70+
PS16 - analogRead with Prescaler of 16 (ADC clock of 1 MHz).
71+
72+
PS8 - analogRead with Prescaler of 8 (ADC clock of 2 MHz).
73+
74+
75+
Results for three UNO Arduinos
76+
77+
First Arduino - Error Millivolts
78+
79+
Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
80+
Min -2.44 -2.43 -3.72 -4.01 -3.88 -4.53 -6.57 -27.18
81+
Max 2.44 11.69 3.74 4.24 4.15 5.17 8.69 23.21
82+
MAE 1.22 5.02 1.33 1.38 1.37 1.44 1.96 4.11
83+
84+
Second Arduino - Error Millivolts
85+
86+
Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
87+
Min -2.44 -9.24 -4.87 -4.86 -5.05 -5.34 -6.52 -24.04
88+
Max 2.44 11.62 3.95 4.64 4.69 5.71 8.41 21.29
89+
MAE 1.22 5.33 1.41 1.43 1.44 1.53 2.02 4.05
90+
91+
Third Arduino - Error Millivolts
92+
93+
Ideal NoCal NR128 PS128 PS64 PS32 PS16 PS8
94+
Min -2.44 -7.88 -4.12 -4.40 -4.32 -4.41 -6.97 -26.93
95+
Max 2.44 12.53 3.80 4.04 4.18 5.27 8.84 24.59
96+
MAE 1.22 4.85 1.29 1.33 1.34 1.42 1.91 4.10
97+
98+

AnalogBinLoggerExtras/DATA.png

49.8 KB
Loading

AnalogBinLoggerExtras/FFT.png

45.4 KB
Loading

AnalogBinLoggerExtras/RateTable.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Maximum Sample Rate Table
2+
3+
ADC clock kHz
4+
125 250 500 1000
5+
pins
6+
1 7692 14286 25000 40000
7+
2 3810 6667 11111 16667
8+
3 2572 4790 8421 13559
9+
4 1942 3636 6452 10526
10+
5 1559 2930 5229 8602
11+
6 1303 2454 4396 7273
12+
7 1119 2111 3791 6299
13+
8 980 1852 3333 5556
14+
9 872 1649 2974 4969
15+
10 786 1487 2685 4494
16+
11 715 1354 2446 4103
17+
12 656 1242 2247 3774
18+
13 606 1148 2078 3493
19+
14 563 1067 1932 3252
20+
15 525 996 1806 3042
21+
16 493 935 1695 2857

0 commit comments

Comments
 (0)