What you build
A light painting stick. Walk it past a camera with the shutter held open, and as it plays a picture one column at a time, the photo shows the whole picture hanging in the dark.
- The stick: a 16-LED WS2812 strip on pin 6, LED 0 at the bottom.
- START: an arcade button on pin 2.
- The speed knob: a 10k potentiometer on A0.
- The pictures: a microSD module on the SPI pins, CS on 10.
- The brain: an Arduino Uno, in place of the ESP32 many sticks use.
How it works
One column of pixels. The stick is a single column 16 pixels tall, and a column is a 16-bit number: bit 0 is the bottom LED.
Pictures stored sideways. A picture is a list of columns, left to right, the order they are played. Text is built from a 5x7 font, each pixel doubled to fill the stick.
Real BMP files. A 24-bit BMP has a 54-byte header, then the pixels: rows stored bottom row first, three bytes a pixel in blue, green, red order, and every row padded with zeros to a multiple of four bytes. A 10-pixel row is 30 bytes plus 2 of padding.
Timing for a walk. On the photo a column is as wide as the distance walked while it shows: at 1.4 m/s, 1.4 mm per millisecond. Matching the column width to the LED spacing keeps circles round.
The camera. A tripod, manual mode, ISO 100, f/8, focus fixed by hand, and a shutter longer than the countdown plus the painting. The stick blinks a three-second countdown to sync with it.
The course
Build a light painting stick has six lessons, all on the same wiring:
- LED columns: one column of pixels as a number.
- Images to columns: pictures and words stored sideways.
- SD bitmaps: a real BMP, written and read back.
- Timing: column time and walking speed.
- Long exposures: camera settings and a countdown.
- Project: write your name in light: your name, in a rainbow.
Every step is checked against the running circuit, apart from the last, where you make the stick your own and share it.