DIY Lithium Battery Health Monitor (SoC/SoH LED Display)

by DIY GUY Chris in Circuits > Electronics

173 Views, 5 Favorites, 0 Comments

DIY Lithium Battery Health Monitor (SoC/SoH LED Display)

Battery hack.png

🔧 What You'll Build:

A compact device that displays State of Charge (SoC) and State of Health (SoH) of lithium batteries using LED bars. Perfect for salvaging old cells or DIY power banks!

📊 Key Features:

✅ Real-time monitoring via BQ27441 fuel gauge IC

✅ Dual LED bars for SoC/SoH (WS2812B NeoPixels)

✅ USB-C charging (BQ24075 IC)

✅ Open-source design (PCB/code/3D files included)

🎥 Demo: See it in action 👇🏻


Supplies

Supplies

Core main Components

  1. BQ27441 Fuel Gauge IC (Texas Instruments)
  2. BQ24075 Charger IC (Texas Instruments)
  3. ATmega328P MCU (Arduino-compatible)
  4. WS2812B LED Bars (10x2 configuration)
  5. 18650 Battery Holder
  6. 0.01Ω Current-Sense Resistor (1206 package)
  7. USB-C Connector (TYPEC-304-BCP16)

Full BOM list here ➡️ (GitHub repo)

PCB & Assembly

  1. Custom PCB → Order from JLCPCB
  2. Solder Paste (ChipQuik SMD291AX)
  3. MHP50 Hot Plate
  4. Flux Remover (Chemtronics Flux-Off)

Tools

  1. Soldering Station (Hakko FX888D)
  2. LINKMICRO Digital Microscope
  3. ESD-Safe Tweezers (5-piece set)
  4. ANENG AN8008 Multimeter

3D Printing

  1. PLA Filament (Overture Black)
  2. M2 Threaded Inserts

Software

  1. Altium Designer → Full Project design files (Altium 365)
  2. Arduino IDE

Circuit Designing

BQ24075&BQ27441.png
top side PCB Design.PNG
Bottom side PCB Design.PNG

🔌 Schematic Overview

I designed this system around three core ICs:

  1. BQ27441 Fuel Gauge - For accurate SoC/SoH measurement via I²C
  2. BQ24075 Charger - Handles USB-C power input and battery charging
  3. ATmega328P MCU - Processes data and drives LED indicators

Key Design Challenges Solved:

  1. Precision Sensing: Added a 0.01Ω current-sense resistor (R10) for coulomb counting
  2. Thermal Safety: Designed dual NTC support (onboard and external battery sensors)
  3. Noise Reduction: Used star grounding and 100nF decoupling caps near all ICs

🛠️ Design Tools Used

  1. Schematic Capture: Altium Designer
  2. Component Sourcing: Selected JLCPCB-compatible parts for easy assembly

Pro Tip:

Always run a Design Rule Check (DRC) before finalizing! My schematic passed with zero errors thanks to Altium's real-time validation.

📁 Design Files:

  1. Full Schematic PDF
  2. Altium 365 Project

PCB Assembly (SMD Soldering Guide)

🛠️ Tools You’ll Need

  1. Solder Paste (ChipQuik SMD291AX)
  2. MHP50 Hot Plate
  3. LINKMICRO Microscope
  4. PCB Stencil (Included in GitHub repo’s Gerber files)

🔬 Assembly Process

1. Apply Solder Paste

  1. Secure the PCB stencil over the board using tape.
  2. Spread solder paste evenly with a squeegee (or old credit card).
  3. Pro Tip: Chill the paste for 5 mins first for better viscosity!
  4. I 3D printed a support to help me apply solder paste → (3D STL File here)


2. Place Components

  1. Use ESD tweezers to position tiny parts (0402 resistors, ICs).
  2. Start with the smallest components (resistors/caps) → larger ICs last.

3. Reflow with Hot Plate

  1. Preheat the MHP50 hot plate to 150°C.
  2. Place the PCB on the plate and heat until paste turns shiny (~220°C, 2-3 mins).
  3. Critical: Let it cool naturally, no fans!


4. Inspect Under Microscope

  1. Check each joint with the LINKMICRO microscope:
  2. Good joint: Smooth, concave fillet.
  3. Bad joint: Dull or ball-shaped (reflow with hot air).
  4. Pay special attention to:
  5. BQ27441’s tiny pins (SON-12 package)
  6. USB-C connector (easy to bridge)

⚠️ Troubleshooting

  1. Bridged Pads? Use copper braid w/ flux to wick excess solder.
  2. Tombstoning? Redo paste application, uneven amounts cause this.
  3. Cold Joints? Reheat with hot air gun at 250°C.


📌 Pro Tips

  1. Stencil Alignment: Use PCB fiducials for perfect paste deposits.
  2. Double-Sided Boards: Assemble bottom side first (larger components last).
  3. No Hot Plate? A skillet works in a pinch (monitor with IR thermometer).


Final Device Assembly (3D Housing + PCB)

🛠️ What You’ll Need

  1. 3D-Printed Parts (STL Files)
  2. M2 Threaded Inserts and screws
  3. Assembled PCB (from Step 2)
  4. Soldering Iron (for insert installation)



🔧 Assembly Steps

1 Install Threaded Inserts

  1. Heat the inserts with a soldering iron at 200°C and press into housing holes.
  2. Pro Tip: Use an M2 screw to align inserts vertically while cooling.



2 Mount the PCB

  1. Secure the board with M2 screws, ensuring USB-C port aligns with the housing cutout.
  2. Connect the 18650 holder/JST connector.



3 Attach LED Diffusers

  1. Snap the 3D-printed light guides over the WS2812B LEDs for even glow.


Firmware Upload & Real-World Testing

💻 Programming Setup

  1. Tools Needed:
  2. USBASP Programmer (for bootloader)
  3. Arduino IDE (for firmware)

⚡ Flashing Process

  1. Upload Bootloader (ISP Port)
  2. Connect USBASP to the PCB’s 6-pin ISP header.
  3. Select ATmega328P and burn Arduino Nano Bootloader.

  1. Upload Firmware
  2. Open Battery_health.ino in Arduino IDE.
  3. Set board to "Arduino Nano" (same chip).
  4. Adjust BATTERY_CAPACITY in code to match your cell (e.g., 3000 for 3000mAh).
  5. You can get the code from here → GitHub direct link

🔋 Testing with Used Batteries

  1. Insert Cells (try 3 scenarios):
  2. Healthy cell: SoH ≈100%, SoC updates smoothly.
  3. Aged cell (e.g., laptop pull): SoH <80%, LED bar shows degradation.
  4. Dead cell: SoH <20%, verify charger blocks over-discharge.

  1. Validate Accuracy
  2. Compare SoC readings to a bench power supply at known voltages.

📌 Pro Tips

  1. Bootloader Issues? Double-check ISP pin connections with a continuity tester.
  2. No USBASP? Use an Arduino-as-ISP (tutorial in here).
  3. Calibration: For lab-grade accuracy, log data in BQStudio (Texas Instruments’ tool).

Downloads