Stack-chan drawn from M5Stack's models, with four Unit ToF4M sensors in a square on top of its head
Back to projects
Internship projectFeatured

Stack-chan LiDAR

I turned Stack-chan into a LiDAR by putting four distance sensors on its head and letting its servos sweep them across a room. Its camera colours the points, and any browser on the same Wi-Fi shows the scan in 3D as it builds.

Built with
ESP32-S3PlatformIOBlender

Internship project at M5Stack, November 2026. Stack-chan (CoreS3), PaHub, four Unit ToF4M, C++ and WebGL.

Over Stack-chan's shoulder, its sensor cone reaching the wall while the scan fills in around the room
01

Sweeping the room

Stack-chan turns its head across the room a few degrees at a time and stops at every step to measure how far away the wall is. The servos give the direction and the sensors give the distance, so every step adds a point in 3D. This is the real scan from the demo, filling in as the head pans across.

Quick, Normal or Fine

Before a scan I pick Quick, Normal or Fine. Quick is done in under a minute, and Fine takes longer but picks up much more detail.

The finished scan from outside the room in the camera's colours
02

Colour from its camera

Before it sweeps, Stack-chan takes photos of the area with the CoreS3’s camera. The browser then places every pixel of those photos at the distance the sensors measured in that direction, which turns a grid of readings into 68,206 coloured points.

Lining up the photos

The camera sits below the sensors, so the photos and the distances are taken from slightly different places. I lined them up by matching the edges in the depth to the edges in the photos, and the colours now land in the right place on most of the room, though not everywhere.

Demo

I put Stack-chan on a table in the corner of an empty room and started a scan from my laptop. The video shows the head sweeping while the points build up in the browser, and then the finished scan from every side, first coloured by distance and then by the camera.

Try the scan

The finished scan from above: the walls and ceiling of a room corner, with a blue box on the table
Download this scan

Make one

  • Stack-chan, M5Stack’s little robot, which has a CoreS3 for a head on two servos. Its ESP32-S3 runs the scan, the web server and the camera.
  • Four Unit ToF4M, which are VL53L1X time-of-flight distance sensors, mounted in a square on top of the head.
  • A PaHub, which lets the four sensors share one Grove port even though they all have the same I2C address.
The real Stack-chan with the four sensors on its head and their Grove cables looping down to the back
The real Stack-chan with its sensors
  1. Plug a PaHub into Stack-chan’s Port A and the four Unit ToF4M into its channels 0 to 3, then mount the sensors on top of the head facing forward.
  2. Open Flashdeck in Chrome or Edge, choose Stack-chan LiDAR, plug Stack-chan in over USB-C and press Install.
  3. Join the StackChan-LiDAR Wi-Fi network it starts and open http://192.168.4.1/, which Stack-chan also shows when you tap its face. Then pick an area and a level of detail and start a scan.

The Stack-chan on this page is built from M5Stack’s own 3D models (M5_Hardware, MIT licence).

More to explore

Other projects

Personal
OCR Reader with DrumNet, an OCR water meter solution

OCR Reader

A battery-powered water meter reader where a 693K-parameter DrumNet pipeline on an ESP32-S3 reads the drums and reports over LoRaWAN, built on a custom KiCad PCB inside a 3D-printed shell.

Personal
Project June rover

Project June

A 5G rover with three live camera feeds, GPS, a laser pointer and seven sensors, driven from a web console.

Internship
Pip, a cyan desk pet, on the M5Stack Tab5

Pip

A desk pet on an M5Stack Tab5 whose brain is the DeepSeek Harness on my server, so it can drive a browser, build its own apps and watch my other agents.