Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Arduino Nano / Moonlite Protocol AF unit


BCN_Sean

Recommended Posts

This here is an AF unit I built taking some code I found for a Moonlite Protocol focuser from Github, but I've added (quite) a few modifications to it.

First thing that the code didn't have was any way to compensate for backlash, so I've worked that one in to it; and then the other big thing which annoys me with building things on to an Arduino is when it comes to setting defaults, it's either get in to the code and change lines or build in a capability for reading from an SD card.  Neither of which have ever seemed to me as an integrated solution.
In that, I've put in a function where it is possible to use the Serial Monitor in Arduino to send a few commands to the board and set the defaults that way, as well as a modified EEPROM to save them when the power is off.  To access that, once the sketch is uploaded, open the Serial Monitor, set the baud rate to 57600 (others will work, but you will have to change the first line of the sketch to match, and then upload) and really important set the serial monitor to "No Line Endings" as that can corrupt serial data.  After that, type :?# in to the Serial and send it to receive a list of what can be set (backlash compensation, default temperature, temperature compensation threshold, save/reset).

Also on that, with the drive buttons, the step forward and backwards, these have a set of options on them as well.
If the reverse button is held down at power on, it will reset the starting position of the unit to 0, useful if mounting up against a hard stop (like on the camera lens I've built it on to).
Both buttons held at power on will completely reset the internal memory and set everything back to default.

Tested and working on Indi/Ekos

The board used for this was an Arduino Nano flashed as an UNO, for all intents and purposes they are the same boards just under different packages; the pin assignments are the same for both.
The motor was a 28BYJ-48 driven through an ULN2003a; this motor will run quite happily on a standard USB port, it's a very low current affair, and doesn't tax the power output on the USB 2 on a Raspberry Pi 4 with a good power supply (though with anything like this, a powered hub would be better). 
The temperature probe is a Dallas DS18B20, this is optional as the code will detect if it's there or not.

The rest of the parts list is a 10nF ceramic cap, 330ohm resistor, a 5mm LED (any colour apart from blue!!!!), a 4k7ohm resistor for balancing the temperature sensor and a pair of non-latching push buttons, a piece of perf board and a box (as well as the final drive to focuser + mount).

The only things to note with the circuit diagram, is that the pins assigned for the motor controls and the leds show to the relative analog pin position, but within the code itself are assigned to the digital pin which shares the same pin.

Here's the circuit diagram:

683795951_UntitledSketch_schem.thumb.jpg.75fd358852fc614ba6043bf0e3cfb36c.jpg

A couple of shots of what it looks like both mounted (that's going to change, as the last thing on to the system will be the proper mounts, and then whatever optic on it) and the internals.  I've just realised that the capacitor isn't visible in the photo below as it's positioned underneath the DIP holder I've used for the ULN2003a.

IMG_20210425_135935770.thumb.jpg.9dcc77455f58264cfdc034b7b2e5d6d2.jpg

IMG_20210419_171243486.thumb.jpg.9b423002ee4c5e4c3d0d25d0b40fe99b.jpg

 

And here's the sketch, open it, read the headers as the libraries needed are linked from there; download them, copy them to your Arduino/Libraries folder (in the sketchbook); the circuit diagram is also in the zip.

Nano_Moonlite_Focuser.zip

@barbulo

  • Thanks 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.