5516

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)

Supplies


Core main Components
  • BQ27441 Fuel Gauge IC (Texas Instruments)
  • BQ24075 Charger IC (Texas Instruments)
  • ATmega328P MCU (Arduino-compatible)
  • WS2812B LED Bars (10x2 configuration)
  • 18650 Battery Holder
  • 0.01Ω Current-Sense Resistor (1206 package)
  • USB-C Connector (TYPEC-304-BCP16)
Full BOM list here  →  (GitHub repo)

PCB & Assembly
Tools
3D Printing
Software

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
kb1hJKM.jpg
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)
    YDNLEMM.jpg
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.
    lRK143z.jpg
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!
    rHl7KMG.jpg
4. Inspect Under Microscope

  1. Check each joint with the LINKMICRO microscope:
    1. Good joint: Smooth, concave fillet.
    2. Bad joint: Dull or ball-shaped (reflow with hot air).
  2. Pay special attention to:
    1. BQ27441’s tiny pins (SON-12 package)
    2. 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.
    Qh0Q8VO.jpg

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).
HOuNq5p.jpg
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)

hLtVLVY.jpg
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.
    o9Q8jg0.png
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.
    pwxDZNk.png
3 Attach LED Diffusers

  1. Snap the 3D-printed light guides over the WS2812B LEDs for even glow.
    qze0AGT.png
Firmware Upload & Real-World Testing

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

 Flashing Process
  1. Upload Bootloader (ISP Port)
    1. Connect USBASP to the PCB’s 6-pin ISP header.
    2. Select ATmega328P and burn Arduino Nano Bootloader.
      lbc9zfr.jpg
  2. Upload Firmware
    1. Open Battery_health.ino in Arduino IDE.
    2. Set board to "Arduino Nano" (same chip).
    3. Adjust BATTERY_CAPACITY in code to match your cell (e.g., 3000 for 3000mAh).
    4. You can get the code from here → GitHub direct link

Testing with Used Batteries
  1. Insert Cells (try 3 scenarios):
    1. Healthy cell: SoH ≈100%, SoC updates smoothly.
    2. Aged cell (e.g., laptop pull): SoH <80%, LED bar shows degradation.
    3. Dead cell: SoH <20%, verify charger blocks over-discharge.
      55DSFX9.jpg
  2. Validate Accuracy
    1. Compare SoC readings to a bench power supply at known voltages.
      6GvZKy3.jpg
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).