AI1 0 1 1 0 1 0 0 1 1 0 10 1 0 0 1 1 0 1 0 1 1 0 1Ai Me Bro

Garage parking assistant with a lidar and traffic light

A wall-mounted TF-Luna lidar measures how far your bumper is, and an LED strip glows green, yellow, then red when you reach the perfect spot. An ESP32 runs it from a 5 V supply and can report to Home Assistant.

BeginnerBuild time: 3-5 hours (plus ~5 h printing)Parts: $60-803D print
Illustration of Garage parking assistant with a lidar and traffic light
Illustration. An artist's impression, not a photo of a finished build. Your build will look different.

Safety first

  • Use a listed 5 V plug-in supply. Do not wire into the garage door opener or mains.
  • The TF-Luna is a Class 1 infrared laser device (eye-safe in normal use per Benewake); still do not stare into it up close.
  • Mount the box where the car cannot hit it, and do not rely on it alone: keep a wheel stop if a collision would damage the wall.

Parts

PartQtyApprox. eachSubtotal
Espressif ESP32-DevKitC-32E (DevKitC V4) development boardOfficial Espressif 38-pin DevKitC V4 with ESP32-WROOM-32E (4 MB). Micro-USB port, not USB-C. Buy only the official 38-pin Micro-USB board, not a USB-C or 30-pin clone. Primary listing: Mouser 356-ESP32-DEVKITC32E, $10.20, 1,701 in stock on Nov 12, 2026, per Findchips (https://www.findchips.com/search/ESP32-DEVKITC-32E). The Mouser US page itself returned 403 to a direct fetch, so click-confirm the US storefront before you order. Mouser Netherlands listed 1,622 in stock at €8.60 the same day. Do not use DigiKey as the default today (search snippets showed 0 in stock / long lead time). Official Amazon listing https://www.amazon.com/dp/B09MQJWQN2 was still unavailable; use it if it returns. Amazon search for the official board: https://www.amazon.com/s?k=ESP32-DevKitC-32E. Adafruit #3269 remains $15.00 and was out of stock (https://www.adafruit.com/product/3269). Typical $10-16.Mouser1$10.20$10.20
Benewake TF-Luna lidar range sensor0.2-8 m range, 3.3 V UART. Typical $20-32, no verified link.Amazon (search)1$25$25
BTF-LIGHTING WS2812B LED strip, 60 LED/m, 1 mTypical $8-14, no verified link.Amazon (search)1$10$10
5 V 3 A DC power supply with barrel adapterTypical $9-15, no verified link.Amazon (search)1$12$12
SN74AHCT125N level shifterLifts the ESP32 3.3 V data line to 5 V for the LED strip. Typical $3-8, no verified link.Amazon (search)1$5$5
1000 uF 10 V electrolytic capacitorAcross the LED strip power input. Typical $0.5-2, no verified link.Amazon (search)1$0.80$0.80
330 ohm resistorIn series with the LED data line. Typical $0.1-1, no verified link.Amazon (search)1$0.20$0.20
40-pin 20 cm female-to-female jumper wiresCatalog ASIN. Typical $4-8.Amazon1$5.50$5.50
Estimated total (parts only)$68.70

Typical US prices, checked 2026-11-12. Prices change and multi-packs are often cheaper per piece.

As an Amazon Associate I earn from qualifying purchases. Prices change; check the store.

Filament

PLA (1.75 mm): about 89 g (29.9 m), roughly 9 h of printing.

PLA, 0.2 mm layers, 15% infill, 2 walls (the settings the v1 files were sliced with); print three LED channels and three diffusers. Print the LED diffuser in white or natural PLA.

AI agents you'll use

  • Code helper (ChatGPT, Claude, Gemini or Grok): Writes the ESP32 sketch: read TF-Luna distance over UART, smooth it, and set the strip color with hysteresis and an auto-off timer.
  • Home Assistant helper: Optionally turns the sketch into an ESPHome config or adds MQTT so Home Assistant knows whether the car is parked.

Tools

  • Soldering iron
  • Drill and wall anchors
  • Tape measure
  • USB data cable

What you'll learn

  • Reading a UART lidar
  • Driving addressable LEDs safely
  • Hysteresis so lights do not flicker
  • Optional Home Assistant sensors

No more tennis ball on a string. Pull in until the light turns red, and you are parked in exactly the same spot every time.

What you'll build

A small printed sensor box at bumper height and a 60 cm LED bar on the wall in front of the car. The ESP32 reads distance from the TF-Luna about 10 times a second. Far away the bar is green, it fills with yellow as you approach, and turns solid red at the stop distance you set. It turns itself off after the car has been still for a minute.

The cost range is $60-80 for the parts listed below, allowing about 10% either way for price swings.

Print the parts

Print a box for the TF-Luna with a clear window opening (no plastic in front of the lens) and a channel with a diffuser for the LED strip. A simple design works; ask the AI helper to help you model one in a CAD tool.

Wiring

From To Notes
TF-Luna 5V / GND 5 V supply + / - TF-Luna runs on 5 V; its UART is 3.3 V logic.
TF-Luna TX / RX ESP32 GPIO16 (RX2) / GPIO17 (TX2) Leave the I2C/UART select pin unconnected for UART (check the datasheet).
ESP32 GPIO5 74AHCT125 input, output through 330 ohm to strip DIN 74AHCT125 powered from 5 V; tie its OE pin to GND.
LED strip 5V / GND 5 V supply, with the 1000 uF capacitor across them
ESP32 5V/VIN / GND 5 V supply Common ground with the strip and sensor.

Step-by-step

  1. Wire the TF-Luna and print distances to Serial.
  2. Wire the level shifter and strip, and run a FastLED test at low brightness.
  3. Park the car where you want it and note the distance reading.
  4. Write the color logic with a hysteresis band and an auto-off timer.
  5. Print and mount the boxes and route the wires neatly.
  6. Optional: add MQTT or ESPHome so Home Assistant sees "car parked".

Code

Arduino-ESP32 with FastLED. The TF-Luna UART frame is 9 bytes starting with 0x59 0x59; the code helper can parse it from the datasheet.

Prompt for the code helper:

Write an Arduino-ESP32 sketch: read a Benewake TF-Luna on Serial2 (GPIO16 RX, GPIO17 TX, 115200 baud, 9-byte frames starting 0x59 0x59), take a median of 5 readings.
Drive 36 WS2812B LEDs on GPIO5 with FastLED: green above 200 cm, a yellow bar filling from 200 cm to STOP_CM + 10, solid red at or under STOP_CM.
Add 3 cm hysteresis, cap brightness at 40%, and turn the strip off after 60 s without a change bigger than 5 cm.

Troubleshooting

  • Readings jump around: Sunlight or a shiny bumper. Aim at a flat part of the bumper and take a median.
  • LEDs flicker or show wrong colors: Missing level shifter or common ground. Check both.
  • Lights stay on: The auto-off threshold is too tight for sensor noise. Raise it a little.

Last checked 2026-11-12. Double-check parts against your own board and seller listings before you buy.

Garage parking assistant with a lidar and traffic light: parts, filament and AI agents | Ai Me Bro