This project uses an XIAO ESP32C3 to control a relay (or MOSFET) that powers an LED Eiffel Tower decoration for exactly 5 seconds at the top of every hour.
It's optimized for low power operation using deep sleep, and automatically syncs time using NTP with correct handling for Eastern Time and Daylight Saving.
- Turns on an output (relay, LED, etc.) for 5 seconds at the top of every hour
- Syncs time via NTP (Internet time servers)
- Automatically adjusts for Daylight Saving Time (US Eastern)
- Enters deep sleep between activations for maximum battery life
- Wi-Fi connection only used briefly when syncing
This project is configured for PlatformIO with the XIAO ESP32-C3 board.
-
Install PlatformIO IDE Extension (recommended for VS Code):
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "PlatformIO IDE"
- Install the extension
-
Install PlatformIO Core (if not using VS Code):
pip install platformio
The XIAO ESP32-C3 is a compact development board with:
- ESP32-C3 RISC-V processor
- 4MB Flash memory
- 400KB SRAM
- USB-C connector for programming
- 11 GPIO pins (including 10-bit ADC)
- Built-in LED on GPIO10
eiffle-tower-esp32/
├── platformio.ini # PlatformIO configuration
├── src/
│ ├── main.cpp # Main application code
│ ├── secrets.h # Wi-Fi credentials (create from template)
│ └── secrets_template.h # Template for Wi-Fi credentials
├── .gitignore # Git ignore rules
└── README.MD # This file
This project uses a secrets.h file to store Wi-Fi credentials.
To run it, copy src/secrets_template.h to src/secrets.h and fill in your own values:
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";- Output Pin: GPIO10 (built-in LED on XIAO ESP32-C3)
- Power: USB-C or external 3.3V supply
- Optional: Connect external relay/MOSFET to GPIO10 for higher current loads
- Open the project in VS Code
- Connect your XIAO ESP32-C3 via USB-C
- Click the PlatformIO icon in the sidebar
- Select your environment:
seeed_xiao_esp32c3 - Use the toolbar buttons:
- 🔨 Build - Compile the project
- ➡️ Upload - Upload to board
- 🔌 Monitor - View serial output
- 🧹 Clean - Clean build files
If PlatformIO doesn't automatically detect your board:
- Check USB connection and drivers
- Select correct port in PlatformIO IDE
- Verify board selection in
platformio.ini:board = seeed_xiao_esp32c3
-
Build the project:
pio run
-
Upload to board:
pio run --target upload
-
Monitor serial output:
pio device monitor
-
Build and upload in one command:
pio run --target upload --target monitor
The project outputs detailed information via Serial Monitor at 115200 baud:
- Wi-Fi connection status
- Time synchronization details
- Current time and countdown to next activation
- Sleep duration calculations
- Activation confirmations
The XIAO ESP32-C3 is optimized for low-power operation:
- Deep Sleep Mode: ~10µA current draw
- Active Mode: ~150mA during Wi-Fi and activation
- Battery Life: Months of operation on a single charge (1000mAh+ battery)
- Wake-up: Timer-based wake-up every hour
-
Upload fails:
- Check USB cable and drivers
- Hold BOOT button during upload
- Verify board selection in
platformio.ini
-
Wi-Fi connection fails:
- Verify credentials in
src/secrets.h - Check Wi-Fi signal strength
- Ensure 2.4GHz network (ESP32-C3 doesn't support 5GHz)
- Verify credentials in
-
Time sync issues:
- Check internet connection
- Verify NTP server accessibility
- Check timezone configuration
Enable debug output by modifying platformio.ini:
build_flags =
-DCORE_DEBUG_LEVEL=5 # Maximum debug outputThis project is open source. Feel free to modify and distribute.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.