Distance Sensor

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

Obstacle detection
Proximity sensing
People counting
Gesture recognition
+ Use in Project

Technical

Sensor

Distance Sensor

VL53L5CX 8x8 Distance Sensor
Interfacei2c @ 0x29
PortsTakes 1 port; needs a port carrying i2c
Current20 mA
Size19.5 × 9.54 × 19.5 mm (CAD bounding box)
DriverVL53L5CX_Sensor

8x8 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.

What it can do
  • get_distance Get distance for a specific zone (0-63) in mmint mm
  • get_min_distance Get minimum distance across all 64 zones in mmint mm
  • get_max_distance Get maximum distance across all 64 zones in mmint mm
  • is_ready Check if sensor has data availablebool
How it works
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 */ }
Suggested control

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.

Pinout
Pinout
PinLineDirFunction
1HV–not connected
25V–not connected
33.3Vinputsupply
4GND–ground
5Data AbidirectionalI²C SDA
6Data BinputI²C SCL

from p2p/ground_truth/hardware/prototyping_line/modules/distance_sensor.md

Chip
VL53L5CXSTMicroelectronicsdatasheet ↗