This project uses a Feather M4 and Trinamic's TMC-2226 stepper motor driver to enable you to take long exposures of the night sky with just about any camera. This project was designed to be a more economical project vs. commercial equatorial mount trackers. And it can easily (and cheaply) be modified and customized, a feature many other trackers lack.

This project assumes that you know how to use hand and power tools. It also assumes some experience with breadboarding and electronics. Expect this project to take you 3-6 hours to assemble and just as many, if not more, to test.

Adafruit Parts

It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox,...
$22.95
In Stock
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or...
$2.95
In Stock
A stepper motor to satisfy all your robotics needs! This 4-wire bipolar stepper has 1.8° per step for smooth motion and a nice holding torque. The motor was specified to have a max...
$14.00
In Stock
You have a stepper motor, but you need to attach it to your CNC project, eh? Not so easy if you don't have a stepper motor mount just like this fine one here! This mount will...
$8.95
In Stock
This is a cute half-size breadboard with an assortment of small jumper wires, great for prototyping. Breadboard is 2.2" x 3.4" (5.5 cm x 8.5 cm) with a standard double-strip...
$9.95
In Stock
For bread-boarding with unusual non-header-friendly surfaces, these cables will be your best friends! No longer will you have long strands of alligator clips that are grabbing little...
$7.95
In Stock
This is a beefy switching supply, for when you need a lot of power! It can supply 12V DC up to 5 Amps, running from 110V or 220V power (the plug it comes with is for US/Canada/Japan...
Out of Stock

You don't need both 12V power supplies. One is good, I just linked both because one was out of stock at the time of writing.

This is a really nice power supply. It's a switching DC supply so its small and light and efficient. It is thin so it fits in power strips without blocking other outlets. The...
$8.95
In Stock
Need a big battery for your project? This lithium ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage and over-current protection. Yet, it...
Out of Stock

Non-Adafruit parts

  • Trinamic TMC2226-BOB. This is the breakout board version of Trinamic's super quiet TMC2226 stepper motor driver. You can use just about any stepper motor driver that can microstep, but this thing is seriously very good and makes the stepper motor perfectly quiet and super smooth.
  • Astromania polar alignment scope. Polar alignment scopes are used to make sure the axis of rotation of an equatorial-mount tracker is aligned with the astronomical polar axis of the Earth.
  • Counterweights. These weights were actually designed to go on a shoulder rig that uses 15mm rods. Luckily for us, the weights have 1/4" 20 threads, which make them a good option for counterweighting your camera.
  • ARCA Swiss plate. This 220mm plate allows you to balance the counterweight.
  • Worm gear. This helps keep the rotation smooth.
  • 60 tooth 2gt pulley. Used to get smoother motion and lessen vibration.
  • 100 tooth 2gt pulley. Uset to get smoother motion and lessen vibration.
  • 2gt belt set. Used to connect the two 2gt pulleys
  • 8mm pillow block bearings. You put the 8mm rods in here to give them something to hold on to and to keep the rods pointing straight ahead.
  • 5mm to 8mm coupler. This lets you use the worm gear since I wasn't able to find any worm gears for an 8mm shaft nor any pillow block bearings for a 5mm one.
  • 8mm x 100mm shaft. You attach the belt drive and camera mount to these.
  • 5mm x 100mm shaft. You attach the worm gear to this. Make sure to choose the 5mm diameter one. There are multiple diameters on the product listing and only the 5mm diameter one will work.
  • Double 3/8" bolt. This lets you attach the camera plate mount to the rest of the device.
  • 100uf 16V or 25V capacitor.
  • Tripod. This one is not necessary, but I'd personally recommend it. You can always prop the mount up to get the desired angle if you don't have a tripod, however, tripods do make this a heck of a lot easier; They allow you to get higher off the ground and have more precise control over where you're pointing along with being easy to set up and level in a wide variety of terrains. I used a pretty old and very heavy video tripod with a fluid ball head, which worked quite well since it didn't shake even in pretty high wind.

Hardware

  • 4 M4x50mm bolts
  • 4 M4x40mm bolts
  • 8 M4 nuts. Both nylon lock nuts and normal nuts work, I just tend to prefer the lock nuts.
  • 4 M4 washers
  • 1/4" 20 x 1" bolt
  • 1/4" washer
  • 3/8" 16 x 1" bolt
  • 3/8" washer

Tools

  • Metric hex wrenches
  • SAE hex wrenches
  • Screwdriver
  • Drill press or drill. Drill presses are preferred since you don't have to worry about if you're drilling in straight, but drills work as well.
  • Drill bit set.
  • 1" spade bit
  • Wrenches or ratchets. I'd recommend a full metric and SAE set, but two adjustable wrenches would also work alright.
  • Screwdriver
  • Soldering iron. This one isn't actually necessary, but it does help if you want to tin the tips of wires.
  • Jigsaw or hand saw. Really, you could use just about any saw like a table saw, circular saw, or miter saw. I have all 3, but I used a jigsaw since it is the easiest to maneuver and perfectly straight lines aren't necessary for this project. A hand saw would work, but sawing wood by hand is never very fun.
  • Protective equipment. Be safe. Wear gloves, goggles, and any other PPE you deem fit to keep yourself safe.

Part 1: Drilling & Cutting

First, you're going to have to drill out all the holes for the parts to go into. I've included a LibreCAD document with the measurements of where the holes need to go.

Throughout this whole section, I will be referring to the piece of wood the tracker is on as 'the board' or 'the main board.'

For this part, you'll need:

  • A drill or drill press
  • A 3/8" drill bit
  • A 11/64" drill bit
  • A 1/4" drill bit
  • A 1" spade bit
  • A 3/4" (1" nominal) thick piece of wood. I used a piece of 1x12 pine that was around 18 inches long that I had left over from something else. As long as the wood has a length and width of at least 6 inches each, you should be fine, just keep in mind you will need a bit more to cut a riser for the stepper motor.
  • A saw. I used a jigsaw, but if my table saw was set up, I probably would have used that. You don't have to cut anything super straight, which is one of the reasons I was okay using the jigsaw. If you want the exercise, you can also use a hand saw, but it will just take way longer.
When using power tools, use protective eyewear and proactive safety measures. More experienced makers should help younger makers. Stay safe.

Here's the design I drew up in LibreCAD. This file can be downloaded by clicking the 'download project zip' button in the 'Code' section. For some reason, it doesn't play very well with Illustrator, but if you need to, you can always open the dxf in LibreCAD. Keep in mind this is only really intended as a guide for doing it by hand. I have no idea if this will work were you to get it laser cut.

I purposefully did not label the distances between the 1" diameter hole, the holes for the tripod plate, and the rest of the design because the location of those three holes will really depend on your setup. 

1.1 - Drill two holes for 8mm rods. I used a 3/8" drill bit for this. Yes, that is a brick holding the platform up; My drill press is really old and the clamp no longer holds the platform in place.

1.2 - Drill four holes for mounting the pillow block bearings using an 11/64" bit.

1.3  - Now, you're going to want to drill four holes for the bolts that hold the stepper motor on using the 11/64" bit. It is very important to make sure these are aligned properly. After I did the first two, I dry-fit the motor mount to make sure it was ok before continuing on to the last two.

1.4 - Cut the riser for the stepper. Mine was about 55x50mm. I cut mine out of another piece of 1x12, so it was 3/4" thick.

1.5 - Now, clamp the riser to the board and drill through it to copy the holes in the main board to the riser. You should still be using the 11/64" bit. I used two clamps and put a bolt in the newly-created hole to keep everything in place before I removed a clamp. Make sure to make a mark on the main board and riser so you remember the orientation it was in.

1.6 - Drill the hole for the polar alignment scope. I first drilled a pilot hole with the 1/4" bit and then drilled the hole with the 1" spade bit. Take extra care in making sure this one is pointing straight up and down. For spade bits, it's very helpful to have a second piece of wood under the one you're drilling into so you don't accidentally drill into whatever platform you're drilling on. Also, drill very slowly to prevent cracking the wood. This isn't the same piece of wood you've seen in the other gifs since I forgot to film it the first time around, but the idea is the same.

Make sure that there is enough space in-between the hole for the polar alignment scope and the stepper motor. At its widest, the polar alignment scope is about 2 inches in diameter.

1.7 - Drill the holes for your tripod plate. You want to make the holes close to the left/right center of mass to avoid unnecessary stress on the mounting hardware. In my case, my camera with counterweights weighs around 10 pounds, so I drilled the holes pretty near where the camera itself is mounted. The tripod plate I am using has a hole for a 3/8" bolt and a hole for a 1/4" 20 bolt. Use the same size drill bits, so a 3/8" bit for the 3/8" 16 bolt and a 1/4" bit for the 1/4" 20 bolt.

Part 2: Assembly

In this section, you will assemble the board, attaching all of the parts except for the electronics. You will need all of the parts you purchased and you will also need all the hand tools mentioned in the 'Parts & Tools" section.

2.1 - The first thing you're going to want to do is to attach the pillow block bearings. Using four M4x40mm bolts and 4 M4 nuts, tighten them up. Make sure the heads of the bolts are on the opposite side from the stepper motor so the 2gt pulleys will have enough clearance.

2.2 - Use the 5mm to 8mm shaft coupler to attach the 5mm rod to the 8mmm rod. You may want to use a Dremel to shorten these rods as I've done here, but that is not necessary. I cut the 5mm rod down to about 34mm, although you could go a bit shorter, and I cut the 8mm rod to about 90mm.

Then, insert this rod into the set of pillow block bearings nearest to where the stepper motor will go. You want the 5mm rod on the same side as the stepper motor. The bearings are self-aligning, so they may be a bit skewed. I had to put a lot of lateral pressure on the rod to get the bearing to align how I wanted it to, and even then, it wasn't very easy to fit in. If you're having trouble, you can always try the age-old technique of whacking it with a mallet until it works.

2.3 - After that, attach the 100 tooth belt drive pulley to a different 8mm rod. Mine was a very tight fit, I actually had to hammer it on with a rubber mallet. I pushed it on so there was about 12mm (0.46 inches) in-between the top of the pulley and the end of the rod. Don't put this into the pillow block bearings just yet.

2.4 - Attach your stepper motor mount with the 4 M4X50mm bolts and the four M4 nuts. I only used 3 since I slightly messed up the alignment of the fourth bolt, but that was more than enough to hold it in place very securely. Don't make this super tight as you may have to move it around a little bit to get the stepper motor properly aligned.

2.5 - Attach the stepper motor with the included mounting hardware. I know, I know, there are only 3 bolts on my stepper motor. It is possible that one of the bolts may have fallen into the black hole known as the underside of my workbench from which no hardware has returned alive.

This is also a good time to attach the worm gear. You want to attach the longer end to the 5mm shaft on the stepper motor and the one that looks more like a 'normal' gear to the 5mm rod already on the mount. Attach the gear close to the coupler, tighten it down, and then tighten the bolts on the pillow block bearings so the rod stays in place. At this point, you'll want to make sure that the motor is making good contact with the worm gear through a whole rotation. Do this by spinning the shaft the long gear is on. If it is not, remove the stepper motor and try to move or rotate the mount slightly. Do this until the worm gear is properly aligned.

2.6 - Next, attach the belt drive. Put the belt on the pulleys and then attach both of them to their respective rods, pushing them to the bottom and tightening them. My 100 tooth pulley was a very tight fit, so I actually had to attach it to the rod first, and then insert both of them into the pillow block bearings.

2.7 - Take the 3/8" male to male bolt and insert one end into the 3/8" end of the 3/8" to 8mm coupler. Tighten the 3/8" side and put it on the 8mm rod. Push it in until it won't go any further, then back out a millimeter or two. Now, loosen the 3/8" bolt and re-tighten it, making sure that it is flush with the coupler. If it is not flush with the coupler, rotate it a bit and try again. This will probably take a few tries to get right. 

If you're worried that this will not hold, I would recommend putting some super glue on the threads of one side of the 3/8" bolt.

2.8 - Screw the quick release clamp into the exposed side of the 3/8" bolt. If you want, you can hold the 3/8" to 8mm coupler with vice-grips while tightening to make sure it's pretty tight.

2.9 - Attach the tripod plate. You want to screw the bolts into the threaded part of the tripod plate you normally use to insert the 1/4" 20 or 3/8" bolt when you're mounting a camera.

2.10 - Now, you're going to want to attach the alignment scope. Note that I didn't drill the hole in the same place as you probably have. That was due to poor planning on my end causing me to run out of space. I've included a .stl in the project zip that will adapt the scope to a 1" hole. Sadly, my 3D printer is currently being a little iffy, so I wasn't able to test this. If you don't have a 3D printer, I'd recommend putting some electrical tape around the threaded portion of the alignment scope and press-fitting it. It isn't perfectly aligned in this picture. When you're taking photos, make sure it is perpendicular to the board.

Part 3: Wiring

In this section, you will hook up all the electronics.

First, you're going to want to solder headers to the TMC2226 breakout board. Solder them so that the top of the PCB (the side with the SMD components on it) is facing down.

Next, connect all the wires. I like using alligator clips to connect the stepper motor to the breadboard because they're really easy to attach and detach. Make sure that the 100uf capacitor is facing the right way. You want the side with the "-" to ground. That side often has a white stripe as an indicator. It'll be pretty obvious if you put the capacitor on backward because it will explode as soon as you apply power. Note that the Feather board in the Fritzing image is a Feather M0, however, you should be using a Feather M4. I just couldn't get the Feather M4 Fritzing part to work right. Also, the TMC2226 I've got in the Fritzing image is just a modified TSSOP-20 breakout. The pinout is the same, it's just not as wide as the TMC2226-BOB.

  • Feather pin 6 to TMC2226 STEP
  • Feather pin 5 to TMC2226 DIR
  • TMC2226 pin +Vcc IO to Feather 3V
  • TMC2226 pin MS1 to common GND
  • TMC2226 pin MS2 to Feather 3V
  • TMC2226 pin +VM to 12V
  • All TMC2226 GND pins to GND

Very important:

  • TMC2226 pin B2 goes to stepper wire B (gray)
  • TMC2226 pin B1 goes to stepper wire D (green)
  • TMC2226 pin A1 goes to stepper wire A (red)
  • TMC2226 pin A2 goes to stepper wire C (yellow)

You can power the Feather through the USB port or through the JST port. I prefer the JST port as the power banks I tried using shut off after a few minutes of powering the Feather. I've used LiPos and AAA battery enclosures and they both worked great.

To attach the breadboard, I'd recommend peeling off the piece on the bottom that covers the adhesive and then sticking it to the board.

Part 4: Mounting the Camera

You're going to want to attach a ball head to one end of the plate, and attach the weights to the other end. To balance the camera plate, attach the camera and try balancing it on top of a pencil to find the center of mass. You'll have to re-do this when framing your shot, but it's good to get a general idea how to do it when there's light.

Additionally, only use the weights you have to. It's much better for the mount to use one weight, even if you have to attach the tripod plate at the very end as I did in the time lapse gif of it moving.

CircuitPython

Your board should have CircuitPython pre-installed on the Feather M4. You can test this by plugging a USB A to micro B cable into your computer and the Feather M4. It should show up as a flash drive named CIRCUITPY in the file explorer/finder. The file boot_out.txt shows which version it is running.

If you do not have a CIRCUITPY drive, it could be that the board was previously used in an Arduino project or similar. You can flash CircuitPython using the instructions at the link below.

No external libraries are required as the needed functionality for this project is built into CircuitPython itself.

Code

Download all the files for this project by clicking the Download: Project Zip link below. Copy code.py to the CIRCUITPY root directory via your computer.

import time
import board
import digitalio

worm_ratio = 40/1
belt_ratio = 100/60
gear_ratio = worm_ratio * belt_ratio

steps = 200 # Steps per revolution
microsteps = 64 # Microstepping resolution
total_steps = steps * microsteps # Total microsteps per revolution

wait = 1/ ((gear_ratio * total_steps) / 86400)

step = digitalio.DigitalInOut(board.D6)
direct = digitalio.DigitalInOut(board.D5)

step.direction = digitalio.Direction.OUTPUT
direct.direction = digitalio.Direction.OUTPUT

direct.value = True

while True:
    step.value = True
    time.sleep(0.001)
    step.value = False
    time.sleep(wait - 0.001)

Walkthrough

In this section, I'll run through the code and what it does.

First we import the necessary libraries.

import time
import board
import digitalio

Then, we find how long we should be waiting in-between steps. This all depends on the gear ratio and how many steps per revolution the motor is making. In my case, my worm gear has a 40:1 gear ratio and my belt drive has a 100:60 gear ratio; the total gear ratio is these two values multiplied by each other, so 40*1.66, which works out to 66.67. My stepper does 200 steps per revolution, but I'm microstepping at a resolution of 64 microsteps per step, so the total steps per revolution is actually 200*64, which is 12800. I then take these values, multiply them by each other to get the number of steps I need to take in a day, and then divide that by the number of seconds in a day, 86400, to get the number of steps I need to take per second. I take that number and divide one by it to get how often I need to take those steps.

worm_ratio = 40/1
belt_ratio = 100/60
gear_ratio = worm_ratio * belt_ratio

steps = 200 # Steps per revolution
microsteps = 64 # Microstepping resolution
total_steps = steps * microsteps # Total microsteps per revolution

wait = 1 / ((gear_ratio * total_steps) / 86400)

Then, we assign the step and direction pins and set them to output. We set the direction pin to True so the motor moves counter-clockwise.

step = digitalio.DigitalInOut(board.D6)
direct = digitalio.DigitalInOut(board.D5)

step.direction = digitalio.Direction.OUTPUT
direct.direction = digitalio.Direction.OUTPUT

direct.value = True

Finally, we run the main loop. This loop just sends the stepper driver a pulse telling it to do a step and then waits the desired amount of time before sending another one.

while True:
    step.value = True
    time.sleep(0.001)
    step.value = False
    time.sleep(wait - 0.001)

Testing (very important)

It is very important to test this project before actually using it. There are a few tests that I have been running while building it that allowed me to see if it was working. I made a really bad mistake by assuming that the stepper motor would work just the same with a reversed direction. Turns out I was wrong and ended up driving out to West Virginia to leave with a picture which, even though it looked pretty cool after putting it through stacking software, was not at all what I was looking for, and could have been attained with a camera on a simple tripod. I'm not sure why this didn't work, since my 3D printer uses the exact same stepper motors and they go in both directions, but regardless of the reasons behind it, just keep in mind that direction is very important.

projects_20200730-output.jpg
What happens when your tracker doesn't actually track

Movement test

This one is quite easy. Simply change the second, longer time.sleep to something really short. I used 0.005. This test is much easier to do if you have the camera plate mounted without the camera and weights, extending it like in the picture below. Then, copy the code to the microcontroller and watch it. First check the portion of the worm gear on the motor. If you can see the bolt on that moving around, then it's working. Then, check the camera plate itself. Look through one of the holes in the plate for a few seconds, and if you can see that it's moving, then everything should be working. Facing it, the plate should be moving clockwise, and from behind, it should be moving counter-clockwise.

If when you are testing the motor, it is clicking or vibrating, then move the wire in B2 to A1, B1 to A2, A1 to B2, and A2 to B1. With the TMC2226, there should be essentially no noise or vibration.

Tracking speed test

You want to make sure that at the tracking speed, the motor is smooth and going at the right speed. If your camera plate has any bubble levels, align one of them so it the bubble is in the middle. You can do this alignment by using the code from the previous step. Then, when the bubble level is parallel to the ground, copy the code with the delay set back to the delay for your gear ratio to the device. At this point, it is really helpful to set a stopwatch on your phone. After a few minutes, you should see that the bubble is no longer in the center. This means that the mount is moving. Now, you want to verify it's moving at around the right speed. This isn't super scientific, but it verifies that the tracking isn't way off. I printed out a clock and compared it with the camera plate every hour or so for six hours. If it started off at 12 o'clock, 6 hours later, it should be at 3. To make sure the clock is reasonably level, I held my phone to the top of the paper, using the built-in 'measure' app's level (I'm on iPhone, but I'm sure there's an Android equivalent that works just as well).

Here is the very first picture I took with this mount. It's not great, but I was very happy with it since this was my very first attempt taking a tracked image of stars ever. I took 52 shots at 30 seconds each. My ISO was 160, my aperture was F/4, and my focal length was 24mm.

Camera Settings

There are so many amazing guides that go into what settings to put your camera at, so I'll just go into the basics. Keep in mind that I am a complete amateur at this, so take what I say with a grain of salt.

  • ISO. Pretty low. From what I've seen online, 100-200 seems to be what most people use.
  • Aperture. As wide as you can go.
  • Shutter Speed. 20-30 seconds seems to be the general consensus
  • Focal length: Wider is more forgiving, but you can really target a specific part of the sky with a narrower focal length. Also, if your lens has a zoom lock function on it, use it.
  • If your camera has a built-in intervalometer, make sure to test it using exactly the settings you want to use. You may have to increase the time between shots if it stops working after a few minutes, often because it doesn't have enough time in-between exposures to save the image. You can also buy an external intervalometer, I'd recommend a wireless one so you don't have to worry about the cord getting tangled up, but they aren't cheap.

Other tips

  • The further from light pollution you are, the better your images will turn out. Notice how in the image above, the sections with light pollution have dramatically less stars.
  • Be very careful not to bump your tripod. I know this may seem like common sense, but it's very important.
  • Check satellite and radar weather maps to find out if there are clouds and where they will be.
  • Get an app to help you see where constellations and the Milky Way are. I use Star Walk 2, simply because I bought it a few years ago. There may be better ones. What I like about it is it uses the orientation sensors and GPS in my phone to display where stars are as I move my phone around. Most useful for finding the Milky Way under not ideal light pollution conditions or when your eyes aren't adjusted.
  • Get one of those headlamps that also has a red light. Nothing's worse than having to turn on your phone flashlight for one second and then having to wait for a long time for your eyes to adjust to the darkness again.

This guide was first published on Aug 06, 2020. It was last updated on Aug 06, 2020.