ASCOM telescope focuser with Arduino

Another step has been made to have automated astrophotography setup – the focuser. SharpSky project was successfuly implemented in my second version of Astrohub, however this Astrohub has been made to work with DSLR. When I purchased ‘real’ CCD camera (Atik 314L+) Astrohub idea needed to be adjusted. I decided to built my own ASCOM controller focuser based on Arduino board. I have choosen Arduino Nano board because of its small size.

In the photo you can see Arduino Nano placed in the PCB. Under the Arduino there are hidden: L293D stepper and buzzer. Sockets at the PCB edge are for stepper motor, rotary encoder and DS1820 temperature sensor. At the same PCB there are two voltage regulators – for USB hub and for stepper motor. The project is available at page – there you will find ASCOM driver installer, Arduino sketch, required libraries for Arduino (Dallas Temperature, 1-Wire, Accel Stepper and others), all source code and quite extensive documentation, so I encourage to build your own focuser if one would like to – it is not rocket science at all 🙂

foc_3ASCOM driver was developed using available ASCOM templates. Implementation was made just to fulfill ASCOM IFocus2 interface, no additional bells and whistles. At the driver setup window you can set all the values required for the focuser to work. Focuser with driver was tested with Maxim DL software ( and it works perfectly ok. Focuser features are:

  • absolute focuser positioning
  • halt command
  • temperature focus point compensation
  • manual focus control using rotary encoder
  • stepper motor PWM duty cycle when motor not moving (prevents motor rotation under heavy focuser loads)
  • driver level backslash compensation (although its advised to use controlling application backslash if available)
  • telescope autofocus capability using 3rd party software like Maxim DL, or FocusMax
All project components were tested in ‘lab’ conditions and now are ready for field tests as soon as weather will be ready as well.

20 thoughts on “ASCOM telescope focuser with Arduino

  1. Hi nice work!! thank you for share!!! Do you have on your mind to give us more details of cosrtaction in the future? i want to construct something like this for my tair 300m but my programming skills is not so good…..

  2. Hello,
    very good job, than you for sharing your work. I have tried the 'Jolo Focuser' and … it works !!
    I used an arduino nano and a uln2003 to control an unipolar motor without problem, exept with the autofocus of SGP (sequence generator pro, e very good software) . The autofocus sequence starts but the focuser stop to work after step, but it continues to work manually (moving in and out from the SGP buttons) .
    May be you can help me.
    Thank you again. Regards.
    (ps I posted also in google group but my post seems to be lost)

  3. Hi Pascal,

    Great to hear that! Well, Ive never used SGP – it seems like may be some kind of communication problem during autofocus process. Maybe SGP have any log/debug switch so you can look into the commands sent between focuser and SGP. If no, let me know which driver version you use and I prepare another version with communication log enabled, so we will be able to check.

    Good luck!

  4. Hi Lucas,
    thank you for your quick answer, I use the 1.5 version. I received an answer from the SGP developer. They are talking about multi threading protection of the serial connection, mutex and overlapping IO, I can transfer his messagel to you if you are interested (may be with private). SGP have a log, I can send it to you also. If you want to make tests, this will be with pleasure. Thanks again.

  5. Hello Marek, thanks 🙂 I use bipolar stepper motor 1.8 deg (200 steps per revolution) for 8V and 0.3A. 8V supplies both Arduino board that has internal voltage regulator, and directly L293D stepper driver. But you can as well supply Arduino board with 12V and driver with 12V and you can adapt any bipolar motor for 9-15V and current up to 0.5A.

  6. Lukasz, what gear ratio do you use? And do you also use microstepping? I intent to do a combination of gears and microsteps to reach 5 microns per step. It leads me to idea that I can use Nema 17 with 200 steps, 1:10 gears and half stepping from Arduino. Or possibly I can use lower gear ration but more microsteps. This should be sufficient for focure's 20 mm travel per revolution 🙂

  7. Works perfectly!!!

    I had to modify the accelstepper code to work with the stepper motor I was using but got it working with maxim dl and focus max perfectly.

    Really nice job on the code 🙂

  8. I used the DUO board, and the 28BYJ-48 5-Volt stepper motor from ebay. The hardest part of the whole things was mounting it to the scope. I ended up using a gear from an inkjet printer and the band that pulls the print head back and fourth. There is no stretch in it at all, it's textured on the bottom of the band for grip. It works great and has zero backlash 🙂

    Really nice job on the code. Just had to change a few things in regards to pins I used and the setup of the motor in the stepper library but the code functioned great.

  9. Using an f/7 refractor the CFZ is 114 microns. On my 2 refractors, with a stepper motor with 200 steps, I've a resolution of 62 microns per step on the axis, and 6 microns per step on 1:10 reductor. This mean that, if i put directly the motor on the main axis, I miss the CFZ with 2 steps. If I use the half step I double the resolution, and the CFZ becomes 4 steps. Is this enough? I prefer coupling directly on the main axis for simplicity and have better torque and less error.

  10. Hi Andrea,

    I have little experience with such coupling 🙁 I always recommend to use dedcated gear box like in robofocus or couple with microfocuser shaft. Friend of mine tried to control his telescope with stepper directly coupled to main axis, but he use large motor and 1/64 microstepping and he claimed it works ok. When you use microstepping you need to remember the less microstep you work with the less torque you get.

  11. Hi lukasz, I'm planning making your focuser to fit my williams optics. I found schematic on GitHub. do u have a bill of materials available for the eagle files on GitHub.

  12. Super, thx, I will have a look. Are you still using the focuser or your setup ? Also, I don't suppose you have the PDFs in English do you

Leave a Reply

Your email address will not be published. Required fields are marked *