Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Solar-Powered ESP32-C3 LED Lighting System with Deep Sleep Conservation

View and Edit Project In Cirkit DesignerImage of Solar-Powered ESP32-C3 LED Lighting System with Deep Sleep Conservation

Solar-Powered LED Circuit Documentation

Summary

This circuit is designed to power an LED using a solar panel that charges a 18650 Li-Ion battery. The system is controlled by an XIAO ESP32C3 microcontroller, which drives the LED and manages power consumption by entering deep sleep mode to conserve energy when not in use. The charging of the battery is regulated by a CN3065 Solar Charge controller, ensuring safe and efficient charging from the solar panel. The circuit includes resistors for current limiting and voltage reference purposes.

Component List

Solar Panel

18650 Li-Ion Battery

CN3065 Solar Charge Controller

XIAO ESP32C3 Microcontroller

LED (Yellow, Two Pin)

Resistors

Wiring Details

Solar Panel

18650 Li-Ion Battery

CN3065 Solar Charge Controller

XIAO ESP32C3 Microcontroller

LED (Yellow, Two Pin)

Resistors

Documented Code

/*
 * This Arduino Sketch is for an ESP32-C3 microcontroller that drives one or
 * more LED lights. The microcontroller is powered by a 18650 Li-Ion battery,
 * which is charged by a solar panel through a CN3065 Solar Charge controller.
 * The microcontroller will use deep sleep mode during the day and when not in
 * use to conserve power.
 */

#define LED_PIN GPIO2 // Define the GPIO pin connected to the LED

void setup() {
  pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output
  digitalWrite(LED_PIN, LOW); // Ensure the LED is off initially
  esp_sleep_enable_timer_wakeup(10 * 60 * 1000000); // Wake up every 10 minutes
  esp_deep_sleep_start(); // Enter deep sleep mode
}

void loop() {
  // This code will run after waking up from deep sleep
  digitalWrite(LED_PIN, HIGH); // Turn on the LED
  delay(1000); // Keep the LED on for 1 second
  digitalWrite(LED_PIN, LOW); // Turn off the LED
  esp_deep_sleep_start(); // Enter deep sleep mode again
}

Filename: sketch.ino

Description: The code configures the microcontroller to drive an LED connected to GPIO2. It uses deep sleep mode to conserve power, waking up every 10 minutes to briefly turn on the LED for 1 second before going back to sleep.