This repository contains a set of tools for collecting and visualizing sensor data in near real-time. The toolset includes scripts for data collection, preprocessing, and 3D visualization, running in a multiprocessing environment for efficient data handling and presentation.
./Arduino/eight_Sensor/eight_Sensor.ino
- Arduino sketch for interfacing with eight VL53L5CX ToF sensors through a Qwiic Mux.data_collection.py
- Script for collecting data from sensors and storing it in a specified format.data_visualization.py
- Script for near real-time 3D visualization of the collected sensor data.both_processes.py
- Main script that orchestrates the data collection and visualization processes.data
- Folder containing pre-collected sensor data files.Demo
- Folder containing demonstration videos and images of the toolset in action.
- For the Arduino sketch, ensure you have the Arduino IDE and necessary libraries installed.
- For the python sketch, ensure you have Python 3.8 installed. Install the required dependencies by running:
pip install serial time shutil os numpy pandas pyvista scipy pillow keyboard multiprocessing
Running the data collection process (
data_collection.py
) and the Arduino Serial Monitor simultaneously may lead to conflicts, as both require access to the same serial port. Ensure that only one of these is accessing the serial port at a time.
If you are using a different port, make sure to update the port in the code (
ser = serial.Serial('COM8', 115200, timeout=0.01)
,COM8
in this case) to match your hardware setup.
Assigning addresses to the eight sensors may take approximately one and a half minutes. Please wait for about 90 seconds after powering up the system before attempting to read sensor data.
The eight_Sensor.ino
sketch is designed to interface with multiple VL53L5CX sensors using a Qwiic Mux. It initializes the sensors, sets their resolution and frequency, and continuously collects distance measurements. The data from each sensor is printed over the serial connection in an array format representing the sensor's field of view.
- Supports up to 8 VL53L5CX sensors.
- Configurable sensor resolution and ranging frequency.
- Real-time data output in an array format via the serial port.
- Connect the VL53L5CX sensors to the Qwiic Mux.
- Upload the
eight_Sensor.ino
sketch to your Arduino board. - Open the serial monitor to view the sensor data output.
To simultaneously run data collection and visualization, follow these steps:
-
Start the main script:
python both_processes.py
-
Ensure that the sensor data files are formatted correctly and placed in the 'data' directory. The visualization script will process these files in near real-time.
-
The data collection process will start first, followed by the data visualization process after a short delay.
- Can be run independently to collect sensor data.
- Allows selection of a single sensor's output or all sensors' data display based on keyboard input.
python data_collection.py
- Can be run independently to visualize pre-collected data.
- Ideal for analyzing and viewing data without active data collection.
python data_visualization.py
The data
folder contains pre-collected sensor data files, which are useful for testing and demonstration purposes. Each file in this folder represents the data collected from a sensor and is named in the format timestamp_sensor_data_sensorID.txt
. For example, a file named 1702647737.609_sensor_data_1.txt
contains data from sensor 1 collected at the specific timestamp 1702647737.609
.
- Text files with sensor data, named in the format
timestamp_sensor_data_sensorID.txt
. - Each file includes data in a structured format that can be directly used by the visualization script.