Close
0%
0%

Raspberry Pi Driven Telescope Mount

full telescope control over WiFi using INDI on a RPi Zero W

Similar projects worth following
This project focuses on gaining remote computer control of a Celestron telescope mount, as well as adding the ability to use a more ergonomic joystick for slewing while at the scope. To achieve these goals, a Raspberry Pi Zero W was integrated into the hand controller while still allowing normal operation of the scope mount. Once integrated, the RPi was then configured to allow remote control using either a cell phone or a laptop running open source astronomy software.

Motivation

While there are existing mounts that are WiFi capable, none of them give the flexibility of a system running Linux. If I have SSH access to my scope, I can do pretty much anything. With this in mind, the Raspberry Pi Zero W is also only $10, and the difference in price between the Celestron Evolution and the SE series is over $500. While there are far more features in the Evolution than just WiFi, if this is your only reasoning for the upgrade, it's tough to rationalize this additional expense. Likewise, there is no equatorial mount with WiFi available in the price range of the AVX (my other telescope mount). Hence my addition of a RPi Zero W to each of my mounts.

Background

I have been mulling this project over for several months now, trying to figure out a way to fit a Raspberry Pi Zero with a USB WiFi dongle into the Nexstar hand controllers that came with my mounts. There didn't seem to be an easy way that didn't involve 3D printing a new back for the controller, which I wasn't opposed to, but was a little more work than I had time for. Then the Zero W was released, and I jumped at the chance to simply plop it in without any fuss, and have the added bonus of Bluetooth!

I'm simply amazed at how easy this hack has been, and how well it translated between my serial and USB based hand controllers. Now, if the clouds here in Seattle would just go away, I could actually enjoy using this upgrade!

Requirements

I set out with several requirements in mind, and have met all but one so far.

  • seamless original functionality [COMPLETED]
  • ability to SSH into telescope mount [COMPLETED]
  • full remote control of mount using OSS astronomy software [COMPLETED]
  • better scope slew interface (joystick) [COMPLETED]
  • automated time via NTP and RTC [COMPLETED & COMPLETED]
  • automated location settings via IP address geolocation [COMPLETED]
  • automated location settings via GPS [TODO]

Keeping the original functionality of the telescope mount is a must. Dragging the scope out into the field and being able to use it without a computer when I just want to do simple visual astronomy is a hard requirement. However, I would like to try to make this a little easier.

Currently, the original functionality requires manually entering your location, and the date and time. This could be automated with geolocation of the external IP address and NTP when connected to a network. Eventually, I'd like to add a GPS module to handle this functionality even when away from an Internet connected network.

The ability to remotely make adjustments to the configuration of the libindi server, perform software upgrades, and install new software without cracking open the case to have physical access to the integrated computer is a must. The most secure way to gain access to this is through an SSH connection.

After a lot of research and experimentation, I found that Kstars in combination with libindi make a great pairing for a remote telescope control project. Kstars even has an Android app that allows control from a cell phone! The main developers for libindi and Kstars seem to be hardware hackers, so there's awesome new features being added regularly to the project.

I've always disliked the hand controller on my Celestron telescopes. It's clunky in the dark, and when you're wearing gloves it's nearly impossible to tell which button you're actually pressing. I'd love to be able to use a Bluetooth SNES controller instead!

More Information

  • If you have a standard RS-232 controller check out the instructions section for details on how to make this modification yourself
  • If you have the USB hand controller, then read through this quick build log for modifications to the original instructions

  • Fixing Bugs

    Dane Gardner12/08/2018 at 17:28 0 comments

    [ChrisG71] has been working through a similar project to this one.  He's clearly more disciplined at using the system logger than I am, and pointed out that in my time setting script printf was interpreting anything with a zero in front as an octal character.  This is fine for time components in the range of 00-07, but will fail on 08 and 09.  Values ten or greater won't have the preceding zero, so it was interpreted as decimal.

    I've updated the original script and build log to include space padded date components instead of the default zero padding.

    Thanks [ChrisG71]!

  • Setting the Hand Controller Location on Boot

    Dane Gardner11/26/2018 at 00:16 0 comments

    After using network time protocol (NTP) to set the hand controller's time on start, I was lamenting that I still had to set the location manually.  I could easily use the same script as a starting point to set the location using my network's IP address geolocation, so why don't I?

    Read more »

  • Adding a RTC Module

    Dane Gardner11/14/2018 at 01:16 1 comment

    I am finding that using NTP for automatically setting my hand controller's time is great, but only when I'm home on my WiFi network.  To get accurate time setting done in the field, you have two options.  Use a real-time clock (RTC) module that keeps track of time using a small internal battery for power, or use a GPS module that will pull time from satellites signals (and may even have a RTC module built in).

    To start, I've settled on using a RTC module (DS3231) from AdaFruit.  The DS3231 more accurate than I probably need it to be, but given the wild changes in temperature that my poor telescope experiences throughout a trip, I figured it was worth the extra expense.  One could easily go with a less expensive module if price is a concern.

    Read more »

  • Setting the Hand Controller Time on Boot

    Dane Gardner11/03/2018 at 08:43 0 comments

    After upgrading to the latest version of Raspbian, I took a look through my notes on future work, and realized I could immediately do part of a requirement I set out to do with this project.  My hand controller for my Nexstar 6se doesn't have a real time clock (RTC) built into it, which means that every time it loses power, I have to manually reset the time.  I'm also lazy, and I don't accurately set the time when I have to enter it by hand, so I could easily be off by a minute or two.  To remedy this, I would like to set the time automatically when the Raspberry Pi first starts, allowing me to skip this manual process.

    Unfortunately, RPis don't have RTCs either!  I can however use my WiFi connection to discover the time using the Network Time Protocol (NTP), and in the future I could add a hardware RTC, or use a GPS module, to keep track of time when a network connection isn't readily available.

    Read more »

  • Upgrading Raspbian Jesse to ​Stretch

    Dane Gardner11/03/2018 at 07:31 0 comments

    It's been a while since I updated the software on the Raspberry Pi Zero W that I had installed in my telescope hand controllers, mainly because I was afraid that it would turn out to be a huge time sink to get it as stable as it was originally.  This turned out to not be the case.  The upgrade process going from Jesse to Stretch is quite slow, but very straightforward and I was able to multitask while doing it.

    Read more »

  • It works really well!

    Dane Gardner05/30/2017 at 02:10 0 comments

    I wanted to get some photography of Jupiter's Great Red Spot while it was facing us, but unfortunately it was too early in the evening to do a proper alignment using Polaris. This meant that I'd have to hand align the telescope as my three minute exposure progressed. Normally this would involve using the corded hand controller, which meant I'd have to hold perfectly still to avoid introducing vibration into the telescope through the cord, but with my wireless controller, this was not only easy, but I could comfortably sit several feet away closer to my laptop screen! The result speaks for itself:

    Equipment: C9.25 on AVX + Neximage 10

    Parameters: Y800 640x480; 30FPS & 1/30s @ 3.5dB for 03:00

    Processing: 3594 frames >> PIPP >> 1200 frames >> Registax 6

  • Automatic connection of Bluetooth controller

    Dane Gardner05/28/2017 at 00:03 0 comments

    I was having problems with consistent connections of the Bluetooth controller, and found that despite configuring calibration settings at boot time, they were lost if the device wasn't already connected. I ended up writing a script that could be run periodically using a cron job that would attempt to connect the joystick if it wasn't already, and then calibrate it if it wasn't already.

    Here's the complete code: https://gist.github.com/DaneGardner/a3ff6124e1ffaac34a6823b3d5235a26

    Save that file to your home directory on the Raspberry Pi, and ensure that it's executable. Then add a cron job that runs every minute using `crontab -e` at the command line:

    * * * * * ~/joystick-connect.sh

    Now, if your joystick isn't on and ready to connect when you start your telescope, it will take a maximum of one minute before it's discovered, connected, and configured once you do turn it on!

  • Using a Bluetooth joystick for slew control

    Dane Gardner04/11/2017 at 02:11 0 comments

    I picked up a cheap Bluetooth SNES controller to allow me to slew my telescope without disturbing the setup with vibrations from a wired hand controller. This should allow things to settle more quickly after a manual change to the scope's position.

    To configure the RPi for a Bluetooth joystick, I used `bluetoothctl` at the command line:

    bluetoothctl
    [bluetooth]# agent on
    [bluetooth]# default-agent
    [bluetooth]# scan on
    ...
    [bluetooth]# pair XX:XX:XX:XX:XX:XX
    [bluetooth]# trust XX:XX:XX:XX:XX:XX
    [bluetooth]# connect XX:XX:XX:XX:XX:XX
    [bluetooth]# quit

    Unfortunately, the joystick driver in libindi forgets any remapping you may perform in the UI, despite saving and reloading the configuration. To work around this, I changed the button mapping at the OS level to match what I wanted, and have it automatically reconfigure each time the RPi reboots.

    apt-get install joystick
     
    cat > /etc/joystick.cal < EOF
    jscal -u 8,0,1,2,5,9,10,16,17,16,315,304,305,314,307,308,310,311,316,317,318,319,306,309,312,313 /dev/input/js0
    jscal -s 8,1,0,127,127,-4194176,-4227201,1,0,127,127,4227201,4194176,1,0,127,127,2147483647,2147483647,1,0,127,127,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js0
    EOF
     
    echo "source /etc/joystick.cal" >> /etc/rc.local

    Be sure to add the 'Joystick' driver to the libindi server configuration in the web manager interface!

    That's it. It works great for me now!

  • Modifying a USB Nexstar hand controller

    Dane Gardner04/11/2017 at 00:20 0 comments

    The project instructions detail how to modify the serial version of the hand controller, which is more common on the smaller mounts like that found on my Nexstar 6SE. However, I also have an AVX mount for my other telescope that I'd like modified as well, but its hand controller is USB based.

    Turns out it's even easier to modify than the serial version because the pins on the USB chip are significantly larger! Please note that the USB chip is upside down when compared to the serial adapter chip of the other HC (pin 1 is to the lower-right, instead of the upper-left).

View all 9 project logs

  • 1
    Step 1

    Configure your Raspberry Pi running Raspbian to connect to your WiFi network, and enable SSH so you can go back later and install the things you need once you install it in the hand controller (HC).

  • 2
    Step 2

    Gather your components, and open the case on your Celestron Nexstar HC.

  • 3
    Step 3

    Open the case on the HC and using a multimeter identify the incoming 12V power line and ground. Wire up your 5V power regulator and prepare it for mounting.

    After soldering the power regulator to the incoming power, and the Raspberry Pi, I secured it to the HC's main board using a hot glue gun.

View all 10 instructions

Enjoy this project?

Share

Discussions

velocentric wrote 03/27/2021 at 17:33 point

Hi Dane, Cool project and seems to be a good alternative for my troubles using SkyPortal. Right now I connect a USB converter to the handcontroller RS 232 plug. It's messy but reliable.  I have the Pi Zero and dc buck on order and wonder if this project is still active. Can this remote Indi server work under Ascom/Alpaca? I have quite an investment in Sequence Generator Pro and am not quite ready to try out Ekos. 

  Are you sure? yes | no

Guido Della Bruna wrote 09/17/2020 at 09:29 point

Hi Dane,

many thanks! At first I planned to follow your instructions, but then I realized my soldering skills were not good enough for modifying the hand controller :-(

So I switched to an external device: the Raspberry Pi is connected to the Celestron's serial port with a USB-to-RS232 cable/adapter based on Prolific's PL2303 chip. This works out-of-the-box with Raspbian, the driver is already included in the kernel and the device recognized at boot as /dev/ttyUSB0. At the moment I use a spare RPi 3B+, later I might switch to a Zero W, which requires an extra USB OTG cable. The 3B+ has (just) enough power to run Astroberry, though. A 4B woud be even better for this. Astroberry has KStars included, in theory you could use it from any modern browser in a remote desktop session; only problem is the screen size on portable devices. Probably ok with an iPad or tablet, even better with a laptop (but in this case you could just install KStars there and have a much better performance).

I also needed a DB9female-to-RJ10 serial cable to connect to the serial port on the hand controller. I made this by cutting a Cisco console cable (DB9 to RJ45) and swapping the RJ45 plug with an RJ10. The cable has 8 wires, just use the 4 central ones, same sequence as original.

As a joystick I use a Bluetooth 3BitDo SNES controller I had laying around, "recycled" from my old Retropie console. Works out-of-the box, you just need to pair it correctly the first time.

For field observations I have a Celestron Powertank, which powers the scope and also has 2 USB ports I can use to power the Pi.

Cheers,

Guido

  Are you sure? yes | no

Axel wrote 06/05/2019 at 23:34 point

HI Dane,

cool project. I got an onstep controller up an running. It is connected to an astroberry (Raspberry Pi wit kstars an d indi). I also habe SkySafari 6 up and running. Everything works perfekt.

Could you tell me, how you got the BitDo controller to work? I have the same. But II had no luck with Raspberry Pi and wireless. Connecting by cable works fine. I tried several bluetooth usb controllers. No luck. The controller is not recognized.

Any clue?

Cheers Axel

  Are you sure? yes | no

carlos wrote 05/24/2019 at 17:01 point

Dane, this is a cool project. Do you use this with SkySafari? How do I connect it?

  Are you sure? yes | no

Stefan Agner wrote 01/13/2019 at 22:12 point

Hi, I just happened to buy this Telescope literally couple of days ago and now saw your project. I am in the process to do what you did. I have the basic stuff working and just need to figure out the power supply. I also added ser2net so I can forward the Celestron serial port directly if required (basically act as a SkyFi).

  Are you sure? yes | no

Dane Gardner wrote 01/18/2019 at 06:33 point

Glad I could inspire you to build your own!

I thought about ser2net, but I'm so happy with Kstars and the INDI server as they are, that I haven't needed it.  Good to know that it does work if I want to go that route in the future.

Good luck with your project!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates