LiDAR Monitor :Unihiker + Ylidar X2

LiDAR Monitor: Unihiker + YDLIDAR X2

This project demonstrates how to build a LiDAR monitoring system using the Unihiker board and the YDLIDAR X2 sensor. The Unihiker, with its built-in touchscreen and Python support, serves as the main controller and display unit. The YDLIDAR X2 provides 360-degree distance scanning, allowing the system to detect objects and visualize the environment in real-time.

The project highlights:

Hardware integration: Connecting the YDLIDAR X2 to the Unihiker through USB.

Real-time visualization: Displaying LiDAR scan data on Unihiker’s touchscreen as a radar-like map.

Portability: A compact setup that does not require an external PC for monitoring.

Applications: Obstacle detection, indoor mapping, or educational demonstrations of LiDAR technology.

This setup provides a low-cost and interactive way to learn about LiDAR and data visualization using Python on embedded hardware.

Key Features

-360° real-time visualization

-Auto-scaled graph to fit the screen (320x480)

-Connection status display (Connected / Disconnected / Reconnecting)

-Start and Stop buttons to control scanning

-Filters out data that is too close (< 0.1 m) or beyond the max range (> 10 m) for a cleaner graph view

Key Code Components

-LidarX2("/dev/ttyUSB0"): Opens connection to the LiDAR via USB

-Matplotlib + Tkinter: Draws a scatter plot to display LiDAR points

Usage

1.Connect the YDLIDAR X2 to the Unihiker’s USB port

2.Run the code on the board

3.Press Start to begin scanning — blue points will appear, showing objects around you

4.Press Stop to stop scanning

CODE:

License
All Rights
Reserved
licensBg
0