โ Back to Course
Deep Sleep for Battery Operation
๐ Deep Sleep Power Saving
ESP8266 deep sleep reduces power to 20ฮผA - perfect for solar-powered sensors!
๐ Deep Sleep Code:
#includeconst char* ssid = "YOUR_WIFI"; const char* password = "YOUR_PASSWORD"; void setup() { Serial.begin(115200); // Connect and send data WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) delay(500); // Send sensor data here Serial.println("Sending data..."); Serial.println("Going to deep sleep for 5 minutes"); ESP.deepSleep(5 * 60 * 1000000); // 5 minutes in microseconds } void loop() { // Empty - never runs }
๐ Battery Life Calculation:
- Wake time: 3 seconds @ 70mA = 0.058mAh per cycle
- Sleep time: 5 minutes @ 0.02mA = 0.0017mAh per cycle
- Total per 5 minutes: ~0.06mAh
- Daily consumption: 0.06 ร 288 = 17mAh
- 2000mAh battery lasts: 2000 รท 17 = 117 days!
๐ก Important:
Connect GPIO16 to RST pin for deep sleep wake-up! Without this connection, ESP8266 won't wake.
๐ก 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.
×