Do you have some rechargeable batteries lying around that need a capacity check? Today, we’ll take an Arduino Nano and a few other electronic parts to build a AA battery tester that will give us fairly accurate “real world” readings on NiMH batteries. This little device will come in handy for the next project on the list, so be sure to subscribe for more how-tos!
How To Install The Correct Arduino Nano Driver https://goo.gl/zWB4BD
Parts List (Affiliate links):
Breadboard & jumpers: http://amzn.to/2uq6KNW
AA battery holder: http://amzn.to/2eHNEOa
Terminal blocks: http://amzn.to/2uq1IRD
1R10W Ceramic Resistor: http://amzn.to/2eHKk5H
Arduino Nano (clone): http://amzn.to/2uQAd4Z
1.5R10W Power Resistor: http://amzn.to/2eIieHc
IRF3205 MOSFET: http://amzn.to/2eInMBG
10KR Resistor: http://amzn.to/2uPLjXQ
Nokia 5110 Screen: http://amzn.to/2eHS0VC
Original concept and Arduino sketch by Adam Welch https://goo.gl/eN85W9
Music: “Robots R Us Remix” by Anders Enger Jensen
https://goo.gl/KEEzoY
–Check out more videos here
https://goo.gl/z7QLov
–Be sure to subscribe!
https://goo.gl/j3ATwZ
–Follow on Twitter
https://goo.gl/vfstFm
–Everything else is at
http://airbornesurfer.com
Production videos on Mondays (when available)
Freeway Forum replays every Wednesday
Tech teardowns, repairs, and reviews; sketches; how-to; games; and lots of other interesting geekery. Thanks for watching, and be sure to like, share, and subscribe!
TRANSCRIPT:
1
00:00:00,060 –> 00:00:06,870
greetings programs Atari here you there
2
00:00:03,449 –> 00:00:09,990
and as an object of curiosity I’ve been
3
00:00:06,870 –> 00:00:12,840
looking for a way to check the capacity
4
00:00:09,990 –> 00:00:16,680
on these little rechargeable double-a
5
00:00:12,840 –> 00:00:18,930
batteries for reasons and I stumbled
6
00:00:16,680 –> 00:00:22,140
upon Adam Welch’s battery capacity
7
00:00:18,930 –> 00:00:25,769
tester a built out of a Arduino Nano for
8
00:00:22,140 –> 00:00:27,750
a couple years ago Adam was salvaging
9
00:00:25,769 –> 00:00:30,630
lithium-ion batteries from old laptop
10
00:00:27,750 –> 00:00:33,840
batteries and so forth and I didn’t mean
11
00:00:30,630 –> 00:00:36,270
anything quite that robust so I took the
12
00:00:33,840 –> 00:00:39,230
basic design of the basic sketch and
13
00:00:36,270 –> 00:00:42,690
I’ve adapted it into a double-a checker
14
00:00:39,230 –> 00:00:44,879
so I’m going to use the same basic parts
15
00:00:42,690 –> 00:00:47,520
and I’ll provide links in the doobly-doo
16
00:00:44,879 –> 00:00:49,020
for your convenience but first we’re
17
00:00:47,520 –> 00:00:52,500
going to look at the circuit and we’re
18
00:00:49,020 –> 00:00:54,719
going to see how it works we start with
19
00:00:52,500 –> 00:00:56,699
the battery that we want to test from
20
00:00:54,719 –> 00:00:59,760
the positive terminal we need to run the
21
00:00:56,699 –> 00:01:01,680
circuit into a current shunt a current
22
00:00:59,760 –> 00:01:03,870
shunt is a resistor of a known value
23
00:01:01,680 –> 00:01:06,710
that we can use to test the effective
24
00:01:03,870 –> 00:01:09,540
voltage drop from one side to the other
25
00:01:06,710 –> 00:01:11,390
here we’re going to use a 10 watt 1 ohm
26
00:01:09,540 –> 00:01:13,979
resistor so it’ll be easy to measure
27
00:01:11,390 –> 00:01:16,770
you’ll need to run a probe line from
28
00:01:13,979 –> 00:01:19,290
each side of the shunt into an analog
29
00:01:16,770 –> 00:01:21,810
i/o pin on the Nano so that we can
30
00:01:19,290 –> 00:01:23,939
compare the two values from the shunt
31
00:01:21,810 –> 00:01:26,580
will run the circuit through some kind
32
00:01:23,939 –> 00:01:29,369
of a low this can be a power resistor a
33
00:01:26,580 –> 00:01:32,880
motor a fan or even a lamp so long as
34
00:01:29,369 –> 00:01:34,680
it’ll run on one type of my bolts from
35
00:01:32,880 –> 00:01:37,259
the load we’re going to attach our
36
00:01:34,680 –> 00:01:39,930
MOSFET and what the MOSFET is going to
37
00:01:37,259 –> 00:01:42,810
do is going to take a signal from the
38
00:01:39,930 –> 00:01:44,640
Nano and toggle the circuit every few
39
00:01:42,810 –> 00:01:48,240
seconds so we can take readings over
40
00:01:44,640 –> 00:01:50,009
time so to wire this and wait wait let
41
00:01:48,240 –> 00:01:51,409
me let me back this line up just a
42
00:01:50,009 –> 00:01:54,360
little bit so you can see more clearly
43
00:01:51,409 –> 00:01:58,110
so why are this let’s run the circuit
44
00:01:54,360 –> 00:02:00,990
from the load into the drain pin on the
45
00:01:58,110 –> 00:02:03,090
MOSFET we’re going to run a signal wire
46
00:02:00,990 –> 00:02:05,850
from one of the digital pen Bulma nano
47
00:02:03,090 –> 00:02:08,459
into the gate pin on the MOSFET to
48
00:02:05,850 –> 00:02:10,319
control the circuit and then we’ll run
49
00:02:08,459 –> 00:02:11,190
the source pin from the MOSFET to a
50
00:02:10,319 –> 00:02:14,250
common ground
51
00:02:11,190 –> 00:02:17,100
the ground will connect to the analog
52
00:02:14,250 –> 00:02:18,930
ground pan on the nano through a 10 kilo
53
00:02:17,100 –> 00:02:20,640
ohm resistor to protect the
54
00:02:18,930 –> 00:02:24,210
microcontroller from any kind of voltage
55
00:02:20,640 –> 00:02:26,660
spike this is highly unlikely in this
56
00:02:24,210 –> 00:02:30,270
device but it’s a good practice anyway
57
00:02:26,660 –> 00:02:33,050
then back into the negative terminal fat
58
00:02:30,270 –> 00:02:35,780
[Music]
59
00:02:33,050 –> 00:02:38,480
now let’s take a look at the sketch code
60
00:02:35,780 –> 00:02:40,830
Adams Arduino sketch is fairly simple
61
00:02:38,480 –> 00:02:43,590
basically we’re just going to invoke the
62
00:02:40,830 –> 00:02:45,540
library that drive the LCD to find a few
63
00:02:43,590 –> 00:02:47,490
variables and perform Ohm’s law
64
00:02:45,540 –> 00:02:50,460
calculations until the battery drains
65
00:02:47,490 –> 00:02:53,160
out here you can see where we’ve defined
66
00:02:50,460 –> 00:02:55,410
our pins analog low and high for the
67
00:02:53,160 –> 00:02:58,860
shunt and the digital signal pin for the
68
00:02:55,410 –> 00:03:00,990
MOSFET this section defines all our
69
00:02:58,860 –> 00:03:03,180
variables for the calculations later
70
00:03:00,990 –> 00:03:05,730
chump resistance reference voltage
71
00:03:03,180 –> 00:03:08,250
agency make sure that you check your
72
00:03:05,730 –> 00:03:11,250
reference voltage between the five volt
73
00:03:08,250 –> 00:03:13,740
and the ground pin otherwise your
74
00:03:11,250 –> 00:03:16,170
calculations may be off and that will
75
00:03:13,740 –> 00:03:17,910
give you faulty data back I got a
76
00:03:16,170 –> 00:03:21,110
reading of four point six eight volts
77
00:03:17,910 –> 00:03:23,520
from my Nano but your mileage may vary
78
00:03:21,110 –> 00:03:25,860
for double a nickel metal hydride
79
00:03:23,520 –> 00:03:28,080
batteries they really shouldn’t be
80
00:03:25,860 –> 00:03:30,240
allowed to deplete less than seven to
81
00:03:28,080 –> 00:03:32,430
eight hundred millivolts so we’re going
82
00:03:30,240 –> 00:03:35,010
to stop our tests about 900 millivolts
83
00:03:32,430 –> 00:03:37,380
just to be safe this isn’t going to
84
00:03:35,010 –> 00:03:39,140
allow us to get the crazy high capacity
85
00:03:37,380 –> 00:03:41,989
ratings of the manufacturers advertise
86
00:03:39,140 –> 00:03:46,140
but we are going to get a better
87
00:03:41,989 –> 00:03:48,390
real-world kind of figure now here’s
88
00:03:46,140 –> 00:03:51,209
where we start our actual program we
89
00:03:48,390 –> 00:03:53,520
have some serial output so we can read
90
00:03:51,209 –> 00:03:56,430
the test data as it comes out then we
91
00:03:53,520 –> 00:03:59,070
set our digital signal pin to love when
92
00:03:56,430 –> 00:04:01,020
it goes high it will close the circuit
93
00:03:59,070 –> 00:04:05,640
and we’ll be able to collect some that
94
00:04:01,020 –> 00:04:07,230
then we begin our loop first we check to
95
00:04:05,640 –> 00:04:09,540
make sure that the battery is a drained
96
00:04:07,230 –> 00:04:12,180
out cap then we send a signal for the
97
00:04:09,540 –> 00:04:14,820
MOSFET to close the circuit by switching
98
00:04:12,180 –> 00:04:17,100
the digital pin to hot we’ll measure the
99
00:04:14,820 –> 00:04:18,630
voltage on both sides of the shunt then
100
00:04:17,100 –> 00:04:20,880
divide the difference by the known
101
00:04:18,630 –> 00:04:23,060
resistance of the shunt and get the
102
00:04:20,880 –> 00:04:24,670
actual current going to the circuit
103
00:04:23,060 –> 00:04:26,830
little quick convert
104
00:04:24,670 –> 00:04:29,080
and units on the current and multiplied
105
00:04:26,830 –> 00:04:31,960
by time to get the measured capacity of
106
00:04:29,080 –> 00:04:35,850
the battery at that point and then
107
00:04:31,960 –> 00:04:38,350
display it rinse and repeat
108
00:04:35,850 –> 00:04:40,600
once the voltage drops below our
109
00:04:38,350 –> 00:04:42,970
specified threshold then we’ll jump down
110
00:04:40,600 –> 00:04:44,920
to the Kota that displays the final
111
00:04:42,970 –> 00:04:48,280
results of the test and turns off the
112
00:04:44,920 –> 00:04:50,200
circuit now that we’ve got an idea of
113
00:04:48,280 –> 00:04:52,800
the design in the code let’s see what
114
00:04:50,200 –> 00:04:55,480
parts were going to need and build this
115
00:04:52,800 –> 00:04:57,580
first we have our breadboard this is
116
00:04:55,480 –> 00:05:00,760
well I guess a collectible at this point
117
00:04:57,580 –> 00:05:03,100
this is a RadioShack 2 7600 one
118
00:05:00,760 –> 00:05:05,050
breadboard that has the integrated power
119
00:05:03,100 –> 00:05:08,020
terminals but you can use any old
120
00:05:05,050 –> 00:05:10,300
breadboard just as well where are
121
00:05:08,020 –> 00:05:13,300
shunned we’re going to use this 10 watt
122
00:05:10,300 –> 00:05:14,830
1 ohm ceramic resistor to connect the
123
00:05:13,300 –> 00:05:16,900
battery we’ll use this single cell
124
00:05:14,830 –> 00:05:18,670
double-a battery hole of course I’ve
125
00:05:16,900 –> 00:05:20,290
already soldered a couple of leads off
126
00:05:18,670 –> 00:05:23,830
the terminals so that I can actually use
127
00:05:20,290 –> 00:05:27,130
it for the load I’m going to use this 10
128
00:05:23,830 –> 00:05:30,460
watt 1.5 ohm power resistor but you can
129
00:05:27,130 –> 00:05:35,770
again use a fan or a lamp or whatever as
130
00:05:30,460 –> 00:05:37,120
long as it’s 1.5 volts on that we’re
131
00:05:35,770 –> 00:05:38,800
going to need a handful of these little
132
00:05:37,120 –> 00:05:43,330
terminal blocks to connect the lead
133
00:05:38,800 –> 00:05:47,170
wires together so we’ll throw those and
134
00:05:43,330 –> 00:05:51,760
an even high RF 3205 MOSFET to handle
135
00:05:47,170 –> 00:05:53,980
the switching in the circuit 10 kilo ohm
136
00:05:51,760 –> 00:05:58,240
resistor as voltage protection for the
137
00:05:53,980 –> 00:06:01,240
Nano of course we have the Nano or in
138
00:05:58,240 –> 00:06:03,430
this case a cheap Chinese clone now I
139
00:06:01,240 –> 00:06:05,530
found out the hard way that these will
140
00:06:03,430 –> 00:06:07,630
likely need a different driver as they
141
00:06:05,530 –> 00:06:10,330
use a different onboard chipset than the
142
00:06:07,630 –> 00:06:12,850
FTDI the genuine Arduino music
143
00:06:10,330 –> 00:06:14,830
I’ll put an article on airborne surfer
144
00:06:12,850 –> 00:06:17,680
comm explaining how to install those
145
00:06:14,830 –> 00:06:20,110
drivers just in case you
146
00:06:17,680 –> 00:06:22,930
bottom piece to the puzzle is this Nokia
147
00:06:20,110 –> 00:06:24,430
5110 screen module and I’ll show you how
148
00:06:22,930 –> 00:06:26,590
to wire that in as excessive things
149
00:06:24,430 –> 00:06:29,080
together on the breadboard you’ll need
150
00:06:26,590 –> 00:06:30,160
the library for this module and I’ll put
151
00:06:29,080 –> 00:06:33,580
a link to that in the write-up on
152
00:06:30,160 –> 00:06:35,139
airborne surfer comm as well and of
153
00:06:33,580 –> 00:06:36,460
course we’ll need some assorted jumper
154
00:06:35,139 –> 00:06:39,430
wires to connect everything that’s
155
00:06:36,460 –> 00:06:42,070
necessary so let’s get this thing
156
00:06:39,430 –> 00:06:44,500
together first let’s get the lead wires
157
00:06:42,070 –> 00:06:46,389
from the battery holder screwed into one
158
00:06:44,500 –> 00:06:49,389
of these terminal blocks so we can
159
00:06:46,389 –> 00:06:51,400
attach it to the red book just like the
160
00:06:49,389 –> 00:06:52,900
circuit we drew earlier the positive
161
00:06:51,400 –> 00:06:55,870
terminal is going to connect to the
162
00:06:52,900 –> 00:06:59,680
shunt resistor and to the high analog
163
00:06:55,870 –> 00:07:01,810
pin which is a zero on the net at the
164
00:06:59,680 –> 00:07:05,560
other end of the shunt and I could
165
00:07:01,810 –> 00:07:09,370
jumper to the low analog pin a1 on the
166
00:07:05,560 –> 00:07:10,960
Nano for the load I like to have a
167
00:07:09,370 –> 00:07:11,919
little space here because of all the
168
00:07:10,960 –> 00:07:14,110
components that are going to be
169
00:07:11,919 –> 00:07:16,300
installed in really close together so
170
00:07:14,110 –> 00:07:21,130
I’m going to attach a separate terminal
171
00:07:16,300 –> 00:07:24,909
block to each of the loads leads plug
172
00:07:21,130 –> 00:07:26,560
the men like so take a second and see
173
00:07:24,909 –> 00:07:28,449
that you’ve got your spacing right on
174
00:07:26,560 –> 00:07:30,940
the breadboard because we’re going to
175
00:07:28,449 –> 00:07:34,510
need to install everything according to
176
00:07:30,940 –> 00:07:38,320
the pins on the MOSFET the left end here
177
00:07:34,510 –> 00:07:41,560
is the gate then the drain then the
178
00:07:38,320 –> 00:07:44,620
source and the whole thing is dependent
179
00:07:41,560 –> 00:07:46,509
on how you wire this part plug the
180
00:07:44,620 –> 00:07:49,360
MOSFET into the breadboard
181
00:07:46,509 –> 00:07:52,690
so that the drain pin lines up with the
182
00:07:49,360 –> 00:07:55,900
lead coming from the low run a jumper
183
00:07:52,690 –> 00:07:59,590
from the digital signal pin the 10 to
184
00:07:55,900 –> 00:08:02,500
the gate 10 on the MOSFET for the ground
185
00:07:59,590 –> 00:08:04,720
I like to buy myself a little space by
186
00:08:02,500 –> 00:08:07,870
running a jumper from the source pin on
187
00:08:04,720 –> 00:08:10,930
the MOSFET to an adjacent clear line on
188
00:08:07,870 –> 00:08:13,630
the breadboard now we have a sort of a
189
00:08:10,930 –> 00:08:16,599
ground bus if you will that we can
190
00:08:13,630 –> 00:08:18,340
connect all of our common grounds to go
191
00:08:16,599 –> 00:08:20,590
ahead and run a jumper from the ground
192
00:08:18,340 –> 00:08:22,090
bus back to the negative terminal
193
00:08:20,590 –> 00:08:25,780
battery
194
00:08:22,090 –> 00:08:28,180
now add your 10 kilo ohm resistor from
195
00:08:25,780 –> 00:08:30,639
the ground bus to an adjacent row and
196
00:08:28,180 –> 00:08:34,840
from there back to the ground pin on the
197
00:08:30,639 –> 00:08:36,849
Nana lastly we need to connect the
198
00:08:34,840 –> 00:08:38,680
screen module make sure you’ve got
199
00:08:36,849 –> 00:08:42,279
plenty of space on the breadboard and
200
00:08:38,680 –> 00:08:44,320
test fit it to be sure then just connect
201
00:08:42,279 –> 00:08:58,270
the digital pens to the appropriate end
202
00:08:44,320 –> 00:09:00,010
on the screen as shown here now that
203
00:08:58,270 –> 00:09:02,650
we’re all wired up let’s test this thing
204
00:09:00,010 –> 00:09:04,540
out I’m going to throw a standard
205
00:09:02,650 –> 00:09:06,610
alkaline battery from the horror fright
206
00:09:04,540 –> 00:09:08,650
on here just to make sure everything
207
00:09:06,610 –> 00:09:10,510
works doesn’t really matter the
208
00:09:08,650 –> 00:09:12,400
chemistry though we’re really just
209
00:09:10,510 –> 00:09:18,880
concerned with the voltage and the
210
00:09:12,400 –> 00:09:21,580
capacity for testing purposes and tastic
211
00:09:18,880 –> 00:09:23,230
looks like everything works so now I can
212
00:09:21,580 –> 00:09:26,350
solder everything to the circuit board
213
00:09:23,230 –> 00:09:27,790
and have a proper tool now this little
214
00:09:26,350 –> 00:09:30,310
device is going to come in handy on the
215
00:09:27,790 –> 00:09:32,050
next project I’ve got the lined up so be
216
00:09:30,310 –> 00:09:33,310
sure and hit that subscribe button and
217
00:09:32,050 –> 00:09:35,170
don’t forget to click the bell
218
00:09:33,310 –> 00:09:36,670
notification icon so you’ll be able to
219
00:09:35,170 –> 00:09:39,070
see exactly what I’ve got up my sleeve
220
00:09:36,670 –> 00:09:40,540
in the meantime let me know you like
221
00:09:39,070 –> 00:09:42,430
this video we’re leaving a comment down
222
00:09:40,540 –> 00:09:47,310
in the doobly-doo and I don’t see you
223
00:09:42,430 –> 00:09:47,310
again in a few days Tallyho y’all
3 thoughts on “How To Build A Battery Tester”