For a few years now I’ve remote operated my LX90 and associated imaging gear via indilib over wifi using an olimex A20 stored below the scope. With my eye on a zero image shift focuser and a lack of spare ports on the USB hub coupled with an urge to not increase the cables and control boxes even futher, it’s time for a change and a new “hat”.

Pi Hat

My current plan is to switch to the Raspberry PI3 which has built in wifi (olimex has to use a usb dongle) as well as four USB ports (olimex has two hence the USB hub with my current setup). I’ll need three of those USB ports for the main ccd camera, guide camera and filter wheel.

In addition by building a PI “Hat” I can switch the LX90 from a USB RS232 dongle to the PIs serial interface which leaves one USB port spare for future gear. The moonlite focuser, which uses a unipolar stepper motor, can be controlled via GPIO pins and a controller chip (DRV8805) and finally a 1-wire temp sensor will ensure re-focusing occurs if the temp changes enough to impact the scopes focus.

Whilst the PI is not running a real-time OS and may not be accurate enough to drive a stepper, the use of the DRV8805 avoids the issue allowing the PI to just control the step and direction lines.

The overall size of my setup will be reduced to the point I can fit everything in a small box mounted to one of the LX90’s fork arms and ground cables will drop to just two power lines. One to power the dew controller and the second to power the Pi, scope and associated imaging gear.

That’s the plan anyway, having created only a few circuits in the past, the PicPedal 2.0 being the most recent and I’ve never made a PCB before so I’m expecting a few issues.

RS232 Prototyping

The LX90 Autostar provides an RS232 interface to control the telescope over a serial link from a PC or in this case a Raspberry PI.

By default the PI3 ties up the uart with a serial console for linux boot messages/login. This can be disabled manually or via the raspi-config.

In addition the PI3 exposes a miniuart to the GPIO 14 & 15 pins rather than the full hardware uart which is instead used by the bluetooth chip. The software uart can have “issues” as it’s dependent on the PIs clock speed which can change based on CPU load if you don’t lock it down in your config. A better option when bluetooth is not required is to disable it and swap back to the hardware uart.

config.txt needs the following adding:


The overlay disables the bluetooth interface and remaps the main uart back to the PIs gpio 14 & 15 pins rather than the miniuart.

The final PI hat should be able to auto configure this via eeprom however one step remains that cannot be done automatically, disabling the bluetooth modem which binds to the uart

  systemctl disable hciuart

With the above changes in place and user account added to the dialout group, the serial port is now usable via /dev/ttyAMA0 or /dev/serial0 on newer installs which will be mapped to ttyAMA0 or ttyS0 depending on whether the bluetooth module is using the hardware uart or not.

Signal Levels

The Pi uses 3.3v TTL whilst the autostar expects RS232 at +-12v levels, a high enough level to damage the PI if connected directly. The ST3232 (pin compatible with the max232) powered from the PI’s 3.3v header pin is used to convert between 3.3v and +-12V RS232 signal levels.

The 3232 is simple to use, but prototyping provided an excuse to test RS232 decoding out on the oscilloscope.

PI3 to LX90 Autostar via rs232

PI3 to LX90 Autostar via rs232

Decoding Right Ascension request.

Decoding Right Ascension request.

The first photo shows the Raspberry PI3 connected to an ST3232 along with a handful of decoupling caps and a connection (just behind the breadboard) to the serial cable which runs to the LX90 autostar handbox.

The second image shows the oscilloscope signal capture of the #:GR# command which is a request for the LX90 to return its current right ascension, in this case 20:24:40 with a terminating #.

With serial comms rather painlessly out of the way, next up is the DS18B20 temp sensor and finally the DRV8805.

Schematic and PCB layout will be covered in a future post once I’ve verified their accuracy. I may also make a post giving an overview of the custom indilib driver that will be required to use the DRV8805/focuser with indilib.