You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The objective here is to find the time constant τ (tau) in the equation:
135
+
118
136
τ = R * C Solved for C: C = τ / R
137
+
119
138
So we want to charge the capacitor under test with a suitable voltage (eg. 5V from an Arduino output pin) and measure how long it takes to reach 63.2% of that voltage. So we need a reference voltage of 5 * 0.632, namely 3.16V.
120
-
The internal analogue comparator is just the thing for the job. We connect the reference voltage to the AIN1 pin (negative reference) and connect our capacitor to the AIN0 pin (positive reference) and then configure an interrupt on the rising edge. A value of 10K for the resistor to give a reasonably slow charge time. The value of 10K is specified in code
121
-
so adjust for your resistor I have 9830 ohms, and make sure to pick accurate resistors for voltage divider.
139
+
The internal analogue comparator is used for this job.:
140
+
141
+
1. pin 6 PD6 AIN0
142
+
2. pin 7 PD7 AIN1
143
+
144
+
We connect the reference voltage to the AIN1 pin (negative reference) and connect our capacitor to the AIN0 pin (positive reference) and then configure an interrupt on the rising edge. A value of 10K for the resistor to give a reasonably slow charge time. The value of ~ 10K is specified in code variable (resistance).
145
+
so adjust for your resistor value , I have 9830 ohms. Make sure to pick accurate resistors for voltage divider.
122
146
123
-
The test returns the Capacitance in nF and time constant.
147
+
The test returns the Capacitance result and time constant.
0 commit comments