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

Barn-door star tracker for night-sky photos

Two hinged boards on a tripod open at exactly the speed the sky turns, so your camera can take long exposures of stars without trails. A 28BYJ-48 stepper turns a threaded rod, and an Arduino Nano corrects the timing for the barn-door geometry.

IntermediateBuild time: 6-10 hours (plus ~10 h printing)Parts: $85-1353D print
Illustration of Barn-door star tracker for night-sky photos
Illustration. An artist's impression, not a photo of a finished build. Your build will look different.

Safety first

  • Observe at night only with a buddy or tell someone where you are; watch for trip hazards and traffic.
  • Keep the tracker stable: a top-heavy camera can tip a tripod. Hang a bag on the tripod for weight.
  • Use only a red flashlight on site so you do not ruin your own or others' night vision.

Rules and laws

  • Respect private property and park hours. Some dark-sky parks require permits for night access.

Parts

PartQtyApprox. eachSubtotal
28BYJ-48 stepper motor with ULN2003 driver (5-pack)One set used; spares are handy. Typical $9-15, no verified link.Amazon (search)1$12$12
ELEGOO Nano V3.0 board (3-pack)Typical $13-20, no verified link.Amazon (search)1$17$17
M6 threaded rod, 1 m (1.0 mm pitch)Metric coarse M6 has a 1.0 mm pitch, which makes the math easy. Typical $6-11, no verified link.Amazon (search)1$8$8
M6 coupling nuts and nuts (pack)Typical $5-9, no verified link.Amazon (search)1$7$7
3-inch steel butt hinge (pair)A tight, wobble-free hinge matters more than its size. Typical $6-11, no verified link.Amazon (search)1$8$8
1/2-inch plywood project panel, 12 x 24 inchTypical $11-20, no verified link.Amazon (search)1$15$15
1/4-20 mini ball headTypical $9-18, no verified link.Amazon (search)1$12$12
1/4-20 tripod mounting screw and T-nut setTypical $5-10, no verified link.Amazon (search)1$7$7
12 mm momentary push button (10-pack)Rewind button. Typical $4-8, no verified link.Amazon (search)1$6$6
Steel mending plate, 2 inch (pack)Hard pad where the rod tip pushes the top board. Typical $3-8, no verified link.Amazon (search)1$5$5
Anker PowerCore 10000 USB power bankSkip if you already own one. Powers the Nano and stepper over USB for a whole night. Typical $18-28, no verified link.Amazon (search)1$22$22
Estimated total (parts only)$119

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 150 g (50.3 m), roughly 10 h of printing.

PLA, 0.2 mm layers, 30% infill, 4 walls for the motor mount, rod coupler and sight tube.

AI agents you'll use

  • Code helper (ChatGPT, Claude, Gemini or Grok): Writes the Nano sketch with a tangent-corrected step rate for your exact hinge-to-rod distance, plus a rewind button.
  • Astro planner: Helps you pick targets, exposure times and a dark-sky location for your camera and lens, and explains polar alignment.

Tools

  • Saw and drill
  • Ruler and square
  • Soldering iron
  • A camera you already own that takes long exposures
  • A sturdy tripod you already own
  • Red flashlight

What you'll learn

  • Why the sky appears to rotate once per sidereal day
  • Barn-door tracker geometry and tangent error
  • Precise stepper timing with a microcontroller
  • Polar alignment on Polaris

Take night-sky photos with pin-sharp stars and the Milky Way glowing behind them. A barn-door tracker is a famous DIY classic: two boards, a hinge and a slowly turning screw.

What you'll build

Two plywood boards joined by a hinge, with the hinge pointed at the celestial pole. A 28BYJ-48 stepper on the bottom board turns an M6 rod that pushes the top board open. With a 1.0 mm pitch and the rod 228.6 mm from the hinge, one turn per minute matches the sky's rotation (2 pi radians every 1436 minutes). The Nano speeds the motor up slowly through the night to cancel the tangent error of a straight rod. The camera sits on a ball head on the top board.

The cost range is $85-135. The low end assumes you already own these items marked "skip if you already own one": Anker PowerCore 10000 USB power bank. The high end includes them.

Print the parts

Print a motor mount, a coupler from the motor shaft to the M6 rod, a rod tip that pushes on a metal plate, and a sight tube that runs parallel to the hinge for aiming at Polaris.

Wiring

From To Notes
28BYJ-48 ULN2003 board (keyed plug)
ULN2003 IN1-IN4 Nano D8, D9, D10, D11 Pin order matters for the Stepper library; see the code prompt.
ULN2003 + / - Nano 5V / GND About 240 mA; fine from USB.
Rewind button Nano D2 and GND INPUT_PULLUP.
Power bank Nano USB

Step-by-step

  1. Cut two boards, join them with the hinge, and measure 228.6 mm from the hinge pin to where the rod passes through.
  2. Fit the T-nut for the tripod and the ball head.
  3. Mount the motor and coupler, and thread the rod through a nut fixed in the bottom board.
  4. Calibrate steps per turn: the 28BYJ-48 gear ratio is not exactly 64:1, so count how many steps make the rod turn exactly 10 times.
  5. Flash the tangent-corrected sketch.
  6. At night, aim the hinge sight tube at Polaris, start the tracker, and take 30-second test shots with a wide lens.
  7. Increase exposure time until stars start to trail, then back off.

Code

Arduino IDE with the built-in Stepper library or direct step timing; the step rate is computed from your measured radius and steps per turn.

Prompt for the code helper:

Write an Arduino Nano sketch for a barn-door star tracker: 28BYJ-48 via ULN2003 on D8-D11 (use the correct coil order for the Stepper library), M6 rod with 1.0 mm pitch at radius R = 228.6 mm from the hinge, STEPS_PER_REV calibrated (start with 2038).
Compute the required rod length L(t) = R tan(theta) with theta = 2 pi t / 86164.1 s, and step whenever the rod position falls behind, using micros() for timing. Rewind button on D2 runs the motor backward fast while held. Print the elapsed time and angle every 10 s.

Troubleshooting

  • Stars trail sideways: Polar alignment is off. Re-aim the hinge at Polaris (slightly off the true pole).
  • Stars trail along the motion: Steps per turn or radius is wrong. Recalibrate and re-measure.
  • Motor skips: The camera is too heavy or the rod binds. Lighten the load and lubricate the rod.

Files, code and docs

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

Barn-door star tracker for night-sky photos: parts, filament and AI agents | Ai Me Bro