Skip to content

Latest commit

 

History

History
79 lines (44 loc) · 5.17 KB

README.md

File metadata and controls

79 lines (44 loc) · 5.17 KB

ArduinoTelescopeDustCover

An open source project to automate some aspects of amateur astronomy.

Aim: Use an Arduino Nano to open and close the dust cover on a telescope and also control and LED lightbox.

Requirements:

  • Arduino Nano (like this)
  • Servo (like this)
  • 2x LED (optional)
  • 2x 220 Ohm Resistors (only reuired if using LED's)
  • 100uF capacitor (optional)
  • A few wires
  • Black Posterboard (Very light weight)

Instal Python 2.7.12 (download here)

Add Python path to PATH (instructions here)

Start a CMD prompt as administrator (instructions here)

From the CMD prompt we manually install Pip using the following command

python get-pip.py

Next we want to install pyserial, again at the CMD prompt we type

python -m pip install pyserial

Start the Arduino IDE (download here)

Wire up the arduino as follows:

alt text

When a serial connection is opened to an Arduino it resets itself, this is a problem for us as the code won’t work as intended, so to get around this we’ll use a 100uF capacitor between the Reset and Ground. This is a simple non-permanent solution, but it does mean that to upload code to the Arduino we need to either press the reset button on the Nano when we’re uploading or temporarily remove the capacitor when uploading.

Connect the Nano to the computer and make a note of the COM port it’s using (in my case i'm using COM6 so we’ll use that in the python code later), this can be found in the Arduino IDE (Tools->Port). Upload the Dust_Cover.ide code to the Arduino. If the Arduino is always connected to the same USB port then the port should not change.

Save the open.py and close.py files on to the host computer that has Python installed, connect the arduino to the host via USB, and then double click the open.py or close.py files. Each will send a command over the serial connection and will light the corresponding LED (White for OPEN, Red for CLOSE). Once this is working we can move on to adding the servo and altering the Arduino code to actually move the dustcover.

Adding the servo

Instructions are here, but all we're doing is:

  1. Connect the red from the servo to +5V on Arduino.

  2. Connect black/brown from the servo to Gnd on Arduino.

  3. Connect white/orange from the servo to Analog 0 on Arduino.

alt text

Now we modify the Arduino code to include the servo. The arduino file is called Dust_Cover_Servo.ide, upload it to the Arduino and change the values for static int open_angle and static int open_angle to suit what works your configuration. I found my values through trial and error.

Affix the servo to the OTA. If this is all you wanted to acheive then stop here and just run the open and close python scripts to control the dust cover. If you also want to control an LED lightbox then continue below.

Controlling an LED Lightbox

To control my flat box (from AliExpress) I bought a 4 relay switch (from AliExpress) and wired it up to be in a Normally Open (NO) format so that when theres no signal from the Arduino the relay is not activating the flat panel.

The Arduino code for this step is called Elentirmo_v0.1.ide, upload it to the Arduino and wire digital Pin 10 on the Arduino to IN1 on Relay Module as below. In my image below i've used an LED in place of a lightbulb as Fritzing didn't have one.

alt text

I've also created a very basic Python GUI to control the Dust Cover and Lightbox, it's called Elentirmo_GUI_v0.1.py. Make sure you've installed Pyserial before running it. Also don't forget to make sure you've changed the COM port to whichever COM your Arduino is using.

alt text

alt text