Building an Arduino telescope controller and PC interface

Recently I’ve been investigating adding digital setting circles to my Dobsonian mounted telescope.

Moore & Wright Mini Mag

Digital setting circles is a blanket term that refers to any electronic mechanism that provides orientation feedback for a telescope as you move it around – the most basic version is a digital spirit level, like the Moore & Wright Mini Mag. Attach one of these to the tube of your telescope, and it will tell you the altitude it’s pointing at – from zero degrees (pointing at the horizon), to 90 degrees (pointing straight up, aka the “zenith”).

That’s great and all, but what you really want is to get this information into a program like Stellarium – an open source, multi platform planetarium app that simulates the night sky. If you can connect your telescope to Stellarium, you can have it display a “reticle” – a crosshair that corresponds to where your telescope is currently pointing, which is great for helping you find things.

The plan – Stellarduino

What I want to design is a cheap (and easy to build yourself) bit of hardware that acts as an interface between a Dobsonian mounted telescope and a computer running Stellarium, or some other planetarium software. I call this Stellarduino.

Bill of materials

  1. A set of high-resolution rotary encoders. These attach to the Dobsonian mount and convert the rotational movement into a digital signal.  I’ll be using some expensive USDigital S1 and S2 encoders, purchased for ~$200 from Wildcard Solutions as part of an encoders and mount kit, though cheaper ones (like the kind you find in old optical mice) would suffice.
  2. An Arduino, the brains of Stellarduino. Probably the larger DUE, though I’ll be using the ubiquitous $30 Uno until I run up against any limitations (floating point accuracy and no. of pins).
  3. A 16×2 character LCD display, such as the $20 MIDAS MC21605C6W-FPTLR. This will be used to enter time and coordinates during alignment, and will display current Alt Az or RA Dec orientation once aligned.
  4. Misc push buttons and wire.

How it will work

Using the Telescope plugin, Stellarium has been designed to consume the output from common GoTo telescope handboxes (like the Meade AutoStar) via a serial connector cable. So, in order to talk to Stellarium, Stellarduino will have to emulate one of these devices. To do this, the telescope must first be “aligned”, which means the altitude and azimuth orientation of the scope can be converted to the celestial coordinate system, Right Ascension and Declination. Alignment (from what I can tell) involves questioning the user for the telescopes’ geographic coordinates (latitude and longitude), and time (specifically UTC time). The user is then instructed to point the scope at an object of a known celestial location (typically a bright star), then at a second. By calculating the change in alt/az from the rotary encoders, it is then possible to convert between the two coordinate systems.

Project schedule

  1. Write prototypes of the software using PHP. Build Stellarduino class library, figure out algorithms to convert RA/Dec to Alt/Az and back, figure out the alignment process and prototype it.
  2. Port Stellarduino class library to Arduino.
  3. Figure out best method of reading rotary encoders from Arduino.
  4. Get LCD character display working with device so it reports telescope orientation using “dumb” alignment, that is, where the software assumes the telescope starts at zero altitude/azimuth. Dumb alignment milestone.
  5. Port alignment process to Arduino. Stand alone alignment/push-to device milestone.
  6. Figure out Meade AutoStar protocol, and emulate it. Final milestone.

18 thoughts on “Building an Arduino telescope controller and PC interface”

  1. i live in S.A(SOUTH AFRICA) BUT I SO BADLY WANT TO BUILD MY OWN TELESCOPE WITH AN ARDUINO ,I WAS THINKING TO BUY THE ARDUINO MEGA 2560 OR THE ARDUINO ADK, BUT I MIGHT BE WRONG,CAUSE I SEE THAT YOU SAID THE DUE,SO THE MORE YOU CAN TELL ME YOUR KNOWLEDGE THE BETTER,AND THE OTHER THING I DON’T HAVE A GLUE WERE IN MY COUNTRY CAN I BUY THE MOUNTINGS TO BUILD THE KIT FOR THE TELESCOPES…. THANK YOU KINDEST REGARDS JAN JACOBS

    1. HI JAN. NOT QUITE SURE WHY YOU ARE SHOUTING, BUT IT MUST BE LOUD WHERE YOU LIVE SO I’LL SHOUT TOO TO MAKE IT EASIER FOR YOU TO HEAR.

      I RECENTLY DISCOVERED THAT THE ARDUINO UNO WAS SUFFICIENTLY CAPABLE ENOUGH TO SUPPORT THE CODE I RUN ON IT. I WOULD RECOMMEND THE LEONARDO THOUGH, BECAUSE IT’S BASICALLY JUST THE SUCCESSOR TO THE UNO AND HAS A BETTER USB INTERFACE – I SAW A MINOR PERFORMANCE DIFFERENCE.

      IN REGARDS TO MOUNTING THE ENCODERS, I WOULD RECOMMEND AGAINST USING GLUE. YOU NEED TO MINIMISE MOVEMENT AS MUCH AS POSSIBLE, AND MOST GLUES PROBABLY AREN’T RIGID ENOUGH. GET CREATIVE! ALL YOU NEED TO DO IS ATTACH THE ENCODERS TO THE AXES OF THE SCOPE – TRY LOOKING FOR LITTLE TIMING BELTS, COGS AND GEARS. THE 3D PRINTING COMMUNITY SHOULD HAVE A LOT OF THIS SORT OF STUFF, AND IT’S ALL AVAILABLE ONLINE – YOU DON’T NEED TO BUY IT IN SA.

    2. Hello Jan,

      I’m also in Sa and trying to convert my 10″ dob to GOTO
      maybe you can email me> so we can put our heads together?
      sms me on 0746019751

  2. Yo

    Did you ever make any headway on this project. I am just starting out on an old C8 super polaris GEM mount. I intend to use Stellarium as the laptop pointing device, but the arduino on the mount would be main tasker, reading a cluster of sensors (GPS, Temp, Rh, compass, Baro, tilt) to automate the input number crunching aspects, then switch over to GOTO control (PWM) to respond to Stellarium (or ASCOM) signals from the laptop.

    SO how goes it with you.

    FD

    1. Hi,

      Yeah, I made some headway – though I’ve not been devoting much time to this with other projects on the go. You can see my code here: https://github.com/caseyfw/Stellarduino/tree/develop (though my last commit was around two months ago).

      For my project, all I was trying to achieve was Push-To on a dob mount – basically just a cheap way of getting a reticle in Stellarium for any telescope. If you’re hoping to implement full motorisation, you’ll need some kind of feedback loop between the motors and the encoders (presuming you want to implement it that way). That said, most little Super Polaris mounts I’ve seen have only the one RA sidereal motor.

      If you have any questions, I’m happy to help where I can.

  3. I’m very interested in your project but have the following questions: 1) I’m can’t find libraries on Encoder, math and SoftwareSerial. 2) Why not including RTCLib.h
    Please consider that I’m not an expert in software and just started with Arduino Uno. Building an 10″ refector as Dobson.
    I’m living in the Netherlands and 74 years old.
    Greetings,
    Ton van Duuren

    1. That’s a great solution for people who own an expensive equatorial mount that they can fit stepper motors onto. Stellarduino is intended for cheap Dobsonian mounts (azimuthal), and really has no roadmap for moving the telescope around.

      Also, Stellarduino operates independent of ASCOM or guidance software – the alignment and guidance is done on the Arduino. It’s a cheap, bare-bones Arduino based digital setting circle.

  4. Casey,
    This looks very interesting. I have a set of digital setting circles with USDigital encoders for my dobsonians with an older (late 90s) model Sky Commander. I rarely use them because I have gotten good enough at using a red dot finder and a star chart program on a computer at the telescope that the digital setting circles are slower. A modern microcontroller solution like yours putting the crosshair on the display without spending several hundred dollars on a new commercial DSC box sounds great. This would probably also be extendable to displays at the eyepiece. My larger scope is a 20 inch (50.8 cm) f/5 so there are often ladders between the computer and the eyepiece. My 13 inch scope has been in the middle of being rebuilt to make it easier to pack for air travel for about the past year (it’s been to Australia once).
    Are you running the windows version of Stellarium or Linux? I’ve been using a Raspberry Pi with one of the old Motorola Atrix lapdocks as my scope computer. Stellarium is unusably slow on the Pi, but Kstars is usable (display stays current and can be dragged around with the mouse but some menus take a several seconds to open). Santa brought me an Odroid U3 which has signficantly better performance so it might be able to run Stellarium if you want a low power usage Arm based device, but I’ve gotten used to Kstars so I’m going to stick with it.

    Have you looked at some of the magnetic angle encoder chips now available for automotive uses as an alternative to the pricey angle encoders? I just saw some at Digikey with I2C and SPI outputs claiming 14 bit accuracy measuring the angle of a rotating magnet and resolution of < .02 degrees. The chips cost around US$8 for quantity 1, and a completed board to evaluate the chip performance (the chips are surface mount) is US$35. I'm tempted to get one but want to get some simpler projects completed first.

    Regards,
    Richard

    1. Hey Richard,

      I’m actually using the Mac version of Stellarium – part of my motivation for this project was that the de facto standard for telescope < -> PC communication (ASCOM) is a Windows-only platform.

      I haven’t really looked into other encoder solutions. I remember seeing some 12-bit magnetic ones a couple of years ago on element14, but they were relatively similarly priced to the optical ones I currently use.

  5. Hello, congratulation for your very cheap nice solution of Stellarduino, the code works very fine with my 2 encoders and display right AD and Decl on my LCD 1602 ; i use mega256O, for now i use only a button for select the 2 stars, connected on pin A0 ,
    is what is needed more library or additional code for add up and down buttons that you talk in your site ? Where to find it ? Sorry im not at all programmer, thanks for your help. ? Sorry im not at all programmer, thanks for your help.

    Philippe France

  6. Hi Casey,

    great Projekt with Arduino and thanks to share this with the community!
    I think about a Push-to System for my Dobsian too. Now i find this great stuff!
    I want to use this one: http://www.exp-tech.de/sensoren/gyroskop/adafruit-9-dof-absolute-orientation-imu-fusion-breakout-bno055
    . In some weeks i will test it, if it is pssible to use this sensor. Otherwise i use Digital Encoder.
    sorry about my english, i am not a natice speaker 😉

    greest Dirk from Cologne

    1. Dirk:

      Any success with using the Adafruit 9-DOF with a telescope?

      I have an Orion XT8 that I would like to setup with Stellarduino so that I can more easily find deep-sky items 🙂

      dew from USA

  7. hi casey
    it is really nice work you have done
    our colleges astronomy club is working on this project with the help of your code
    we need know how to connect the pc’s Stellarium and Arduino.
    is there need of any transmission control protocol and if,
    can you help us with that
    astronomy club,
    college of engineering, pune,india

Leave a Reply

Your email address will not be published. Required fields are marked *