ESP32 · IoT Device
A motion-sensing IoT device that reads acceleration with a 3-axis IMU, exchanges packets with a paired unit over 433 MHz RF, displays multi-screen information on an OLED, and streams live sensor data via WebSocket to a companion web app. BLE provisioning, pocket detection, and deep-sleep power management make it ready for real-world carry.
Exchanges RadioHead-framed packets with a second identical device. Detects when a paired unit comes into range and displays the RF message count on the OLED overview screen.
MPU6050 delivers accelerometer readings at ~10 Hz over a WebSocket connection. Each frame is a JSON payload with ax, ay, az, rfCount, rfMessages, and a timestamp.
The companion web app connects over Bluetooth and writes the WiFi SSID and password to GATT characteristics. The device notifies CONNECTED:<ip>:81 when online.
Navigates between screens with two hardware buttons. Screens include an overview (RF count, WiFi status), detailed RF stats, custom message display, and animated boot logo.
A digital light sensor on GPIO 16 forces the screen off when the device is in a pocket. The OLED turns back on automatically the moment light is detected again.
Enters deep sleep after 30 seconds of no accelerometer motion. GPIO 14 (BTN_NEXT, an RTC GPIO) is the wake source via ext0. Power consumption drops to microamp range during sleep.
| # | Component | GPIO / Bus | Notes |
|---|---|---|---|
| 1 | ESP32 DevKit (38-pin) | — | Any standard ESP32 devkit; 3.3 V logic |
| 2 | MPU6050 accelerometer | SDA 25 · SCL 26 | I2C address 0x68 (AD0 → GND) |
| 3 | SSD1306 OLED 128×64 | SDA 25 · SCL 26 | Shared I2C bus with MPU6050 |
| 4 | 433 MHz RF TX module | GPIO 32 | RadioHead 2000 bps; ~17 cm wire antenna |
| 5 | 433 MHz RF RX module | GPIO 33 | XY-MK-5V, RXB6, or similar |
| 6 | Button NEXT | GPIO 14 → GND | Internal pull-up; also RTC wake source |
| 7 | Button PREV | GPIO 18 → GND | Hold 3 s triggers factory reset |
| 8 | Digital light sensor | GPIO 16 | HIGH = dark (pocket); toggles screen |
Upload port defaults to /dev/cu.usbserial-0001 in
platformio.ini — change it to match your machine.
Once provisioned, CrossWave broadcasts JSON on ws://<ip>:81 at ~10 Hz. Send MSG:<text> to update the custom message shown on the OLED.