Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!

KritB's Links a Lidar Sensor to Python and JavaScript to Create Impressive Color Visualizations

Data gathered by a scanning lidar sensor are processed through Python and three.js to deliver three dimensional art.

Gareth Halfacree
5 months ago β€’ Sensors / Art / Python on Hardware

Pseudonymous maker "KritB," also known as "mars91," has combined a lidar sensor with some slick visualizations to create an impressive art piece β€” driven by an Adafruit Feather M4 Express and a PC running three.js.

"[This project is a] Full scanning lidar (Light Detection and Ranging) with graphics from three.js," KritB explains. "I wanted this device to be as straightforward as possible. Unfortunately, I had to start digging in my closet for parts. I'm sure a lot of this can be done with your own custom parts, with better design. For example, the lidar (the most expensive part!) is attached w/ two screws, a LEGO [brick], and epoxy."

A microcontroller-driven lidar sensor, some motors, a little Python, and a lot of three.js delivers eye-catching results. (πŸ“Ή: KritB)

The project actually combines two different technologies. The first will be familiar to embedded developers: an Adafruit Feather M4 Express microcontroller board controlling motors, which allows a Garmin Lidar-Lite V3 sensor to scan over an area automatically. "A system that pans 360 degrees and tilts 90 degrees will cover at least half a room," KritB notes.

Data gathered by the sensor are passed to a Python program that processes them, converting to an XYZ coordinate system, applies a color map, retrieves color values for each position, and adds a positional correction factor so that closer readings in the point cloud appear bigger. The processed data is then fed into the three.js JavaScript graphics engine, providing an impressive visualization β€” built up line-by-line as the lidar sensor spins and scans its surroundings.

The project is documented in full on KritB's Instructables page.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles