Astro Pi


Astro Pi

This Tuesday (15th December 2015), British Astronaut Tim Peake is due to head off into space for a six-month spell aboard the International Space Station (ISS). Part of his mission will be to carry out some experiments using a couple of specially augmented Raspberry Pi computers (known as Astro Pis) that were recently delivered to the ISS.

We thought it would be appropriate to mark this auspicious occasion by having a look at the Astro Pi Sense Hat software that Tim will be using aboard the ISS.

If you want to find out more about Tim’s mission, you can take a look at the Astro Pi website at the following link:

https://astro-pi.org/

As well as the information at the Astro Pi web site, there are plenty of other resources available, some of which will allow you to carry out some great experiments in the comfort of your own little piece of space. We’ve had a look around, and put together a collection of some of these links.

Getting Started

If you are totally new to the Raspberry Pi, you may need a bit of help just to get you started; and for this, there is an excellent ‘how to get started with the Raspberry Pi’ guide at the following link:

https://www.raspberrypi.org/help/quick-start-guide/

If you are already familiar with the Pi, you can probably skip this, and jump straight in and get going. All you will need, to do some of the Astro Pi Sense Hat experiments and programs, is a Raspberry Pi, and a Sense Hat. You can find both of these items at the following links:

http://cpc.farnell.com/raspberry-pi/raspberrypi3-modb-1gb/sbc-raspberry-pi-3-model-b-1gb/dp/SC14012

http://cpc.farnell.com/raspberry-pi/raspberrypi-sensehat/add-on-board-sense-hat-for-raspberry/dp/SC13930

Having got your kit together, you’ll find some great experiments to do, using some of the sensors and the display on the Sense Hat, at the following link:

https://astro-pi.org/get-involved/program-the-sense-hat/

In order to make use of the Astro Pi Sense Hat programs, you may first need to upgrade to the latest version of Raspbian (called Raspbian Jessie) or the latest version of NOOBS.  The easiest way to upgrade to these versions is to grab the latest version from the Raspberry Pi download site:

https://www.raspberrypi.org/downloads/

If you are not sure how to set up either NOOBS or Raspbian Jessie, we recommend that you download and install the latest version of NOOBS, by following the instructions at the link below:

https://www.raspberrypi.org/help/noobs-setup/

To help with the NOOBS installation, we have also put together a few other handy tips for setting up NOOBS at the following blog post:

http://www.makerspace-uk.co.uk/getting-started-with-noobs-on-the-raspberry-pi/

Although we recommend that you download and use the latest versions of NOOBS or Raspbian, it is possible to upgrade an older version by following the instructions at the following link:-

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121880

The latest versions of NOOBS and Raspbian Jessie should include the Sense Hat software library that you will need to run the Astro Pi Sense Hat programs. However, if you do have any problems, the Sense Hat software library can be downloaded separately by following the instructions at the following link:

https://www.raspberrypi.org/learning/astro-pi-guide/software.md

Code Examples

As already mentioned, there are a number of Python code examples that you can run on your Raspberry Pi, available from links at the Astro Pi web site. Many of these examples are available on GitHub. To download these from GitHub, navigate to the appropriate URL on your Raspberry Pi, for instance:

https://github.com/RPi-Distro/python-sense-hat

You should see a screen similar to that shown below:

Sense Hat Git Repository

Sense Hat Git Repository

In this screen, click on the ‘Download ZIP’ button, and save the zip file into the Raspberry Pi’s ‘downloads’ folder. Having downloaded the zip file, you can then open the zip file using the Xarchiver program, and extract the files into your root folder. This should create a new folder within your root folder; for instance, ‘python-sense-hat-master’ . To run the example programs, you will need to navigate to the ‘examples’ folder using the following command:

cd ~/python-sense-hat-master/examples

You will then be able to run any of these examples programs by typing in the appropriate command; for example:

python rainbow.py

Further Information

Another great resource that provides a really fun way to explore how to use some of the sensors and the LED matrix on the Sense Hat is the Apollo Soyuz demo program at:

https://www.raspberrypi.org/learning/astro-pi-guide/sensors/movement.md