
Robot Sensor Project
This repository contains code for interfacing multiple VL53L5CX Time-of-Flight (ToF) sensors with a robot system. The sensors measure distance in a 4x4 grid and communicate through the I2C protocol. The sensor data is collected and formatted into a JSON object, which can be used for robot navigation, obstacle detection, or mapping.
Table of Contents
- Overview
- Features
- Hardware Requirements
- Software Requirements
- Installation
- How It Works
- Example Output
- License
- Troubleshooting
Overview
The project enables a robot to interface with multiple VL53L5CX sensors, each configured to measure distances in a 4x4 grid pattern. The robot uses these sensors to gather distance data, which is then formatted as a JSON object for easier handling and integration into robot control systems. The data can be utilized for tasks such as obstacle avoidance, path planning, and more.
Sensor Example (VL53L5CX)
The VL53L5CX sensor provides accurate distance measurements using Time-of-Flight (ToF) technology. It features a 4x4 grid of measurement zones, making it ideal for spatial awareness and environmental scanning.
Features
- Multiple Sensor Support: Handles up to four VL53L5CX sensors connected via I2C.
- Configurable Parameters: Allows setting the sensor's I2C address, resolution (8x8 grid), and ranging frequency.
- JSON Output: Collects and formats the sensor data into a JSON object, which can be easily transmitted or stored.
- LED Status Indication: Provides LED feedback to indicate when data is being processed.
- Integration Ready: Output is designed to be easily integrated into larger systems for navigation or environmental mapping.
Hardware Requirements
To run this project, you will need the following hardware:
-
Microcontroller: Any board compatible with Arduino, such as:
- RP2040 (e.g., Raspberry Pi Pico)
- STM32 boards
- SAM-based Arduino boards
-
VL53L5CX Sensors:
- At least one VL53L5CX sensor, but the project supports up to four sensors for broader coverage.
-
I2C Connections:
- Connect each sensor via I2C to the microcontroller. Ensure proper wiring and pull-up resistors are in place.
-
LED for Status:
- An onboard LED or external LED connected to the LED_BUILTIN pin for visual feedback.
Wiring Diagram Example
Below is an example wiring diagram for connecting the sensors to your microcontroller.
Make sure to connect the SCL and SDA lines for I2C communication, as well as VCC and GND for power.
Software Requirements
- Arduino IDE (or compatible IDE like PlatformIO).
-
Libraries:
- Wire: For I2C communication.
- ArduinoJson: For parsing and handling JSON data.
- VL53L5CX: Library for controlling the VL53L5CX sensors.
You can install the required libraries from the Arduino Library Manager or by downloading them from GitHub.
Installation
Step 1: Clone the Repository
First, clone the repository to your local machine:
git clone https://git-ce.rwth-aachen.de/rene.ebeling/robot-sensor.git