How to Make a Star Tracker

by Phillip Le in Circuits > Arduino

79 Views, 1 Favorites, 0 Comments

How to Make a Star Tracker

IMG_7566.jpg

Ever wanted to take pictures of the night sky and actually get images of the stars and moon? Well I have! The main issue with taking a picture is you’d have to take a long exposure image, but doing so means you’ll get a blurry (albeit cool) mess of the sky, as the stars and moon move.

That’s right, we’re making a camera spin to track the skies, this is a Star Tracker, a device used by astrophotographers and astronomers to counter the Earth’s rotation and get an accurate image or look of the night sky. We’re making a smaller version of a star tracker that can be mounted onto a tripod.

To build it enlisted the help of my two friends, Minh Doan and David Contreras, who helped with the modeling and assembly of the mechanism. At its core, a Star Tracker is a slowly spinning platform, going West to East, 180 degrees, 0.00417 degrees per second.

Supplies

Items:

  1. Camera tripod
  2. ESP-32
  3. NEMA 17 Stepper Motor
  4. A4988 Stepper Motor Driver
  5. 0.96 Inch OLED I2C IIC Display Module
  6. 7.4V Lipo Battery 5200mAh
  7. ½ Inch Steel Pipe
  8. Metal rod
  9. 608 Ball bearings
  10. M3 Socket head screws
  11. M3 Grub screws
  12. Threaded inserts of various assortments
  13. Breadboard
  14. QMC5888L - 3 axis Magnetic sensor
  15. 12V Boost Converter
  16. 5V Buck Converter
  17. Power Switch
  18. Microswitch

Tools:

  1. 3D Printer
  2. Calipers
  3. Dremel
  4. Pliers
  5. Soldering Station
  6. Hammer

Design

Screenshot 2026-01-05 232902.png
Screenshot 2026-01-05 233316.png
Final.png

The first step of the process was making a rough sketch of our design.

This was the idea that I came up with to make the camera move in an arc/circular motion, similarly to how the stars move in the sky.

To “Make it Spin” we decided to use motors and a gear system.

A stepper motor was used because I found it easier to use as I had prior experience, and it had the precision that we needed for the project.

We calculated the amount of torque needed to move the camera (measured to be 1.5 kilograms) and used a gear ratio of 8:16 which had just enough torque (0.09 Nm) to spin the camera.

We locked in the big gears with ball bearings attached to the walls of our design, and we attached the small gear to the motor by using threaded inserts + grub screws.

What we didn’t originally account for in the sketch was the stress that the weight of the camera would have on the axle. We fixed this by extending our walls circularly and extended bars out which would then ride the walls, giving support to the axle.


Electronic Enclosures

david4.png
david3.png
David2.png
David1.png

Next we needed to make an enclosure to house our ESP32, battery, and our magnetic sensor. The original design roughly showed the base of foundation of our enclosure. After working out what was needed from the enclosure between the team our final design. The ESP32 and the magnetic sensor lie within the enclosure. The display is placed on top of the lid for convenience. Our final battery we selected was bigger than initially expected thus we decided to make a separate enclosure for the battery that placed on opposite ends from the ESP32 enclosure.

Programming & Electrical

The programming was simple, essentially what we needed to do was make the motor move slowly over 10-ish hours, and after calculating the equivalence of 1 step after the 1/16th and 1:2 ratio reduction, we decided on moving it every 13.5 seconds. I used an ESP-32 and programmed it using the Arduino IDE. Libraries used were QMC5883L, AccelStepper, and Wire.h.

When it came to the electrical, we went with a pretty hefty battery, a 7.4V LiPo with 5200mAh, chosen to last a stepper motor long enough for 10 hours. When paired with a boost and a buck converter, we can get 5V and 12V split, one to power the ESP-32 and related peripherals (which would then be converted to 3.3V), and one to the stepper motor and the A4988 driver. Our chosen GPIO ended up being, 21 and 22 for I2C (the screen and compass), 12 for the motor power button, 27 for the motor end stop, and 25, 26 (STEP AND DIR) for the stepper motor.


Downloads

Assembly

IMG_1183.jpg

To assemble everything we used a combination of threaded inserts, glue, and brute force. We screwed in the main components of our design but hammered in other parts such as the ball bearings. To increase structural integrity, we also hammered metal bars into the inside of our design. We then wired all the electronics together and enclosed them.

Review

IMG_6121.jpg

One of our regrets is that due to the cloudy weather we weren't able to take a picture of the stars before the deadline of the competition. However, I am really proud of the idea and proud of the work me and my friends did. Nothing we did was fully based off of tutorials videos, or copied from online. This is something we were passionate/had a vision about and we made it really far with he amount of time that we had. Although we couldn't take a picture of the sky at the end, I'm sure the stars kept spinning around us.