- PlatformIO configuration for esp32-c3-devkitm-1 - Deep sleep cycling firmware with RTC persistence - Configurable sleep/active durations for PowerProfiler Kit II measurements - Serial debug output for monitoring boot cycles Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
63 lines
1.8 KiB
Markdown
63 lines
1.8 KiB
Markdown
# ESP32-C3 Power Measurement mit PowerProfiler Kit II
|
|
|
|
Dieses PlatformIO-Projekt misst die Stromaufnahme eines ESP32-C3 in verschiedenen Betriebszuständen (Deep Sleep, aktiv mit/ohne WLAN).
|
|
|
|
## Setup
|
|
|
|
### 1. Hardware-Verbindungen
|
|
- **PowerProfiler Kit II** → ESP32-C3 GND und VDD (Stromversorgung)
|
|
- **UART (Optional)** → RX/TX für Debug-Output
|
|
|
|
### 2. Konfiguration
|
|
Datei `include/config.h` anpassen:
|
|
- `SLEEP_DURATION_S`: Deep Sleep Dauer (Standard: 30s)
|
|
- `ACTIVE_DURATION_MS`: Zeit wach (Standard: 5s)
|
|
- `WIFI_SSID/WIFI_PASSWORD`: WLAN Credentials falls benötigt
|
|
- `TOTAL_CYCLES`: Anzahl Messvorgänge
|
|
|
|
### 3. Kompilieren & Hochladen
|
|
In VSCode mit PlatformIO:
|
|
```
|
|
Ctrl+Shift+P → PlatformIO: Build
|
|
Ctrl+Shift+P → PlatformIO: Upload
|
|
```
|
|
|
|
Oder Terminal:
|
|
```bash
|
|
pio run -e esp32-c3-devkitm-1 -t upload
|
|
```
|
|
|
|
### 4. Serial Monitor
|
|
```bash
|
|
pio device monitor -b 115200
|
|
```
|
|
|
|
## Messbetrieb
|
|
|
|
Das Programm läuft automatisch in Zyklen:
|
|
- **Boot** → 5s aktiv (LED an)
|
|
- **Deep Sleep** → 30s (minimale Stromaufnahme)
|
|
- Neustart (RTC Timer weckt auf)
|
|
|
|
Jeder Boot gibt Informationen aus:
|
|
```
|
|
Boot #1
|
|
Reset Reason: 5 (DEEPSLEEP_RESET)
|
|
Cycle: 1/20 | WiFi: OFF
|
|
Going to sleep for 30 seconds...
|
|
```
|
|
|
|
## Messaufbau mit PowerProfiler Kit II
|
|
|
|
1. **Stromversorgung**: PowerProfiler liefert Strom + misst gleichzeitig
|
|
2. **Aufzeichnung**: Mit nRF Power Profiler App (Windows/macOS/Linux)
|
|
3. **Zykluswiederholung**: Firmware weckt sich selbst auf, zyklische Messung läuft automatisch
|
|
|
|
## RTC-Memory (Persistierung)
|
|
Die Variable `bootCount` bleibt über Deep Sleep erhalten, so können mehrere Experimente hintereinander laufen.
|
|
|
|
## Erweiterungen
|
|
- WLAN Scan/Connect hinzufügen: `WiFi.begin()` in `setup()`
|
|
- GPIO-Triggers für genaue Timing-Messungen
|
|
- BLE statt WLAN für noch höhere Stromwerte
|