Telescope control with Stellarium and Arduino


Initially, the main reason for this blog is the publication of a personal project that I believe could be interesting for astronomy amateurs.

It consists on a first approach to control a telescope mechanism by the USB port, builded from scratch and based on Arduino microcontroller, from a computer with GNU/Linux and the Stellarium software.

By the moment, the code has been tested only in a mini-dobsonian mount with a green laser pointer. The laser points towards the celestial objects indicated from Stellarium, by using a stepper motors system.


Prototype, interface, Stellarium screen and laser pointer.


The project is going to be published in a post series about different implementation details like Stellarium communications (Stellarium Telescope Protocol), communications with the device (USB-Serial), coordinate transformation (Toshimi Taki’s Matrix Method for Coodinates Transformation), interface, etc. A general scheme of the project would be the following:


Blocks scheme


Regarding the hardware, the previous image only shows a first functional prototype. My intention is to build a more accurate and efficient design, although I think it’s going to take me some time (I have to work to pay the bills…).

Here you are a small video of the prototype I made executing a movement sequence. At that moment it wasn’t finished, it had a red laser instead of the green one (the red line is not visible in the night sky), and lacks other important details. Anyway, it shows the basic mechanism on movement 🙂



So that’s all for the moment :)… In the next post I’ll start with the python-Stellarium communications.

Tagged . Bookmark the permalink.

10 Responses to Telescope control with Stellarium and Arduino

  1. Pierre-Marie says:


    I’m a teatcher in a french scool and try to make a motorised dobson telescope with student.
    I read your post and I’ve some question.
    First I’m not a good programmer and my english is not very good so excuse me for that.
    I search a method for coordonate transformation and your library interest me, but in your demonstration you choose 2 reférences. Can I choose always the same and put in the void setup for exemple?
    When I give 2 réferences (or 3), can I make all transformation from Ra dec to alt az and from alt az to Ra dec ?

    Thanks for this post, very good works.


  2. JuanRa says:


    For the references you’ll need the local (horizontal) and ecuatorial coordinates, and the local ones are not the same every day at the same time, so you can choose the same reference objects, but you can’t use the same values for their coordinates in a static setup. You’ll have to get the current values for those objects each time.

    Once you’ve configured the reference objects, you can make transformation from Ra-Dec to Alt-Az, and also from Alt-Az to Ra-Dec. The library uses the reference coordinates to obtain the transformation matrix for the Ra-Dec to Alt-Az, and also the inverse of that matrix for the transformation in the other sense (Alt-Az to Ra-Dec).

    Here you have the declaration of the two functions for this:

    • Pierre-Marie says:


      Thanks for your reply, I’ve a look to coord.lib and I understood the process, even if some aspects of the program are not yet quite clear for me.

      In your method you realize homing with position sensors. Would there be a high risk of error if the two axes were adjusted only with a brand?

      • JuanRa says:


        I’m not sure if I understand the issue, but if so, I think the risk of errors depends on the precision of the limit sensors. In my case the precision is not very good, it is only a first prototype built with recycled parts of old printers and other chunk of plastics.

        Probably a better design should include a better positioning system than a “steps count” with stepper motors and only a couple of origin sensors, it depends on the precision you want to achieve and the materials you have. In my case the device is not a telescope, it’s just a laser pointer to point out an area near of the celestial object. I just wanted to build something (a botched job) to test the software 🙂

  3. Pierre-Marie says:

    I’ve installed Python3.3 and Pyqt4 on my win7, and I try to test but I’ve an error message :

    Traceback (most recent call last):
    File “C:\Arduino-Telescope-Control-master\main\python\”, line 11, in
    from ui.laser_control_ui import Ui_LaserControl
    File “C:\Arduino-Telescope-Control-master\main\python\ui\”, line 314, in
    import ui.icons_set_rc
    File “C:\Arduino-Telescope-Control-master\main\python\ui\”, line 272, in
    File “C:\Arduino-Telescope-Control-master\main\python\ui\”, line 267, in qInitResources
    QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
    TypeError: qRegisterResourceData(int, str, str, str): argument 2 has unexpected type ‘str’

    It’s may be caused by my version of Python… Have you an idea ?



  4. I am doing a project to meet the following needs:
    1 – PWM with encoder
    2 – Little Welding
    3 – Altzmuth
    4 – Equatorial after
    5 – Arduino Due (32 Bit)
    I can use your library of coordinates in my project?

    Thank you and congratulations

  5. Gopinath says:

    Dear sir,

    I really encourage your work, I have try it and till now it seems to work well. Can you please tell me which Sensor have you used? Please reply I stuck with this.

    Best Regards


    • JuanRa says:

      Hello Gopinath,

      I took these sensors out of an old printer, and I don’t know the model nor any helpful reference. Sorry about that.

      I’d really like I have more time to dedicate to this project, but by now I cannot help much.

  6. Matheus says:


    I would want to know how i find the conversion of coordenites in the your  GitHub because i am with difficulties to moviment the telescope following the coordenites.

Leave a Reply

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