Introduction: Astronomical Clock Tells You When a Solar or Lunar Eclipse Happens.
Now, you can build your own astronomical timepiece with this easy-to-follow instructable. This unique clock not only tells the time but also displays the orientation of all the planets, the times of sunrise and sunset (for the moon as well), the phases of the moon, and the moon's position in its orbit.
This clock is powered by a single stepper motor. Traditionally, achieving this level of functionality in a mechanical device would require a highly complex gearing system like you find in an orrery. However, aside from the gear transmitting power from the motor to the clock, there are no additional gears. It's based on my earlier design of the planet spinner. Watch the speeder version in action to quickly see how it is doing this (build your own following this instructable).
If you think about it, a solar eclipse can only happen during a new moon (lunar eclipse only during a full moon). But it doesn't happen every new moon. Whenever it is new moon, the moon passes sometimes slightly above the Sun and sometimes below. That's because the moon's orbit is inclined at a 5-degree angle to the ecliptic (the path the sun appears to follow throughout the year).The points where the moon crosses the ecliptic are called the lunar nodes: the ascending (or North) node (Ω) when the moon moves above the ecliptic, and the descending (or South) node when it moves below. The moon crosses each nodes every 27.2 days and when that happens during a new or full moon, an eclipse happens. This clock indicates these nodes, so when a new moon coincides with a node, a solar eclipse is occurring somewhere on Earth. Yes, isn't that amazing a clock that tells you when a lunar or solar eclipse is happening
The clock rotates slowly, but once a day, it performs a back-and-forth motion to accurately position all the planets and pointers for the current day.
To create this celestial clock, you will need a 3D printer.
The creation of this clock might appear straightforward, but it was a complex process involving numerous prototypes and a substantial amount of filament.
Supplies
3d printer preferable with a 0.4 and a 0.2mm nozzle
Different colors of filament.
stepper motor 28BYJ-48
stepper motor controller TMC2209
esp32 c3 Super Mini microprocessor
hall sensor 3114e or reed switch (ali)
super glue
a strong small magnet
screws nuts and bolts for the motor and its housing.
some felt
Step 1: 3d Printing
Time to warm up your machine and start printing. Download the stl files from my google drive. Most of the parts are printed using a 0.4 mm nozzle. However the lettering and symbols are printed using a 0.2 mm nozzle. I also used the 0.2 mm nozzle for the planets, but that isn't strictly needed. 0.2 mm nozzles are very cheap, but if you don't want to use it, you could probably just print the lettering and images on normal paper and glue that to the clock. I used a dual head printer for the all the zodiac symbols, moon phases, time scale, planet symbols and moon node symbols. If you don't have a dual head machine, don't worry simply first print the base, change the filament and nozzle to 0.2mm and choose the appropriate z-offset to print the decoration.
I used a zigzag pattern for the top and bottom layers, which on my printer is at a 45 degree angle, So to get a better look most of the objects were printed rotated by 45 degrees.
I don't have a huge collection of filament colors so the planets have spectacular fresh colors (but who doesn't like a purple Neptune?). Mercury was too small so that is printed together with the blue arm it sits on, and I painted it grey.
There is a ring called brakedisk-Y. It has some tiny radial ridges. You might need to play with your layer height or initial layer height in order for them to show up on the print (I used 0.16mm). They are essential for good operation. My initial design had a similar disk for the other side of the brake where this part would rest on, but that produced a jittery motion and annoying noise, so I changed it to a disk on which you need to glue 5 small pieces of felt. It will be glued together with the moon phase base. They need a bit of weight in order to generate enough friction. In order to make them heavier, print them both completely solid (I just cranked up the number of bottom layers in the slicer).
Only a few items need a tiny bit of support.
The clock dial is a thin, flexible 3d printer layer and you print the digits and ruler on them.It is pretty big so you probably have to print that diagonally on your printer. It probably also helps to keep this part flexible. Later I improved the design so I added time_scale_empty_part, that needs to be printed in the same way and completes the circle of the dial.
There are 8 small planet base disks, and you print the symbols for the planets on them. Two 10mm disks are the base for the symbols for the nodes of the moon.
If you want to compare with my images, the things in blue end in -B.stl and the things in yellow end in -Y.stl.
The seven planets and the sun, I printed with a 0.05 layer height. This reduces the visible steps on top.
Step 2: Sanding
Sanding is an important step. You need to make sure you remove the so called elephant's foot from all the prints. After you have done that the central axle needs sanding, so the various elements can rotate very smoothly around it (there should be almost no friction). I also sanded the planets and the sun so they look super smooth. You might need a small drill to empty the holes inside each planet. They should firmly stick to the little pins on each arm.
Step 3: Super Glue
One of the early prototypes wasted a lot of support material. The final design uses super glue to prevent most of the support. It also needs the glue for some other parts.
There are 5 indicators for sunrise, sunset and the moon (it took me more than a day to just design these, so they look good). The sunrise goes on to the end of the sunrise arm, the sunset to the sunset wheel. There are two moon rise indicators which go to both ends of the moon rise arm. The remaining moon set indicator goes to, you guessed it, the moon set arm.
The sunset spacer is actually more like an axle around the central axle and it is glued to the sunset wheel.
There are eight tiny disks with the symbols of the planets on them. Glue those to the corresponding arm. Look at the second image to see which one goes where.
The Neptune arm has a part two, and you'll need to glue those together.
The item named node pointers, as space to glue the node symbols on. Put the one with the arc on top (the ascending node) to the node pointer with little tab on it. The descending symbol is the same, but upside down with the arc at the bottom. Glue that to the other node pointer.
The time scale needs to be glue to the time wheel. there are two pads on the time wheel, and you leave about 9 mm free on each of them. The time scale should be flush with the lowest part of the time wheel. Not shown in the video or pictures is the later addition of the Time_scale_empty_part which is glued on the time_wheel to fill the rest of the circle. This gives a more balanced ring, preventing problems with the clock. The time wheel thingy (for lack of a better name) goes on the side where the scale reeds 24, aligns with the pad on the wheel and the little tab is close (but not exact) to the 24 number.
With the ridges down, the brakedisk glues together with the moon phase base disk.
That's all the glue that's needed, except for the little magnet (later in this instructable)
Step 4: Electric Wiring
you need to solder a few wires between the esp32 C3 super mini processor and the rest. 5V power and GND comes from the processor board, go via a red and black wire to the TMC2209 motor controller board Vin and GND pin, from there to the Vm and GND pin on the same board and from there to the hall sensor board. Use three wires from the esp32 pin 5, 6, 7 and 21 to STP, DIR, EN and UART on the TMC2209, and a wire from pin 9 to the digital output on the hall sensor board.
You need to change the motor from unipolar to bipolar. Follow these instructions to remove a copper link in the motor and remove the red wire. Connect the four wires from the motor to the TMC2209. Blue to 1B, yellow 1A, pink 2A, orange 2B.
Step 5: Mounting Motor and Electronics
The motor is mounted on the base plate and hold in place with a pair of nuts and bolts. While mounting I discovered that the hole in the base plate wasn't big enough for the motor, but the motor fits fine after I removed the blue plastic cover completely.
Bend the Hall sensor backwards. Mount the microcontroller in the motorhousing so the usb port is towards the hole. The hall sensor board goes on top and the sensor should be right above the microcontroller. I used a bit of hot glue to keep it in place. The motorcontroller goes into an empty spot and I used a bit of double sided tape to hold it down.
This is also a good moment to temporarily power it up, just to see the leds on the hall effect sensor. You'll need a small, powerful magnet that you glue on the inside of the sunrise wheel tab. However you have to figure out which side of the magnet goes up, by watching the led on the hall effect sensor. it should react when the magnet moves over it.
Step 6: Programming
Let's get to the exciting part - programming! To get started, you'll need to download Arduino IDE (https://wiki-content.arduino.cc/en/software/) and connect your esp32 micro-controller to your computer with a USB cable.
Once you've installed Arduino IDE, go to File/Preferences and add "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json" to the line after "Additional boards manager URLs." Then select "ESP32 C3 Dev Module" (not S3) as your processor and specify the USB com port your clock is connected to.
This was all done using version 2.0.17 version of the ESP32 by Espressif. Also in the tools menu of the IDE make sure the USB CDC on boot is enabled.
To get your astronomical clock up and running, you'll need to install a few libraries, including TMC2209. You may also need to install ESPAsyncTCP and AsyncTCP.
Once you've installed the necessary libraries, download the astronomical_clock-1.04.ino file and open it in Arduino IDE. Then edit lines 7,8, and 11 with your network name, password, and timezone.
Below that edit you longitude and latitude. New York for example is 74 degrees West and 40 degrees North, so those numbers should be 74 for the longitude and 40 for the lattitude.
Next, compile the code and send it to your clock through the USB connection. In order to do so, you might need to set the esp32 into boot mode. You do this by forcing the wheel with the magnet so it is right at the back. (when it is at the correct position the second green led on the hall sensor board will light up) Now this is a clever trick, as you don't have physical access to board anymore, but it also means that if you want to boot it up normally so the program starts running, you have to make sure the magnet in not in that position.
Congratulations, you're now the proud owner of a fully-functional planetarium or at least the electronic part!
Step 7: Putting It Together
This is where the real fun begins! It's time to stack everything together and see your clock come to life. Start with the sunset wheel, followed by the sunrise arm. There are two tabs on the sunset wheel; align the pointer of the sunrise arm with the long arch between those tabs. Next, add the time wheel spacer, time wheel (orient it in such a way that the sunrise pointer is at some arbritrary time), moon set spacer, moon set arm, moon rise spacer, and moon rise arm. Top it off with the brake disk spacer, ensuring the little tab on the inside aligns with the axle. Push it down as far as it was designed to go. Make sure everything underneath it, still rotates super easily. If not, start sanding.
Now, place the brake disk base and some velt to it. In the video you will see five pieces of felt, but it turned out it needed a bit more braking power, so now the red velt goes al around.
// this brake disk base shouldn't be able to rotate, but in my first version it had quite a bit of slack. The node spacer that goes on top (see below) also doesn't move. So what I did to remove the slack is to glue those two together while they were on the clock, while rotating them against each other, so the slack is gone //
The brake disk, which is glued to the moon phase base, goes on top of the brake disk base.
You're almost done! Add the node spacer and node pointers, and then it's time for the planets. Start with the Neptune spacer and Neptune, then work your way up to Mercury. Though it's tempting to put the Sun on top right away, it's easier if you first place the zodiac disk and the little orange indicator.
Finally, the moment of pride—install the Sun and admire your stellar creation!
Step 8:
When you turn it on, the clock should start rotating counterclockwise and go through a long reset sequence. It will fetch data from NASA (for now—I'm planning to update it to work more independently) and align all the pointers and planets correctly. Once done, the clock will slowly rotate to show the correct time.
Each day, it will update the pointers for sunrise, sunset, moonrise, etcetera and the positions of the planets.
A lot of work and filament went into creating the many prototypes needed to perfect this design. If you enjoyed this project, consider donating me a coffee here.
After I uploaded the instructable, I improved the design, so the videos don't fully match the current design. Every pointer should rotate super smooth, and initially the ring with the time on it did as well. However when the sunset wheel was turning, the timewheel also very slowly moved. Initially I thought it was brushing against one of the pointers, but it turns out it did this pure on motor vibrations. In order to prefent that I added a tiny bit of silicon grease to it, so it doesn't rotate that easy any more, but that also meant adding more felt to the brake. When the clock is working the disk with the moonphases on it, shouldn't rotate, unless it is really pushed by the pointer beneath it. Basically there are two mechanisms in one, one for the planets, moonphase and moon nodes, and one for the time pointers. The last one needs a semi immoveable tab as a reference. That's the tab on the moonphase disk. That's why there is a brake. Braking power isn't very big, so everything beneath it should rotate smooth enough.