Build it step by step
0 of 7 doneTest the sensor
Read the temperature on serial.
Test the alarm
Warm it with your hand.
Build the metal box
Bag inside, charger outside.
Fit the thermal fuse
In the charger DC input lead.
Power the Nano separately
From a USB power bank.
Charge a small pack
Watching it all the time.
Keep a sand bucket ready
Within reach.
How do you build a li-po safe charging box?
A fireproof bag in a metal box with a temperature alarm makes a safer place to charge Li-po packs. You need LiPo fireproof safety bag, LiPo balance charger (IMAX B6 style), Arduino Nano, DS18B20 Temperature Sensor, Resistor 4.7 kΩ, Active buzzer 5 V and Thermal fuse 72 °C. It takes 7 steps and about 90 minutes.
- Level
- Intermediate
- Time
- About 90 min
- Parts
- 7
Parts list
- BatteriesBuy
- BatteriesBuy
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- PassivesBuyResistor 4.7 kΩ × 1
- Motors & ActuatorsBuy
- Passives
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| DS18B20 data | Nano D2, with 4.7 k to 5V | Temperature sensor beside the bag |
| DS18B20 VCC and GND | Nano 5V and GND | Power |
| Buzzer plus and minus | Nano D8 and GND | Alarm |
| Thermal fuse | In series with the charger's DC input lead, fixed to the metal box wall | Cuts charging if the box reaches 72 C |
| Charger | Outside the box, with the battery lead through a notch | Keeps the charger cool |
| Nano | Powered by USB from a separate source | Alarm runs even if the charger is cut |
Code
Most LiPo fires happen during charging, and the safest way to charge is on a non-flammable surface, in a proper LiPo bag, on a charger that is set correctly for that pack, with you present. This box adds a layer on top of that: the pack in its bag sits in a metal box, the charger stays outside, a DS18B20 next to the bag raises an alarm at 38 C and sounds continuously at 45 C, and a 72 C thermal fuse in the charger's DC input cuts charging if the box gets very hot. The alarm is for you to hear; it is not a replacement for watching the pack. Never charge unattended or overnight, never charge a swollen, damaged or wet pack, and never leave a charging pack near anything that burns. Keep a bucket of dry sand within reach and know where the nearest exit is; do not use water. Set the charger to the right cell count and a charge current of no more than 1C, check the balance lead plug is fully in, and stop charging if the pack gets hot or puffs up. Fit the thermal fuse by crimping or soldering carefully, since the fuse itself must not be overheated while fitting it. A missing sensor counts as an alarm, so a broken wire does not silently disable the check. Arduino IDE, board "Arduino Nano" (try the Old Bootloader option if the upload fails).
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).
// LiPo charging box alarm: watches the box temperature and sounds if it gets warm or the sensor fails.
// Libraries: OneWire, DallasTemperature. Board: Arduino Nano.
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire bus(2);
DallasTemperature sensors(&bus);
const uint8_t BUZ = 8;
const float WARN_C = 38.0, ALARM_C = 45.0;
void beep(int times, int ms) {
for (int i = 0; i < times; i++) { digitalWrite(BUZ, HIGH); delay(ms); digitalWrite(BUZ, LOW); delay(ms); }
}
void setup() {
Serial.begin(9600);
pinMode(BUZ, OUTPUT);
sensors.begin();
beep(2, 100); // power-on test, you should hear two short beeps
}
void loop() {
sensors.requestTemperatures();
float t = sensors.getTempCByIndex(0);
Serial.println(t);
if (t == DEVICE_DISCONNECTED_C) beep(5, 80); // a missing sensor counts as an alarm
else if (t >= ALARM_C) { digitalWrite(BUZ, HIGH); } // continuous alarm
else if (t >= WARN_C) { digitalWrite(BUZ, LOW); beep(2, 300); }
else digitalWrite(BUZ, LOW);
delay(1000);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
24.50
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Two short beeps at start | Alarm works |
| Warm the sensor to about 38 C | Double beeps |
| Warm it to 45 C | Continuous alarm |
| Unplug the sensor | Alarm beeps |
If it does not work
No temperature printed
Check the 4.7 k pull-up and wiring.
Always alarms
Sensor wire loose or DS18B20 pins reversed.
Fuse opens during normal charging
Move it away from the charger's own heat.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the li-po safe charging box?
LiPo fireproof safety bag, LiPo balance charger (IMAX B6 style), Arduino Nano, DS18B20 Temperature Sensor, Resistor 4.7 kΩ, Active buzzer 5 V and Thermal fuse 72 °C.
How long does the li-po safe charging box take to build?
About 90 minutes for a intermediate maker, in 7 steps.
How do I know the li-po safe charging box works?
Two short beeps at start: Alarm works. Warm the sensor to about 38 C: Double beeps. Warm it to 45 C: Continuous alarm.
No temperature printed: what should I check?
Check the 4.7 k pull-up and wiring.
Always alarms: what should I check?
Sensor wire loose or DS18B20 pins reversed.
Fuse opens during normal charging: what should I check?
Move it away from the charger's own heat.
