โ Back to Course
Charge Controllers and Protection Circuits
โก Charge Controllers and Protection Circuits
A charge controller prevents battery over-charge and over-discharge, essential for long battery life.
๐ Charge Controller Types:
| Type | Price | Efficiency | Features | Best For |
|---|---|---|---|---|
| PWM | $3-8 | 75-80% | Simple, cheap | Small IoT systems |
| MPPT | $15-30 | 95-98% | 30% more efficient | Larger systems, cloudy areas |
| TP4056 (Lithium) | $1-2 | 85% | 1-cell charging only | Single 18650 batteries |
๐ Recommended for IoT:
TP4056 module for single 18650 + protection is the best value ($1-2). For larger systems, use a small PWM controller.
๐ TP4056 Wiring (Most common for IoT):
TP4056 Module Connections:
IN+ โ Solar Panel Positive (6V)
IN- โ Solar Panel Negative
BAT+ โ 18650 Battery Positive
BAT- โ 18650 Battery Negative
OUT+ โ ESP32 Vin (or 3.3V regulator)
OUT- โ ESP32 GND
Features:
- Charging current: 1A (adjustable)
- Over-charge protection: 4.2V cutoff
- Over-discharge protection: 2.5V cutoff
- Charging status LEDs: Red (charging), Blue (full)
๐ Battery Voltage Monitoring:
#define BATTERY_PIN 34
float readBatteryVoltage() {
int raw = analogRead(BATTERY_PIN);
// Voltage divider: 100k/100k = 2x divider
float voltage = (raw / 4095.0) * 3.3 * 2;
return voltage;
}
void checkBattery() {
float vbat = readBatteryVoltage();
if (vbat < 3.2) {
Serial.println("โ ๏ธ Battery LOW! (3.2V)");
} else if (vbat < 3.0) {
Serial.println("โ ๏ธ Battery CRITICAL! (3.0V)");
} else if (vbat > 4.2) {
Serial.println("โ ๏ธ Battery OVER VOLTAGE!");
} else {
Serial.printf("Battery: %.2fV\n", vbat);
}
// Battery percentage (Li-ion approximate)
int percent = map(vbat, 3.0, 4.2, 0, 100);
percent = constrain(percent, 0, 100);
}
๐ก Installation Tips:
- Mount charge controller in waterproof enclosure
- Use fuse between battery and controller (3A recommended)
- Check voltage weekly to diagnose issues
- Add capacitor (1000ยตF) across battery for ESP32 stability
๐ก Key Takeaways:
- Apply these concepts directly to your farm or project.
- Take notes on important details for the quiz.
- Use the button below to track your progress.
×