DIY Arduino Battery Capacity Tester - V1.0 - 12 Steps (With Pictures) - Instructables
DIY Arduino Battery Capacity Tester - V1.0 - 12 Steps (With Pictures) - Instructables
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow Teachers (/teachers/) Following (/feed/)
instructables (/circuits/)
circuits
Projects (/circuits/projects/) Community (/circuits/community/) Download Favorite w I Made ItLet's Make...
DIY Arduino Battery Capacity Tester - V1.0
By Open Green Energy (/member/Open+Green+Energy/) in Circuits (/circuits/) > Arduino (/circuits/arduino/projects/)
197,711 1,076 166 Featured
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
(/member/Open+Green+Energy/)
By Open Green Energy More by
(/member/Open+Green+Energy/) the author:
(/member/Open+Green+Energy/)
Follow
Few week ago, I have started the project from the basics.This version is really simple one,which
is based on Ohms Law.The accuracy of the tester won’t be 100% perfect, but it does give
reasonable results that can be used and compared with other battery, so you can easily identify
good cells in a old battery pack.
During my work I realized, there are a lot of things which can be improved. In the future, I will try
to implement those things. But for the time being, I am happy with it.I hope this little tester will
be useful, so I am sharing it with you all.
Disclaimer: Please note that you are working with Li-Ion battery which is highly explosive and
dangerous . I cannot be held responsible for any loss of property, damage, or loss of life if it
comes to that. This tutorial was written for those who have knowledge on rechargeable lithium-
ion technology.Please do not attempt this if you are novice. Stay Safe.
Teacher Notes
/
Teachers! Did you use this instructable in your classroom?
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/)
Follow
Add a Teacher Note to share how you incorporated it into your lesson.
Download Favorite w I Made It
(https://www.banggood.in/custlink/vGKDcJR98t) )
Tools Required :
Instrument Used :
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FP0/L7JX/ISCBJ8IS/FP0L7JXISCBJ8IS LARGE jpg? (https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FLL/ISUF/ISCBTQNT/FLLISUFISCBTQNT LARGE jpg?
Schematic :
To understand the schematic easily, I have drawn it on a perforated board also. The positions of
the components and wiring are similar to my actual board. The only exceptions are the buzzer
and OLED display. In the actual board, they are inside but in the schematic, they are lying
outside.
/
The
DIY Arduino Battery design
Capacity is very
Tester - V1.0simple
by Openwhich is based
Green Energy on Arduino
(/member/Open Nano.
Green An
Energy/) OLED
Follow
display is used to display
the battery parameters.3 screw terminals are used for connecting battery and the load
Download
resistance. A buzzer is used for giving di erent alerts. Two voltage dividers circuit is used to
Favorite w I Made It
monitor the voltages across the load resistance. The function of the MOSFET is to connect or
disconnect the load resistance with the battery.
Working :
Arduino checks the battery condition, if the battery is good, give the command to switch ON the
MOSFET. It allows current to pass from the positive terminal of the battery, through the resistor,
and the MOSFET then completes the path back to the negative terminal. This discharges the
battery over a period of time. Arduino measures the voltage across the load resistor and then
divided by the resistance to nd out the discharge current. Multiplied this by the time to obtain
the milliamp-hour ( capacity ) value.
We have to nd the voltage across the load resistor. The voltages are measured by using two
voltage divider circuits. It consists of two resistors with values 10k each. The output from the
divider is connected to Arduino analog pin A0 and A1.
Arduino analog pin can measure voltage up to 5V, in our case the maximum voltage is 4.2V (fully
charged). Then you may ask, why I am using two dividers unnecessarily. The reason is that my
future plan is to use the same tester for the multi-chemistry battery. So this design can be
/
adapted
DIY Arduino Battery Capacity easily
Tester -to achieve
V1.0 by Openmy goal.
Green Energy (/member/Open Green Energy/) Follow
Current (I) = Voltage ( V ) - Voltage drop across the MOSFET / Resistance (R)
Capacity Measurement :
We have already calculated the current, the only unknown in the above equation is time. The
millis() function in Arduino can be used to measure the elapsed time.
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
Resistance ( R ) = Max Battery Voltage / Discharge Current = 4.2 /0.5 = 8.4 Ohm
The resistor needs to dissipate a bit of power, so size does matter in this case.
By keeping some margin you can choose 5W. If you want more safety use 10W.
I used 10 Ohm, 10W resistor instead of 8.4 Ohm because it was in my stock at that time.
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
Here MOSFET acts like a switch. The digital output from the Arduino pin D2 controls the switch.
When 5V (HIGH) signal is fed to the gate of the MOSFET, it allows current to pass from the
positive terminal of the battery, through the resistor, and the MOSFET then completes the path
back to the negative terminal. This discharges the battery over a period of time. So the MOSFET
should be chosen in such a way that it can handle maximum discharge current without
overheating. /
I used
DIY Arduino Battery an Tester
Capacity n-channel logic
- V1.0 by Openlevel
Greenpower MOSFET-IRLZ44.
Energy (/member/Open Green The L shows
Energy/) Followthat it is a logic level
MOSFET. A logic level MOSFET means that it is designed to turn on fully from the logic level of a
microcontroller. The standard MOSFET (IRF series etc) is designed to run from 10V.
Download Favorite w I Made It
If you use an IRF series MOSFET, then it will not fully turn ON by applying 5V from Arduino. I
mean the MOSFET will not carry the rated current. To tuned ON these MOSFETs you need an
additional circuit to boost the gate voltage.
So I will recommend using a logic-level MOSFET, not necessarily IRLZ44. You can use any other
MOSFET also.
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
To display the Battery Voltage,discharge current and capacity, I used a 0.96" OLED display.It has
128x64 resolution and uses I2C bus to communicate with the Arduino. Two pins SCL (A5), SDA
(A4) in Arduino Uno are used for communication.
I am using U8glib library to display the parameters.First you have to download the U8glib
library (https://github.com/olikraus/u8glib/archive/master.zip).Then installed it.
If you want to get started in to OLED display and Arduino , click here
(http://www.hobbyist.co.nz/?q=arduino-to-oled-display)
A4----> SDA
A5----> SCL
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/F16/QFAL/ISCBSBZ1/F16QFALISCBSBZ1 LARGE jpg? (https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FSS/VTL5/ISCBSBZ6/FSSVTL5ISCBSBZ6 LARGE jpg?
To provide di erent warning or alert, a piezo buzzer is used.The di erent alerts are
3. No Battery
The buzzer have two terminals, the longer one is positive and the shorter leg is negative.The
sticker on the new buzzer have also " + " marked to to indicate the positive terminal.
/
The
DIY Arduino Battery connections
Capacity should
Tester - V1.0 beGreen
by Open as follows
Energy (/member/Open Green Energy/) Follow
In the Arduino Sketch, I have used a separate function beep() which sends the PWM signal to the
buzzer, waits for a small delay, then turns it o , then has another small delay. Thus, it beeps once.
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
5 More Images
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FRN/21UL/ISCBJ9F6/FRN21ULISCBJ9F6 LARGE jpg?
In the previous steps, I have explained the function of each of the components in the circuit.
Before jump to make the nal board, test the circuit on a bread board rst.If the circuit works
perfectly on the bread board,then move to solder the components on the protype board.
Mounting the Nano : First cut two rows of female header pin with 15 pins in each.I used a
diagonal nipper to cut the headers.Then solder the header pins.Be sure the distance between
the two rails ts the arduino nano.
Mounting OLED Display : Cut a female header with 4pins. Then solder it as shown in picture.
Mounting the terminals and components : Solder the remaining components as shown in
pictures
Wiring : Make the wiring as per schematic.I used colored wires to make the wiring, so that I can
identify them easily.
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FN8/3ZLV/ISCBSCPG/FN83ZLVISCBSCPG LARGE jpg?
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FY2/S7D6/ISCBSC04/FY2S7D6ISCBSC04 LARGE jpg?
After soldering and wiring,mount the stando s at 4 corners.It will provide su cient clearance to
the soldering joints and wires from the ground.
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FJL/65GS/ISCBSCW0/FJL65GSISCBSCW0 LARGE jpg? (https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FGM/JMVA/ISCBSCVW/FGMJMVAISCBSCVW LARGE jpg?
1. Measure voltages
Taking 100 ADC samples , adding them and averaging the result.This is done to reduce the
noise.
2. Check the battery condition to give alert or start the discharge cycle
Alerts
/
i) Capacity
DIY Arduino Battery Low-V! :Tester
If the- battery voltage
V1.0 by Open Green is below
Energy the lowestGreen
(/member/Open discharge
Energy/)level ( 2.9V
Follow
for Li Ion )
ii) High-V! : If the battery voltage is above the fully charged condition Download Favorite w I Made It
Discharge Cycle
If the battery voltage is within the low voltage ( 2.9V )and high voltag (4.3V),discharge cycle
start.Calculate the current and capacity as explained earlier.
Battery_Capacity_Test…
Download (https://cdn.instructables.com/ORIG/FGQ/XC7W/ISCBU04F/FGQXC7WISCBU04F.ino)
(https://cdn.instructables.com/ORIG/FGQ/XC7W/ISCBU04F/FGQXC7WISCBU04F.ino)
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
/
You
DIY Arduino Battery can go
Capacity through
Tester this
- V1.0 by tutorial
Open (http://robottini.altervista.org/arduino-and-real-time-charts-in-
Green Energy (/member/Open Green Energy/) Follow
excel) to learn how to use PLX-DAQ. It is very simple.
Download Favorite w I Made It
(https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/FEW/CNQX/ISCBTZ6Q/FEWCNQXISCBTZ6Q LARGE jpg? (https://cdn instructables
auto=webp&width=1024&height=1024&fit=bounds)
com/F3O/WCA5/IST76KDY/F3OWCA5IST76KDY LARGE jpg?
/
After
DIY Arduino Battery few Tester
Capacity testing I conclude
- V1.0 thatEnergy
by Open Green the tester result isGreen
(/member/Open quite reasonable.The
Energy/) Follow
result is 50 to 70mAh
away from a branded battery capacity tester result.By using a IR temperature Gun, I measured
the temperature rise in the load resistor also,the maximum value is 51 deg C.
Download Favorite w I Made It
In this design the discharge current is not constant, it depends on battery voltage.So the
discharge curve plotted is not similar to the discharge curve given in the battery manufacture
data sheet.It only support a single Li Ion Battery.
So in my future version I will try solve the above short comings in the V1.0.
Credit : I would like to give credit to Adam Welch, whose project on YouTube was inspired me to
start this project.You can watch his YouTube video (https://youtu.be/qtws6VSIoYk).
Participated in the
Maker Olympics Contest 2016 View Contest
(/contest/makerolympics2016/)
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
IvanA175 (/member/IvanA175/) made it! ERALPD (/member/ERALPD/) made it! emreaytac (/member/emreaytac/) made it!
Gerrit1980 (/member/Gerrit1980/) made it! agussuratno (/member/agussuratno/) made it! necronum (/member/necronum/) made it!
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
I Made It!
/
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
Recommendations
Download Favorite w I Made It
(/id/PiNAS-the-Raspberry-Pi-NAS/) (/id/The-Algorithm-Machine/)
729 8 136K 8
90 15K
(/contest/trashytreasure2020/) (/contest/raspi2020/)
Add Tip
V Ask Question
| Post Comment
/
We have a be nice policy.
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open
Please Green
be positive and Energy/)
constructive. Follow
166 Discussions
Reply / Upvote
How can i measure 12V battery And what changes in circuit And code plsss help me
1 reply F
Reply / Upvote
how code? pls hlep me
Answer / Upvote
Hi! Works perfect! Removed resistors, changed a few rows in the program also for that. But the
problem I found - not working when disconnected from my PC, have no idea.... With only external
Arduino power - starts process and stops at 50mah, sometimes 100mah.... Programmed 328P only
separate, same issue. Any idea why is it so?
Answer / Upvote
Hi. Is it possible just to meassure the voltage of a 18650 battery using any of the analog pins? Do I still
need a voltage divier? Since Arduino can measure up to 5V I don't think it is necessary, but just want
to make sure. Thanks!
1 answer F
Reply / Upvote
Hi; I don't have 10 Ohm, 10W resistor. Can I use 10 Ohm, 11W resistor instead? Or should I use 2 pcs
10 Ohm, 5W resistors with parallel connection? I want to use 11W resistor if the results won't change.
Thanks..
6 replies F
Reply / Upvote
UPDATE, Used different Oled and it is working. Reads high V, and No Battery, I would think if it is
reading high V that it would start capacity test but just keeps beeping?
1 reply F
/
/1
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/)
(/member/DarenS3/) Follow
DarenS3 (/member/DarenS3/) Published Sep 4th, 2016
Reply / Upvote
Download and toFavorite
Refactored this to be programmable constant current, simpler operation, 4 channels, use a w I Made It
cheap 4 digit LED. Code is up.
https://hackaday.io/project/163626-minimalist-li-ion-dischargercapacity-meter
(https://hackaday.io/project/163626-minimalist-li-ion-dischargercapacity-meter)
(https://cdn.instructables.com/F2Q/638Y/JRGONBP7/F2Q638YJRGONBP7.ANIMATED.LARGE.gif?
auto=webp&&fit=bounds)
2 replies F
/
Teachers Jobs
DIY Arduino Battery Capacity Tester - V1.0 by Open Green Energy (/member/Open Green Energy/) Follow
(/teachers/) (/community/Positions-
w
available-at-
Download
Instructables/) Favorite I Made It
Find Us