← 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.
×