Back to projects

Hardware · Shipped 2024

3D Scanner

An Arduino-driven pan-tilt scanner that sweeps an IR sensor across an object and reconstructs its shape in MATLAB — calibrated optics, clean serial pipeline, real results.

Year
2024
Role
Team of 2 (with Liam Carlin)
Stack
Arduino, C++, MATLAB, 3D Printing, IR Sensors
3D scanner apparatus scanning a star-shaped object

Overview

We built a 3D scanner from an IR distance sensor and two servos arranged as a pan-tilt rig. An Arduino Uno collects distance measurements across two axes and streams them to MATLAB, which reconstructs the object as a 2D depth map. The project ties together mechanical design, electronics, and a data pipeline into one working instrument.

How it works

The rig sweeps the sensor vertically (0–90°) while logging distance, then rotates one degree horizontally and repeats — building a grid of depth values that MATLAB renders with imagesc().

MATLAB depth-map reconstruction of a scanned star

The challenge

Three things had to be right at once: a mechanically stable rig that didn’t wobble, electrical connections that survived continuous servo motion, and an IR sensor calibrated accurately across its range.

Approach

  • Mechanical — a 3D-printed, low-center-of-gravity apparatus using a rack-and-pinion for smooth, controlled tilt.
  • Calibration — we fit a voltage-to-distance curve in MATLAB and derived d = 49.3511 / (V − 0.2317), then validated it against held-out points and thresholded out unreliable readings beyond 40 cm.
  • Pipeline — Arduino formats readings as CSV for clean hand-off to MATLAB, with a 150 ms settle delay tuned to balance speed against data quality.

3D-printed scanner mechanism (CAD)

Outcome

Scanning a star-shaped test object produced a clear reconstruction — correct scale, recognizable geometry, even the gap in the center — with only minor angular distortion. Full methodology, schematics, and error analysis are in the project report.

What I learned

Calibration is everything: the difference between a noisy toy and a usable instrument was the curve fit and the thresholding around it. I’d next improve cable management to prevent mid-scan disconnects and write CSV directly to file instead of scraping the serial monitor.