How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry PiMAKER:snowbiscuit/Translated by: Qu Wujin

Recently, the annular solar eclipse attracted a large number of astronomy enthusiasts. Outside the technology center building in my city, there is a large telescope that can overlook other planets in the universe.
I have always believed that there is a mysterious connection between the real but unreachable outer space and my small self.
Recently, I am preparing to replicate a smart planet finder using Raspberry Pi and a telescope. By obtaining the coordinate data of known planets from NASA, this device can automatically adjust its angle and focus on the planet, allowing me to easily observe them.
I believe it will greatly help you watch and feel the outer space world beyond Earth.

Material List

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

Raspberry Pi 3B ×1, 16×2 LCD screen ×1, stepper motor with driver 28-BYJ48 ×2, buttons ×3, flange coupling 5mm ×2, button compass ×1, M3 bolts/nuts ×8, 3D printed case ×1, 3D printed telescope ×1

Planet Coordinate Data

How to Build a Smart Planet Finder Using Raspberry Pi

Here we will introduce two methods to locate planets. 1. Using the horizontal coordinate system. It can tilt upwards from the north (azimuth) and upwards from the horizon (altitude), so it depends on your location, so the angles will vary. This method takes the north as a reference.

Please click the link to view: https://en.wikipedia.org/wiki/Horizontal_coordinate_system

2. After connecting the Raspberry Pi to WiFi, directly connect to NASA to obtain data.

Access planet data from NASA Jet Propulsion Laboratory (JPL): https://ssd.jpl.nasa.gov/?horizons

Before accessing the data, you need to install the AstroQuery library, which is a tool for querying planetary network forms and databases. Please click to download: https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html

Please make sure to install the latest version of Raspbian (I used version 3.7.3). Open the terminal and run the command:

sudo apt install python3-pip

Then use pip to install the upgraded version of astroquery.

pip3 install --pre --upgrade astroquery

Before continuing with the project, please access the data using a simple Python script to ensure that all dependencies are installed correctly.

from astroquery.jplhorizons import Horizons
mars = Horizons(id=499, location='000', epochs=None, id_type='majorbody')
eph = mars.ephemerides()
print(eph)

This will display the detailed position of Mars.

Please click the link to check if Mars’s positioning is correct: https://theskylive.com/planetarium

For convenience, I will simplify the process. The id represents the data associated with Mars in the JPL data, epochs represent the time to obtain the data, and id_type indicates the inquiry of solar system bodies. “000” in the Greenwich Observatory location code indicates the location in the UK.

Other locations can be viewed here: https://minorplanetcenter.net//iau/lists/ObsCodesF.html

Troubleshooting: If you get the error: No module named ‘keyring.util.escape’, you can enter the following command in the terminal:

pip3 install --upgrade keyrings.alt

Programming

To find accurate coordinate data, modify the location information in the getPlanetInfo method (use the observatory list from the previous step to modify the location here)

def getPlanetInfo(planet):
    obj = Horizons(id=planet, location='000', epochs=None, id_type='majorbody')
    eph = obj.ephemerides()
    return eph

The complete Python script can be downloaded from the project repository: https://make.quwj.com/project/240

Connecting Hardware

How to Build a Smart Planet Finder Using Raspberry Pi

In this step, connect the breadboard, jumper wires, two stepper motors, LCD screen, and three buttons.

Locate the pins on the Raspberry Pi and enter the following in the terminal

pinout

How to Build a Smart Planet Finder Using Raspberry Pi

This will display the GPIO numbering and board numbering. The connections are as follows: First motor – 7, 11, 13, 15 Second motor – 40, 38, 36, 32 Button 1 – 33 Button 2 – 37 Button 3 – 35 Display – 26, 24, 22, 18, 16, 12

After all connections are made, run the Python script

python3 planetFinder.py

How to Build a Smart Planet Finder Using Raspberry Pi

The screen will display the setup text, and the buttons can start the stepper motors.

3D Printed Case

1. 3D print the case.

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

All printed STL files can be downloaded from the project repository: https://make.quwj.com/project/240

2. Test the case

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

After the case is assembled, install other components. Install the buttons in place, secure the display and stepper motors, and sand the case to ensure all components work properly.

Install Electronic Components

1. Install the stepper motors

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

The stepper motors will control the elevation angle of the telescope above the case, so the wires need to be extended for rotation. Please install as shown.

After wiring is complete, run the Python script to check if everything is normal.

How to Build a Smart Planet Finder Using Raspberry Pi

Then put the wires back into the tube until the stepper motor is in place, then secure the stepper motor to the case and glue the case.

2. Install the buttons and LCD screen

How to Build a Smart Planet Finder Using Raspberry Pi

Install the buttons as shown, using nuts to secure them in place before soldering.

How to Build a Smart Planet Finder Using Raspberry Pi

Then use M3 bolts and nuts to secure the LCD display. Please solder one of the pins of the LCD to the potentiometer.

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

Before gluing all components, test the code again to ensure everything is working properly, as it is easier to fix at this stage.

3. Add flange couplings

How to Build a Smart Planet Finder Using Raspberry Pi

Connect the 3D printed base to the stepper motor.

How to Build a Smart Planet Finder Using Raspberry Pi

Install the flange coupling on top of the stepper motor and secure it in place with screws.

How to Build a Smart Planet Finder Using Raspberry Pi

Installing the telescope on the motor at the top of the rotating tower is simple, as there is enough space to secure the small screws in place.

How to Build a Smart Planet Finder Using Raspberry Pi

One flange is glued to the base of the rotating tower, and the other is installed on the telescope.

Test again, and if there are any issues, fix them immediately and ensure all connections are correct.

Starting Up

Since I want it to run independently, rather than manually coding to search for planets each time, I set it to run the code when the Raspberry Pi starts.

Enter in the terminal.

crontab -e

In the opened file, at the end of the file, start a new line and enter.

@reboot python3 /home/pi/PlanetFinder/planetFinder.py &

The code is saved in the PlanetFinder folder, so the file location is: /home/pi/PlanetFinder/planetFinder.py. If you save it elsewhere, please change it here.

Note: It allows the code to run in the background, so it does not block other processes when starting.

Assembly Complete

How to Build a Smart Planet Finder Using Raspberry Pi

How to Build a Smart Planet Finder Using Raspberry Pi

Add a small compass to the center of the rotating base, and finally install all components in place.

How to Use

How to Build a Smart Planet Finder Using Raspberry Pi

1. When the telescope starts up, adjust the vertical axis. Pressing the up and down buttons can move the telescope, and after adjusting, press the OK button (located at the bottom).

2. Adjust the rotation angle, use the buttons to rotate the telescope until the small compass points the telescope north, then press the OK button.

Now, you can use the up and down buttons to select a planet, and after confirming, press the OK button. It will display the altitude and azimuth of the selected planet, pointing to it for a few seconds before turning north.

So far, the project is complete. Which planet will you go looking for?!

The project repository address:

http://maker.quwj.com/project/240

via instructables.com/id/Raspberry-Pi-Planet-Finder/

Links in the article can be clicked to read the original text at the end

How to Build a Smart Planet Finder Using Raspberry Pi

More exciting content

Raspberry Pi CribSense Baby Monitor

Arduino + WS2812B Digital Clock

I look like a handle, but I am actually an adjustable power supply

A cloud that forecasts the weather, based on Raspberry Pi + 3D printing

DIY Stanford Pupper 12 Degrees of Freedom Quadruped Robot Dog

Barrier: Sharing keyboard and mouse between PC and Raspberry Pi

Cool modification: Electric skateboard with a speed of 40km/h and a range of 18km

8GB RAM version Raspberry Pi 4 has been released, with an official price of $75

How to Build a Smart Planet Finder Using Raspberry Pi

Leave a Comment

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