(Yeah the frontend is vibe-coded, didn't have enough time)
Look into dev branch for sketches / code
It wasnt a cube in the end.
Watch. Preserve. Transmit.
SentiCube is a modular, compact IoT device designed to monitor motion, orientation, distance, environmental conditions and sound. It works out-of-the-box in local mode and can optionally connect to a cloud dashboard (ThingsBoard) for remote monitoring and logging.
-
ESP32-U with external antenna for reliable Wi-Fi connectivity
-
Distance measurement: VL53L0X / VL53L1X Time-of-Flight (ToF) sensor
-
Orientation / motion: MPU-6050 (Gyroscope + Accelerometer)
-
Magnetic heading: QMC5883P Magnetometer (Compass)
-
Environmental sensing: AHT10 Temperature & Humidity sensor
-
Sound detection: INMP441 I2S microphone
-
Local web interface served by ESP32 for setup & monitoring
-
Wi-Fi provisioning using Wi-FiManager (ESP32 hotspot)
-
Optional cloud integration with ThingsBoard
-
Hybrid wake logic:
- Wakes on motion, sound, or distance events
- Periodic heartbeat every 10 to 15 minutes to update readings
- Offline logging to SD card if cloud or Wi-Fi is unavailable
SentiCube supports an optional secondary cube that communicates with the main unit using LoRa. This backup cube operates within the same room (or nearby) and sends sensor data to the primary cube, which then handles Wi-Fi/cloud communication.
- Primary cube: Wi-Fi + ThingsBoard + LoRa receiver
- Secondary cube: LoRa transmitter (can run without Wi-Fi)
- Enables redundancy, extended coverage, and offline resilience
If the primary cube loses Wi-Fi, data from both cubes is stored locally and uploaded once connectivity is restored. Even if the primary cube is destroyed, the secondary cube will persist the data.
- Power SentiCube → ESP32 creates a Wi-Fi hotspot (
SentiCube-XXXX). - Connect to the hotspot using a phone or laptop.
- A local web page (captive portal) opens automatically.
- Monitor local sensor readings immediately, no internet required.
SentiCube can optionally stream data to ThingsBoard:
-
Cloud token setup:
- After purchasing cloud access, the user receives a unique token.
- This token is entered in the local web page served by the ESP32.
- The cube is manually added to the ThingsBoard instance (admin side) using the same token.
-
Cube connects to Wi-Fi using credentials provided in the local portal.
-
Cube publishes telemetry to ThingsBoard (MQTT/HTTP), allowing real-time monitoring from any device.
Note: Each cube stores the token and Wi-Fi credentials persistently, allowing automatic reconnection.
SentiCube supports an optional secondary “Mirror Cube” connected via LoRa for redundancy and local visibility:
-
The primary cube continues normal operation (local + cloud mode).
-
In parallel, the primary cube sends a copy of all telemetry data via LoRa.
-
The mirror cube only receives this data (it does not generate or transmit its own data).
-
The mirror cube can:
- Display received sensor values locally
- Store data as a backup log (optional SD card)
- Act as a fallback monitoring point if cloud or Wi-Fi is unavailable
Note: The mirror cube is fully optional and not required for system operation. It functions purely as a redundant receiver for extended reliability and local backup visibility.
| Sensor / Component | Function | Connection Notes |
|---|---|---|
| ESP32-U | Microcontroller & Wi-Fi | External antenna for better reception |
| VL53L0X / VL53L1X | Time-of-Flight distance | I2C, recommend 3.3v |
| INMP441 | I2S microphone | I2S interface |
| MPU-6050 (GY-521) | Gyroscope + Accelerometer | I2C, uses INT for motion interrupts |
| QMC5883P | Magnetometer / Compass | I2C |
| AHT10 | Temperature & Humidity | I2C |
| 18650 Battery Shield | Rechargeable Battery Pack | VIN and GND |
| MicroSD Module | Offline data logging | SPI interface, stores queued events |
| SX1278 RA-02 (LoRa Module) | Wireless communication (Primary ↔ Mirror Cube) | SPI interface, 3.3V only, used for LoRa mirror/backup link |
| 100 µF capacitor | Stabilize Voltage | VCC and GND before the LoRa Module |
| 680 µF capacitor | Stabilize Voltage | VCC and GND after the battery pack |
- ESP32 Board definitions for Arduino IDE
- Adafruit VL53L0X / VL53L1X Library
- Adafruit MPU6050 Library
- QMC5883P Magnetometer Library
- Adafruit AHT10 Library
- WiFiManager - for hotspot-based Wi-Fi provisioning
- PubSubClient / HTTPClient - for ThingsBoard MQTT/HTTP publishing
- I2S Library - for INMP441 microphone (sound library)
- SD / SPI Library
- Sandeep Mistry LoRa library
- Flash the ESP32 with the SentiCube firmware.
- Power the cube → ESP32 hotspot appears (
SentiCube-XXXX). - Connect to the hotspot → local web page opens.
- Optional: monitor local sensor readings immediately.
- Obtain a ThingsBoard token from the admin (project owner).
- Connect to SentiCube hotspot → open local web page.
- Enter:
- Wi-Fi SSID & password
- Cloud token
- Cube stores credentials and token → reboots
- Cube automatically connects to home Wi-Fi and starts streaming telemetry to ThingsBoard.
- Log in to ThingsBoard dashboard → monitor your cube remotely.
Optional: cube supports multiple sensors streaming simultaneously with thresholds, events and logging. Offline events are stored on the SD card and uploaded when connectivity is restored.
{
"temperature": 24.7,
"humidity": 50.2,
"distance_mm": 120,
"pitch": 1.2,
"roll": -0.3,
"yaw": 45.0,
"mag_x": 123,
"mag_y": -45,
"mag_z": 67,
"sound_level": 56,
"event_logged": true,
"last_upload_status": "pending"
}- Cube can operate fully offline using local web interface.
- Cloud mode requires Wi-Fi and valid token.
- Ensure I2C addresses don't conflict if using multiple modules on same bus.
- Use INT pins from MPU6050 or ToF sensor for motion-triggered events.
- Use EEPROM / SPIFFS or SD card to persist Wi-Fi credentials, cloud token and queued events for delayed upload.
This project is for educational and prototyping purposes. You may freely modify the code for learning and experimentation.