Hardware Components
Each parking sensor unit consists of:ESP32 Development Board
The main microcontroller that handles:
- WiFi connectivity to backend services
- Sensor data processing
- LED control logic
- State synchronization with cloud
VL53L0X Time-of-Flight Sensor
Laser-based distance sensor that:
- Measures distances up to 2000mm
- Uses I2C communication protocol
- Provides accurate occupancy detection
- Low power consumption
ESP32 Specifications
The firmware is designed for ESP32 boards with the following requirements:| Feature | Specification |
|---|---|
| CPU | Dual-core Tensilica LX6 |
| WiFi | 802.11 b/g/n (2.4 GHz) |
| GPIO Pins | Minimum 3 required for LED |
| I2C | Required for VL53L0X sensor |
| Flash | 4MB recommended |
| Operating Voltage | 3.3V |
Pin Configuration
The default pin configuration fromS-Parking.ino:9-11:
GPIO pin for red LED channel (common anode, active LOW)
GPIO pin for green LED channel (common anode, active LOW)
GPIO pin for blue LED channel (reserved, not used for amber)
Sensor Types
VL53L0X Time-of-Flight Sensor
The Adafruit VL53L0X sensor uses laser-based ToF technology: Technical Specifications:- Range: 30mm to 2000mm
- Accuracy: ±3% at typical distances
- Interface: I2C (address 0x29)
- Voltage: 2.6V to 3.5V
- Field of View: 25°
- More accurate than ultrasonic sensors
- Not affected by object color or reflectivity
- Fast measurement cycle (500ms in our implementation)
- Reliable in various lighting conditions
LED Indicators
The system uses a common anode RGB LED with inverted logic:Color States
State Priority Logic
FromS-Parking.ino:173-191, the LED update logic follows this priority:
- Physical presence overrides everything - If sensor detects a car, show RED
- Reservation status - If no car but cloud shows reserved (status=2), show AMBER
- Available - If no car and no reservation, show GREEN
Timing and Intervals
The firmware uses two timing loops fromS-Parking.ino:30-31:
Sensor reading frequency - checked every 0.5 seconds for immediate response when cars park
Cloud synchronization frequency - checked every 15 seconds for reservation updates
- Fast sensor reads ensure immediate red light when cars arrive
- Slower cloud polls reduce network traffic and API costs
- This asymmetric design balances responsiveness with efficiency
Next Steps
ESP32 Setup
Configure your ESP32 and flash the firmware
Sensor Calibration
Calibrate VL53L0X sensors and set distance thresholds
LED Indicators
Wire and configure RGB LED indicators