1. Introduction
2. Components
Arduino Uno
12V Relay Module (To control the main charger)
ACS712 Current Sensor (5A or 20A version)
Voltage Divider Resistors: (6 Resistors: 10kΩ x 4, 20kΩ x 1, 30kΩ x 1)
1N4007 Diode (For reverse protection)
15V DC Power Adapter (Recommended for 12.6V Li-ion charging)
3. Circuit and Connections
| Pinout Diagram of Arduino Uno |
| Pinout Diagram of Single Channel Relay Module |
| Relay Module Pin | Arduino Pin | Connection Description |
| VCC | 5V | Power for the Relay Coil |
| GND | GND | Ground Reference |
| IN / Signal | D8 | Control Signal from Arduino |
| COM (Common) | — | Connect to Charger (+) |
| NO (Normally Open) | — | Connect to Diode Anode |
3.2. ACS712 Current Sensor
| ACS712 Sensor Pin | Arduino Pin | Connection Description |
| VCC | 5V | Power for the Sensor |
| GND | GND | Ground Reference |
| OUT | A3 | Analog Current Reading |
| Terminal 1 | — | From Diode Cathode |
| Terminal 2 | — | To Battery Pack (+) Main |
3.3. Voltage Divider 1 (Cell 1 Monitoring)
| Divider 1 Connection | Arduino Pin | Connection Description |
| Resistor Junction | A0 | Middle point of 10k/10k resistors |
| Top Resistor | — | Connect to Cell 1 (+) Tap |
| Bottom Resistor | GND | Connect to Common GND |
3.4. Voltage Divider 2 (Cell 2 Monitoring)
| Divider 2 Connection | Arduino Pin | Connection Description |
| Resistor Junction | A1 | Middle point of 20k/10k resistors |
| Top Resistor | — | Connect to Cell 2 (+) Tap |
| Bottom Resistor | GND | Connect to Common GND |
3.5. Voltage Divider 3 (Cell 3 Monitoring)
| Divider 3 Connection | Arduino Pin | Connection Description |
| Resistor Junction | A2 | Middle point of 30k/10k resistors |
| Top Resistor | — | Connect to Cell 3 (+) Tap |
| Bottom Resistor | GND | Connect to Common GND |
3.6 1N4007 Protection Diode
| Diode Leg | Connection Point | Connection Description |
| Anode (No Stripe) | Relay NO Pin | Receives power from the charger |
| Cathode (Silver Stripe) | ACS712 Terminal 1 | Sends power toward the battery |
3.7. 12V/15V DC Power Adapter
| Adapter Wire | Connection Point | Connection Description |
| Positive (+) | Relay COM Pin | The "Input" power for charging |
| Negative (-) | Common GND | Connect to Arduino GND and Battery (-) |
4. Detailed Step By Step Circuit working
Voltage Tapping: Each cell's positive terminal is connected to an Analog pin. Because each tap has a higher voltage, we use different resistor ratios to keep the signal below 5V.
Current Monitoring: The ACS712 sits in the main charging line. It tells the Arduino exactly how many Amps are flowing into the cells.
Relay Switching: The Relay acts as the "Gatekeeper." If the Arduino detects a fault or a full charge (4.2V), it opens the relay to stop the flow of electricity.
Reverse Protection: The 1N4007 diode ensures that if the power adapter is unplugged, the battery does not discharge backwards into the circuit.
5. Libraries to be included
No external libraries required (Uses built-in
SerialandAnalogfunctions).
6. Code
7. Detailed Step By Step Code working
Reading and Scaling: The code reads three analog pins and uses multipliers to find the real voltage at each battery tap.
Cell Isolation: It subtracts the lower tap values from the higher ones to isolate the voltage of Cell 2 and Cell 3.
Current Logic: It reads the ACS712. If the amperage is correct, it continues; if there is a short, the relay can be programmed to cut off.
Safety Decision: The
ifstatements monitor every cell. If any cell hits 4.2V, the relay stops the charger. If any cell is dangerously low, it flags a "Problamatic" cell.
8. Tips
Star Grounding: Keep all Ground wires connected to a single point to avoid "noise."
Calibration: Always verify the voltage with a multimeter and adjust the multipliers in the code (2.0, 3.0, 4.0) to match your specific resistors.
Li-ion Only: This project is strictly for Li-ion 3S packs. Do not use it for Lead-Acid batteries.
9. Uses
Building high-quality 12V Li-ion battery packs.
Real-time monitoring of solar battery banks.
Safety system for DIY electric vehicles or drones.
10. Conclusion
By combining monitoring and charging, you have created a system that is safer than most cheap commercial chargers. You can now identify a failing cell before it causes an accident, saving you time and money.