February 4, 2018
Astro Automation for Wide Field Setups with DSLR Lenses

The goal of automation is to be able to perform all your astro-imaging functions (slewing, target acquisition, plate solving, focusing, filter changing, and image capture) without going anywhere near your telescope, mount, or camera. That’s pretty much everything except polar alignment, and every time I see those Avalon mounts with the motorized altitude and azimuth positioning I'm thinking that has to be next.

It took me a little while to work out a few complexities, but I have been running an automated astro setup for almost a year. I have every device connected and operating on the pier or tripod--on the deck or out in the backyard, controlled over wifi from inside the house on very cold nights, or when mosquitos the size of velociraptors are out hunting. On cool or bug-free nights, I’ll be outside, but well away from the gear, just to stare at the stars and look for satellites during long exposures.

The heart of any astro automation setup is going to be a computer of some kind, usually running Windows or Linux, that you, the astronomer, will remote into using a service like TeamViewer or VNC. This remote computer will sit outside, connected to your mount, scope, and camera, and will probably be running the software and drivers you enjoy using to control your devices—applications like SGP, MaxIm DL, APT, Ekos/KStars. Simply put, a basic system will allow you to sit inside the house and control a remote computer, which in turn, has all the software running to control your telescope mount, cameras, and other peripherals. There are variations on this, but you typically start with a computer and a USB hub, with everything you want to automate plugged in.

By automating “everything” I mean all the equipment supported by ASCOM or INDI, which is a lot. These are the two main protocols that underlie almost all the devices we use to manage and schedule our astro imaging equipment. (I should also include the OS and device-specific drivers and apps many manufacturers also provide—e.g., see the Moonlite Focuser app below). I have an Orion Atlas EQ-G and an iOptron CEM25P, Atik, ZWO, and QHY cameras, motorized filter wheels and focusers, all the typical stuff that can be controlled through software, running on a machine that you control from a distance (usually over wifi, but a wired network is also common). After polar alignment, I operate my setup remotely. I don't go near the mount again until I'm ready to tear down and bring it all inside.

Here's the typical arrangement of the devices necessary for automated astro imaging, depending of course on the targets you're shooting, type of composition, field of view, the kind of astro-imaging that interests you. If you are an astrophotographer taking long exposure frames of deep sky objects--nebulae, galaxies, then you probably have these five controllable astronomical components: mount, primary camera, filter wheel, focuser, and guide camera. You may not have filters if you're shooting in color. Or you may have more, such as an observatory with a motorized roll-off roof or dome rotation, field rotators, motorized caps or flats, sky cams, weather monitors, multiple OTAs with cameras.

Okay, back to the project.

After having all my stuff running for a while, I wanted to bring the final piece of the automation puzzle to my wide-field setup. I have a Geoptik Nikon lens to CCD adapter, which sits in the middle of everything. I'm typically going to use the Atik 414EX mono CCD or the QHY5III178 color CMOS with the Nikon lens. For guiding I'm going to use a William Optics 50mm scope with a ZWO ASI120MM-S camera, which mounts to that angled piece of aluminum you see in the video and pics below. Notice that everything about this wide-field system can be remotely controlled except the focusing of the Nikon lens.

Before we get to focusing automation, let's look at what I'm focusing, because after some tinkering and prototyping, I selected this lens specifically for this purpose. I have several Nikon lenses that could work, but I went with my old Nikon 18-200mm f/3.5-5.6 lens, mostly because the focus ring rotates in-position--not helical, moving forward and back with the glass. (This is how my Nikon 180mm f/2.8 works--it's fast, heavy, and very solid, but it has manual focus with a capital M, and it will take more than one of the little 28BYJ Steppers to move it). Another advantage of the the 18-200 focus ring is that it's rotationally infinite--is that what it's called? The ring doesn't have a stop, or end point, but continues to spin without affecting focus beyond the minimum focus range and after reaching infinity. This allowed me to use the Moonlite Focuser protocol with a stepper motor to rotate the focus ring without having to worry about limits.

On top of these advantages, the Nikon 18-200mm is a nice all-purpose lens, ED glass, with aspherical lens elements, sharp to the edge at 18mm and at 200mm. Obviously, this is a huge range for a field of view--going from wide angle to telephoto. At 18mm with the QHY camera it's something like 23° x 16° (1406' x 938'). That’s most of the constellation Orion! The main optical downside is that it's a DX lens, suitable for sensors up to APS-C, but it vignettes like a bad photographic cliché with larger sensors. (I haven't used this lens since I moved to the full-frame D750 a couple years ago).

So, back to the real problem: the lack of focus automation when this 18-200mm lens is not attached to a Nikon camera. I did some research on DIY motorized focusers, and there's a lot of cool stuff out there. My requirements were fairly simple: it had to work under Linux on the Raspberry Pi, which is what I use to run Ekos/KStars/INDI, but it would be nice if it ran under SGP with ASCOM. This led right to a thread on the forums at (links to all this stuff below) that started with a discussion on using the Moonlite Focuser protocol and commands. From there I ordered and started prototyping with 28BYJ-48 stepper motors and the ULN2003 driver board connected to an Arduino (tested out both the Uno and Nano). See links below for purchasing details--they’re inexpensive. I bought a pack of five stepper motors and driver boards for under $13 USD.

I used pretty standard parts--standard, because I ordered most of it from Amazon. (See the parts list below). There are a couple pieces I scrounged from other projects and components, like the L-bracket that just worked perfectly for adjusting the belt tension, which I took from a cheap follow focus device (about $35 at Amazon), but any L bracket with a slot for sliding will work.

Here’s the wiring diagram for an Arduino Uno, 28BYJ-48 stepper motor, and ULN2003 motor driver board.

And here’s the system running:

Here's my working stup with the Atik 414EX mono CCD and Pentax 200mm f/4, with WO50/ZWO Guide cam:

ARDUINO CODE: here's the Moonlite Focuser protocol code I'm using, lifted from the following INDI forum discussion, along with a few mods to support an Arduino Nano:

Main thread on the INDI forums that started me down the path of making my own focuser for DSLR lenses:

Here's a screenshot of the Moonlight Single Focuser application working with my new homemade DLSR lens autofocus.

Moonlite Focuser Downloads Page - ASCOM drivers and the Single Focuser App (Non-ASCOM)
And a couple screenshots of the Ekos configuration page and focus module working with my new homemade focuser, identified as a Moonlite Focuser. I am running with this with the focus speed set to 2.

INDI / Ekos - INDI is a cross-platform astronomical control protocol. Ekos is built on top of INDI, and combines all the control functions under a single app. Ekos, along with KStars, allows an astronomer to perform everything from plate-solving to slewing to the right target, from large scheduled mosaics to meridian flips.
Parts and product information:
28BYJ-48 Mounting Bracket:
Pack of 10pcs 320-2GT-6 Industrial Timing Belt L=320mm W=6mm 160 Teeth
5PCS Aluminum GT2 Timing Belt Pulley 16 Teeth Bore 5mm Width 6mm
5 Pack Geared Stepper Motor 28byj-48 Uln2003 5v Stepper Motor Uln2003 Driver Board for arduino
L-bracket from the Neewer Follow Focus with Gear Ring Belt
SmallRig Multi-purpose Switching Plate for Rail block
Geoptik Adaptor for Nikon lenses to T2 for CCD cameras
Nikon 18-200mm f/3.5-5.6 lens
Arduino UNO ATMEGA328P

Other interesting projects using the 28BYJ-48 Stepper Motor with Arduino:

Nikon lens technical page:




Here's the latest version, but continue on to see where I started with my Astro-controller experiments.

I just finished setting up version 2 of my astro-controller, with both a Raspberry Pi 3 running Ubuntu MATE and a mini Intel-based machine running Windows 10 64-bit--and USB 3.0 and an SD Card slot! I've been running Ekos/KStars/INDI on Ubuntu MATE for a while now, and I don't see going back to ASCOM + SGP as my main astro workflow anytime soon. (And I don't say that lightly. Sequence Generator Pro is one of the most complete, powerful, and easy to use observatory control applications on Windows).

I do have one other option: I haven't tried running the Ekos/KStars/INDI set in the VM under Windows. I suppose it's possible to run everything on this 4.72"/120mm square Windows machine. Okay, I admit a single aggregated system is an interesting idea, but it's tough to beat the Raspberry Pi for a tiny yet powerful, inexpensive, ARM-based system with four USB ports--and everything booting off a micro-SD that can be backed up at regular intervals, and restored in minutes. (And at $35 a board, I have a couple, ready to swap in if something catastrophic happens). The complexity of a Windows10/UbuntuVM all sharing processing power and one set of USB ports tipped me in favor of two separate lightweight systems, both bundled together and easily moved between my two astro setups, William Optics GT-81 and Astro-Tech RC. (The whole bundle is easy to move, mounted on its own dovetail clamp. See the pics for details).

My overall purpose here is to get the best of all astro worlds in one bundle--everything I love about Ekos/KStars/INDI under Ubuntu, and everything I love about the apps that use ASCOM under the hood--or that simply have better drivers or options under Windows because the engineers for some manufacturers favor the OS, such as QHY. (I have used my QHY5III178 CMOS camera with both the INDI drivers and native Windows drivers, and it's just a fact: there's more there under Windows. Same goes for the QHY Polemaster). I continue to use digiCamControl under Windows when I use my Nikon D750 for color subs. This is a full-frame sensor, so the raw files are large, and I haven't been impressed with the D750 on the Raspberry Pi 3 in terms of the transfer time for each image. INDI/Ekos fully supports most Nikon DSLRs, but in this case with digiCmControl, I'm just used to the app--been using it for years. In fact, I started out in astrophotography shooting the moon and a few larger DSOs (M31, M42) using digiCamControl to capture images and control the camera. (I can hear you ask, "why not BackyardNikon?", and I agree that it's powerful and full of features, but digiCamControl is free and has a fairly complete feature set--certainly enough to continue using it). I also have the Atik drivers and Artemis app installed, as well as Nebulosity 4 for managing FITS files and for doing other image-related stuff. Finally, I have installed the closest thing to Ekos that I have used under Windows, Sequence Generator Pro (SGP) by Main Sequence Software. SGPro is amazing--it combines all the loosely scattered ASCOM processes, apps, and control functions under one application, and I would recommend it to anyone using Windows for astrophotography.

So, there you go. I put this new astro-controller setup together in order to have everything INDI and ASCOM offer, and everything that Linux and Windows can offer--and all for around $200 USD. It allows me to control the mount, plate-solve, and guide with one, while taking subs with the other. I remote into Windows from my Macbook Pro using TeamViewer, and I use VNC when I need to remote control the Raspberry Pi. Ekos and INDI have complete remote control operations built-in at a deep level, allowing me (if I ever needed it!) to control multiple observatories, each with multiple astro setups. A couple more details: everything, from the mount up, runs off 12vdc, split between one 12v 7amp line. The Raspberry Pi runs off 5vdc, and I'm powering it off the GPIO pins with 12v stepped down to 5v using a voltage converter (5v 3A Switch-mode UBEC). I only use the GL.iNet GL-AR150 wifi router when I'm using my astro set up away from the house. To mount these boxes on the dovetail clamp I use 3M Extreme Mounting Tape, which becomes terrifyingly sticky and extremely useful when bonding things together, like small astro devices to dovetail clamps, or jet engines to commercial airplane wings.

Here's the new controller setup fully connected and running on my William Optics GT-81, testing out some of the functions, and downloading the astrometry data on the Windows system before I make the cabling nice and neat.

Summer 2017
An OTA mounted control module that allows you to remotely manage your astro rig

Let's begin with some common problems: cable management is one of the problems that started me down this path, but the main problem is the weight and inconvenience that comes along with the duplication of power cables (most running 12 vdc 1 - 2.5 amps), and communications (USB) cables that need to plug into the main CCD, guide CCD, focuser, filter wheel, and mount--five USB cables running from my control box, up the mount, and then to each of the devices. I don't have anything unusual in my setup, and my expectation is that these five devices are the most common in any astro imaging rig. My hope is that anything I'm building and testing here will be useful to many.

Here are some shots of my gear, with a dozen power and comms cables running from the "control box" to all the devices. I have built in a lot of slack so that cables don't pull from sockets when the scope heads toward the zenith or the opposite horizon. And I have spent considerable time learning, through trial-and-error, where to tie-down and loop the cable bundle so that its weight doesn't affect tracking or guiding.

The Goal
I want to have fewer cables running to the mount. Ideally I will end up with just a single power cord--12 vdc--running to an OTA-mounted control box. That's where all the communications (via USB) will begin--and end, with each of the devices all within inches of the USB hub. The following plan shows what I'm building, sketched out over lunch. The idea is to make a control box that's mounted with, to, or under the OTA, possibly inline between the saddle and scope. My prototype is mounted on top, bolted to a dovetail I have running along the GT-81's "handle" for the guide scope.

Another goal is to enclose or fix the electronics components (Astro controller, power converters, USB hub, focuser module, dew controller) to 1/4" (6.35 mm) aluminum, or something equally as rigid, drillable/tappable that can be mounted with the OTA and not shake or move about during gotos or tracking. I'm thinking of this as a DIY, inexpensive version of the "EAGLE - Control unit for telescopes and astrophotography" by Primaluce Lab ( The main difference--as far as functionality--is the Eagle runs Windows, along with the availability of ASCOM, EQMOD, SGP, MaximDL, etc., while I'm running linux on a Raspberry Pi with Indi, KStars, and Ekos. But you can replace the "astro controller" and any of the software in this scheme with an equally small Windows machine and your favorite astro software. From a hardware standpoint the goal is the same: an OTA mounted control module that allows you to remotely manage your astro rig.

The Prototype
Going by the pic below of my prototype OTA-mounted astro controller it may look as if my cabling problems have increased--okay, yeah, I admit looks a bit sloppy right now. The important thing to notice is that I have a single 12 vdc wire running the whole thing. That's it. No more "cable harness" with five USB cables and five power cables bundled up and running to various points on the mount, scope, guider, filter, ccd, and dew controller.

Power and Comms for Components:
  • 1. Atik 414ex Main CCD (USB, 12vdc)
  • 2. Atik EFW2 Filter Wheel (USB, 12vdc)
  • 3. Raspberry Pi3/Ubuntu Mate Astro Controller (5vdc)
  • 4. ZWO ASI 120MM-S Guide Camera (USB 3)
  • 5. Focus Module - FCUSB (USB)
  • 6. Orion Atlas EQ-G or iOptron CEM25P (USB to Serial, 12vdc)
  • 7. Dew Control for William Optics GT-81, WO 5mm guide scope

Here's a pic of my GT-81 setup from October 2017, with everything mounted on a smaller aluminum plate, and the system has a dedicated wifi router that I use to control everything remotely.


Follow, friend, communicate

Saltwater Witch copyright © 2017 Chris Howard