Lessons and the learning game

Build an orrery clock

Build the inner solar system on four steppers, with each arm pointing where its planet really is today, from real orbital elements and a real-time clock.

What the course teaches

Build an orrery clock is six lessons on the Uno, in three chapters:

  • The sky in numbers: orbital periods, mean longitude from the J2000 epoch with JPL's elements, and the equation of center that turns the mean into the true longitude, within about a degree for these four planets (the mean alone can be 24 degrees out for Mercury); steps a day for each arm, the best gear pair a clockmaker could cut, and why a float running total stalls where a 32-bit fixed-point fraction does not.
  • The machine: an arm per planet on 28BYJ-48s and two 74HC595s, the shortest way around, and A3144 hall sensors that home every arm to the March equinox.
  • Time and the project: days since J2000 from a DS3231, setting it in UTC, an equinox checked against the sky, and the project, the orrery set to today and wound forward with step accumulators checked against the formula.

It is a desk model, not an ephemeris. Homing and steppers in general are in Stepper motion planning. Each chapter ends in a short quiz. Open it from /learn.

The circuit

The orrery clock runs the orrdesk sketch:

  • four 28BYJ-48s, Mercury, Venus, Earth and Mars, on two daisy-chained 74HC595s (DS 11, clock 12, latch 8)
  • an A3144 hall sensor per arm on A0 to A3, under the 0 degree mark
  • a DS3231 real-time clock on A4 and A5

The checks read the arms' shaft angles and what the sketch prints. To home, you play the magnets: slide each hall sensor's distance to 0.

Troubleshooting

  • today prints but the arms do not move. Home first: slide the four hall sensors to 0, type home, then slide them back.
  • The date is wrong. Type set with year, month, day and hour, in UTC, or set the DS3231's start property.
  • An arm points a little off the printed value. One step is 0.176 degrees; the arms round to the nearest step.

Build a split-flap display, another build on 28BYJ-48s, hall sensors and shift registers.