Raspberry Pi – easier to build than you think
For the non-technical amongst us, building a Raspberry Pi for astronomy automation looks daunting but it is really very easy. When I built my first one, there were very few simple guides on how to do this. In this article, I will show you just how easy it is with a few personal recommendations and gotchas to avoid.
October 11, 2020
What to buy?
On the internet, buying a Raspberry Pi is cheap and easy but just be careful to get the right minimum specification so that all works without lag.
- Model 4b with 4gb RAM minimum; – see this amazon example.
- A case with fan cooling and heatsinks – rugged enough for the outside – be careful of metal cases without a clear window at the back (where the SD card goes) as they reduce the Wi-Fi signal and therefore connectivity;
- SD Card – I recommend a 64 GB Class 10, speed class A1, UHS Speed Class: 3 or faster – its much better to have a fast, bigger than needed card now than to run out of room later on…
- USB 3 SD card reader to save your images to along with another SD Card to save them too – I suggest one that takes the micro SD card internally rather than sideways so your RPi USB ports don’t get blocked – like this one.
- If you need better Wi-Fi range, buy an RPi compatible USB Wi-Fi stick like this one – you will need to install the drivers on the RPi though!
I am weary of the Raspberry Pi starter kits – they don’t always work out cheaper and you may not need everything they include.
I tend to use another removable SD card in a USB 3 reader to save my images to, this makes it really easy to transfer them to another computer for image processing – never try to transfer them across Wi-fi unless you have a lot of time on your hands, there can be a lot of data just for one night’s imaging!
Powering your Raspberry Pi
When you build, setup and test it, you can power it from another computer USB3 Power port or buy a small RPI plug in power supply. However when using the RPI’s on your mount, you need a good 3A 5.1v power supply with the minimum of leads and weight.
It is also not advisable to try and power your equipment (e.g. focuser) from the RPI’s USB ports as this can make your RPI unstable and give you software issues, yes really!
My current solution is to use a good quality USB 3 powered hub, such as the StarTech 7 port, mounted with the telescope you only have one 12v dc power lead to it (either from a mains transformer or battery pack) and can use it to distribute power and data – it is an expensive item but has saved no end of hassle and allows all my cameras, focuser and the RPI itself to power off the hub. Sometimes quality pays off.
Assembly of your Raspberry Pi is really straight forward, does not require many tools and can be completed in 5 minutes!
- Take the board out of the packaging;
- Insert the board in your chosen case having attached the heats sinks, fan etc as detailed in the case instructions;
- Put your newly created system SD card into the SD card end slot;
- Put the case lid on..
- Connect the power, off you go…
Thats it, yes really!
What shall I run on it?
My current favourite is using KStars and Ekos to fully automate my whole setup. There are two forms of this, Astroberry (open source) or Stellarmate (licensed). Both use KStars / Ekos and the INDI client server architecture to communicate with your equipment.
- Stellarmate can be bought (cheaply) ready configured on a Raspberry Pi ready or as a system image for you to install yourself;
- Astroberry Server is a ready to use system image for Raspberry Pi for controlling all your astronomy equipment. It handles all astronomy equipment supported by INDI server. It includes additional astronomy software so gives you more choice for equipment control.
I would suggest you reviewing both as their offerings are slightly different and your choice will depend on your level of expertise, expansion and control you require. I think the more technical amongst us will favour Astroberry whereas plug and play type people who are less into IT will favour Stellarmate.
Both Jasem Mutlaq (Stellarmate) and Radek Kaczorek (Astroberry), amongst others, have contributed so much to our community with their offerings that I highly recommend either buying the Stellarmate OS or donating a few dollars to Radek. (By the way I am not on commission and never will be, these people have put so much effort in on our behalf, they just deserve it!!)
I have a whole article on Astroberry tips and tricks on this site here…
Getting the SD card ready
Loading the SD card with a system image is quite easy but I have a few easy recommendations if you are using Astroberry or Stellarmate.
To create your SD card, download the system image you plan to use and save it ready for imaging, the great thing about Stellarmate or Astroberry is that there are full system images already pre-loaded with the astro software you need.
Use a free tool like Win32DiskImager on your PC to read the downloaded image and create the SD Card:
- Start Win32DiskImager. (sometimes it is required to “Run as Administrator” to prevent permission issues).
- Insert the new SD card in your card reader. Plug it in your PC and go to Win32DiskImager. Select the Drive letter corresponding to your new SD (F:\ in my case) and the same “.img” file you just downloaded. Click “Write” to create your new system image using Win32DiskImager
- Make a cup of coffee… you will have time to wait.
- Now back up your SD Card – see how to do this here…
- Pop the newly created system image card into the SD card slot on your Raspberry – you are ready to boot up!
You now have a system image ready to boot your RPI with, but there is one last gotcha, if the image you downloaded was originally from a 16gb card (most likely) and you have a 64gb card, only 16gb of the SD card will be recognised when you boot up the Raspberry. To fix this, see my article on expanding your SD image partition to fill your card, so you can use all of it. Its easy but better described in its own article here.
Where am I, what time is it?
Raspberry Pi’s, unlike most computers, do not come with a Real Time Clock – that means they do not know or maintain the time and date (and time zone) for you. Some mounts do have their own GPS built in, which via INDI, can update your astronomy software with this information including time zone.
If yours doesn’t, don’t panic, there are an easy and cheap fixes you can employ to suit your needs.
- If your RPI is internet or network connected then Astroberry / Stellarmate should be able to get date/time and zone automatically from the connection, but it won’t save it and will get it again the next time you connect once you power down;
- You can add a really cheap RTC extension board to your RPI so it maintains time/date once set – these are about $/£5.
- You could add a compatible GPS dongle to the RPI and INDO will use that for time/date/zone and more importantly location is so configured. This is a great solution if you go out in the field to different locations with your rig and your mount doesn’t have GPS. See the separate article on what to choose and how to set it up for Astroberry.
Keep me updated?
Raspberry Pi’s like most computers should be kept up to date with the latest software and firmware (hardware) updates. That means software not only that you run like Kstars, INDI drivers features and fixes but also the operating system your RPi runs on. Don’t worry, because of APT (Advanced Packaging Tool), its really quite easy even for a noob.
- Make sure it is internet connected then use VNC viewer to remote into it;
- Double click the software updater icon to launch a GUI to manage updating your device
- Using the Terminal window, simply type “sudo apt-get update && sudo apt-get -y upgrade” and type your password when requested.
- Reboot when it is finished.
- Make sure it is internet connected then use VNC viewer to remote into it;
- Launch Terminal;
- Type “sudo apt update” and when its complete “sudo apt upgrade” – I tend to not chain the commands with “&&” as I like to review what it plans to upgrade before it does it.
- Reboot when done “sudo reboot” in Terminal
A few tips…
- If you also want to ensure the firmware (i.e. hardware) is also upgraded when you update your RPi, replace “sudo apt upgrade” with “sudo apt full-upgrade”
- Never pull the power when updating, you have a SD card backup right?
- Backup you SD card regularly, before you upgrade it preferably, just in case…
- The update files are stored on your SD card eating up your valuable space so after successfully updating & rebooting you can remove them with “sudo apt clean” in terminal.
I hope you agree that it is really easy to build and run a Raspberry Pi if you have never done so before. There are of course many different ways of achieving the same outcomes, this is just the way I do it.
Apologies to Apple Mac users out there – I am not one so your software will differ on the SD card imaging side…
Comments and questions welcome as always… I will endeavor to respond promptly
You may also like…
Astronomy automation 101
A beginners introduction to the different terms and principles of amateur astronomy automation. We...
Ensuring Astroberry, KStars (and Ekos) knows where you are is really important. You can't track...
Connecting to KStars
When connecting to KStars using a Rasperry Pi running Astroberry, there are multiple way to...