
Distance Sensor
8x8 zone distance sensor array with up to 400cm range
Advanced distance sensor with 8x8 zone array. Provides accurate distance measurements up to 400cm with multi-zone detection.
For ages 14 and up. Not a toy. Contains small parts: choking hazard. Keep away from children under 3. Adult supervision recommended.
Made by Atech ApS, Lille Strandstræde 6A, st. th., 1254 København K, Denmark.
Technical specifications
- Part
- VL53L5CX 8x8 Distance Sensor
- Interface
- I2C (0x29)
- Ports
- 1 port
- Current
- ~20 mA
- Size
- 19.5 x 19.5 x 9.5 mm
- Chip
- VL53L5CX (STMicroelectronics)
Pins
- 3.3V
- supply
- GND
- ground
- Data A
- I²C SDA
- Data B
- I²C SCL
Key features
- 8x8 zone array
- Up to 400cm range
- Fast measurement rate
- Ambient light immunity
Common applications
Technical
Distance Sensor
VL53L5CX 8x8 Distance Sensor8x8 multi-zone Time-of-Flight distance sensor (up to 4m). Provides 64 distance measurements in a grid. Background RTOS task ranges at 15Hz, so readings are instant. SCL on Line A, SDA on Line B.
get_distanceGet distance for a specific zone (0-63) in mmint mmget_min_distanceGet minimum distance across all 64 zones in mmint mmget_max_distanceGet maximum distance across all 64 zones in mmint mmis_readyCheck if sensor has data availablebool
VL53L5CX DISTANCE SENSOR: RESPONSIVE PRESENCE PATTERN:
- Readings are instant (background task at 15Hz). getMinDistance() returns the
closest object across all 64 zones in mm. IMPORTANT: when NOTHING is in range it
returns the sentinel 32767, not -1 and not 0. So `getMinDistance() < THRESHOLD`
already means "something is in front within THRESHOLD mm" and is false when empty.
- The most common request is "do X when something is in front" (play a sound, light
up, show something). Implement this as a RESPONSIVE, EDGE-TRIGGERED presence detector:
* Keep a `static bool present` across loops. Fire the action ONCE on the rising
edge (was absent → now present). Stop/clear the action on the falling edge
(now absent). The instant something comes back, it fires AGAIN.
* Default trigger distance ~300mm unless the user gives a distance.
* Use HYSTERESIS to kill boundary flicker, NOT a cooldown: enter when
`minDist < ENTER` (e.g. 300mm), leave only when `minDist > EXIT` (e.g. 400mm).
This debounces noise without adding any delay.
- DO NOT add a multi-second "ready again" / cooldown timer before it can re-trigger.
Re-arm immediately on the falling edge so re-entry replays instantly. A cooldown
makes it feel laggy and is almost never what the user wants.
- Respond within ~1 reading (~70ms). Do not gate the detection behind a slow
EveryTimer. Only rate-limit outbound stream/log events, never the trigger itself.
- Skeleton:
static bool present = false;
int16_t d = sensor.getMinDistance();
if (!present && d < 300) { present = true; /* entered: start action */ }
else if (present && d > 400) { present = false; /* left: stop action */ }An 8x8 heatmap where each cell's color encodes distance (warmer = closer, cooler = farther). Above the heatmap show min/max/mean readouts in real time. Optionally overlay a hover tooltip showing exact mm per zone.
| Pin | Line | Dir | Function |
|---|---|---|---|
| 1 | HV | – | not connected |
| 2 | 5V | – | not connected |
| 3 | 3.3V | input | supply |
| 4 | GND | – | ground |
| 5 | Data A | bidirectional | I²C SDA |
| 6 | Data B | input | I²C SCL |
from p2p/ground_truth/hardware/prototyping_line/modules/distance_sensor.md
