18650 battery capacity tester
Build it step by step
0 of 7 doneCheck the cell first
Use an undamaged, protected 18650 above 3.5 V. Never test a swollen or dented cell.
Build the discharge path
Cell +, 10 Ω resistor, MOSFET drain, MOSFET source to cell -. Add a 10 kΩ from gate to GND.
Add the sense wires
A0 to the cell +, A1 to the resistor-MOSFET junction, GND to the cell -.
Wire the Nano and display
Gate to D4, button to D2, OLED on A4 and A5, power from USB.
Enter your own values
Measure the resistor and the 5 V pin and set R_LOAD and VREF.
Start a test
Press the button. Current is about 0.35 to 0.4 A. The display counts mAh until 3.0 V.
Compare
A good 2600 mAh label should give at least 2000 mAh. A fake cell often gives less than half.
How do you build a 18650 battery capacity tester?
A MOSFET and a power resistor discharge a cell at a steady current until 3.0 V while the Arduino counts milliamp-hours, exposing fake 'high capacity' cells. You need Arduino Nano, MOSFET IRLZ44N, Power resistor 10 Ω 5 W (cement), Resistor 10 kΩ, Battery holder 18650 single, SSD1306 OLED Display, Tactile push button 6 mm, USB A to micro-USB cable (data) and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 300 minutes.
- Level
- Intermediate
- Time
- About 300 min
- Parts
- 9
Parts list
- Development BoardsBuyArduino Nano × 1
- SemiconductorsBuyMOSFET IRLZ44N × 1
- PassivesBuy
- PassivesBuyResistor 10 kΩ × 1
- PowerBuy
- DisplaysBuy
- SwitchesBuy
- Cables & WiresBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Cell + | 10 Ω power resistor and Nano A0 | Cell voltage |
| 10 Ω resistor other end | MOSFET drain and Nano A1 | Resistor current measured by the voltage drop |
| MOSFET source | Cell - and Nano GND | Common ground |
| MOSFET gate | Nano D4, with 10 kΩ to GND | Switches the load on and off |
| OLED SDA and SCL | Nano A4 and A5 | Display |
| Start button | Nano D2 and GND | Begin the test |
| Nano power | USB cable from a computer or adapter | The cell is only the load |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "Adafruit SSD1306" and "Adafruit GFX Library". Measure the real resistor value and the Nano's 5 V pin with a multimeter and enter them for accuracy. Only test undamaged cells with protection, stay nearby, and place the rig on a non-flammable surface. A 10 Ω resistor at 4.2 V dissipates about 1.8 W, so it gets hot.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const byte GATE = 4, START = 2;
const float R_LOAD = 10.0; // ohms, measure yours with a multimeter and enter it here
const float CUTOFF = 3.0; // stop at this cell voltage
const float VREF = 5.0; // measure the Nano's 5V pin and enter it here
float mAh = 0;
bool running = false;
unsigned long last = 0;
float volts(byte pin) {
long s = 0;
for (byte i = 0; i < 16; i++) s += analogRead(pin);
return (s / 16.0) * VREF / 1023.0;
}
void setup() {
pinMode(GATE, OUTPUT); digitalWrite(GATE, LOW);
pinMode(START, INPUT_PULLUP);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setTextColor(SSD1306_WHITE);
}
void loop() {
float vcell = volts(A0);
float vdrain = volts(A1);
float amps = (vcell - vdrain) / R_LOAD; // current through the resistor
if (!running && digitalRead(START) == LOW && vcell > CUTOFF + 0.2) {
running = true; mAh = 0; last = millis(); digitalWrite(GATE, HIGH);
delay(300);
}
if (running) {
unsigned long now = millis();
mAh += amps * 1000.0 * (now - last) / 3600000.0;
last = now;
if (vcell <= CUTOFF) { running = false; digitalWrite(GATE, LOW); }
}
oled.clearDisplay();
oled.setTextSize(1); oled.setCursor(0, 0);
oled.print(running ? "Discharging" : "Idle / done");
oled.setCursor(0, 14); oled.print("Cell "); oled.print(vcell, 2); oled.print(" V");
oled.setCursor(0, 26); oled.print("Current "); oled.print(amps * 1000, 0); oled.print(" mA");
oled.setTextSize(2); oled.setCursor(0, 44); oled.print(mAh, 0); oled.print(" mAh");
oled.display();
delay(500);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Fully charged cell, start | Current about 400 mA at 4.2 V, falling to about 300 mA at 3.0 V |
| Resistor temperature | Hot but within its rating after a few minutes |
| End of test | MOSFET switches off at 3.0 V and the display shows the total |
| Compare with a known good cell | Capacity close to its label |
If it does not work
Current reads zero
The gate is not high. Check D4 and the MOSFET orientation.
Result is far off
R_LOAD or VREF are not your measured values.
Resistor too hot
Mount it away from other parts and in free air. It is a 5 W part at under 2 W, but it still gets hot.
Test never starts
The cell is below the minimum starting voltage. Charge it first.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the 18650 battery capacity tester?
Arduino Nano, MOSFET IRLZ44N, Power resistor 10 Ω 5 W (cement), Resistor 10 kΩ, Battery holder 18650 single, SSD1306 OLED Display, Tactile push button 6 mm, USB A to micro-USB cable (data) and Jumper wires male to male (40 pcs, 20 cm).
How long does the 18650 battery capacity tester take to build?
About 300 minutes for a intermediate maker, in 7 steps.
How do I know the 18650 battery capacity tester works?
Fully charged cell, start: Current about 400 mA at 4.2 V, falling to about 300 mA at 3.0 V. Resistor temperature: Hot but within its rating after a few minutes. End of test: MOSFET switches off at 3.0 V and the display shows the total.
Current reads zero: what should I check?
The gate is not high. Check D4 and the MOSFET orientation.
Result is far off: what should I check?
R_LOAD or VREF are not your measured values.
Resistor too hot: what should I check?
Mount it away from other parts and in free air. It is a 5 W part at under 2 W, but it still gets hot.
Test never starts: what should I check?
The cell is below the minimum starting voltage. Charge it first.
