OC
OceanRemote
Low-code IoT platform
โ† 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:

TypePriceEfficiencyFeaturesBest For
PWM$3-875-80%Simple, cheapSmall IoT systems
MPPT$15-3095-98%30% more efficientLarger systems, cloudy areas
TP4056 (Lithium)$1-285%1-cell charging onlySingle 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.