Simple moonlite focuser protocol implementation for Arduino and stepper motors.
Tested with Arduino Nano and cheap 28BYJ-48 stepper motor with driver and INDI / Ekos. Works also with Pololu A4988 Stepper Motor Driver (see wiring).
Updated 3D/CAD models for TS 65/420 Quadruplet are available at Thingiverse: https://www.thingiverse.com/thing:2063325 Motor focuser for Starlight Feather Touch 2" by Cover1987: https://www.thingiverse.com/thing:3593910
Change Line #13 in arduino-motorfocus.ino
from //#define USE_DRIVER
to #define USE_DRIVER
The internal pullups are active so you have to connect your buttons to GND.
You need a 4.7kΩ pullup resistor. If there is no sensor attached the temperatur will be zero.
Some people reported problems with arduino-motorfocus and Windows/ASCOM. If you use the ASCOM-Moonlite.DRO.Focuser driver the focuser doesn't appear in the setup list.
This happens because the setup opens all COM ports, sends a command and waits for a proper response. Unfortunally Windows resets the device when the port is opened (DTR is set to low) and an Arduino clone needs a second or so to boot up so it won't receive the command and the setup gets a timeout. There are multiple ways to solve the problem:
-
You can flash the MiniCore Bootloader to your Arduino. This bootloader is faster and in my tests it was fast enough to get detected by the setup
-
Just install a 10nF between RST and GND or remove the 100nF capacitor on the bottom of your Nano. You can see an image of the capacitor and further explanation on this website
-
Use a different Microcontroller like Arduino Pro Mini with an external USB-TTL converter and dont't connect the DTR line
And voilà the focuser will show up:
Same problem as above. Unfortunally the first solution, flashing the bootloader, didn't work for me but the additional capacitor between RST and GND works.
If there are different errors, please open an issue and attach the logfile. You can activate logging for you focuser in the properties setup:
The logfile is located in %HOMEPATH%\Documents\ASCOM
You can also connect an USB-TTL converter to GPIO 10 to see all commands sent by your computer and some debug messages.