Astro Pi launches tonight!

Last year, the Raspberry Pi Foundation ran the “Astro-Pi” competition, which gave children in the UK the chance to devise code-based science experiments for British astronaut Tim Peake to run aboard the International Space Station.Astro_Pi_Logo_WEB.png

The competition winners included one of our very own Code Clubs at Cranmere Primary School in Surrey, which was selected to have their code sent into space.

As part of our “Countdown to Space Mission“, we wanted to find out more about Cranmere Code Club, and how they came up with their winning experiment. We spoke to the club’s volunteer, Richard Hayler, who filled us in on the club and how they devised their “sweaty astronaut” code…

I’ve been running Code Club at Cranmere Primary school since September 2013. Currently I run two clubs, one for Years 5-6 and one for Years 3-4. We generally have a good mix of boys and girls in the clubs, and the winning team had 4 girls and 7 boys from various year groups.

How we got started

I first became aware of the Astro Pi competition through Twitter, and a link to the blog. I also saw it demonstrated at the BETT 2015 show. I told the children at the next Code Club session and they were immediately keen (they’re always keen and enthusiastic about everything).

All the team came up with their own ideas and I entered them all into the competition. Jasper was the student who thought up the ‘sweaty astronaut’ concept code after hearing about the AstroPi at the Raspberry Pi birthday party.   

The program uses the Astro Pi’s humidity sensor to detect the presence of an astronaut. In the controlled environment of the ISS, an astronaut’s breath should be enough to cause a rise in humidity. The code also displays status messages on the LED matrix and asks for confirmation when it thinks it has detected an astronaut. It will also take a picture with the Pi camera.

A call from the space agency

One Thursday some of the children had been asking about the Astro Pi competition and I said that I’d seen that they’d been judging the entries the previous week. I suggested that as we hadn’t heard anything, we probably shouldn’t get too excited.

Then, just as we were packing up, the school admin assistant came in and said there was a phone call for me. This was unusual to say the least. One thing I like about being at school is that nobody knows how to get in touch and I normally turn my mobile to silent while I’m in the club.

Then the admin assistant said it was “the space agency”.

I’m not sure who had the widest eyes at that point, me or the children.

The whistle was about to blow for the end of lunch so I told the children to quickly pack up and head off to class while I went to take the call. Halfway to the school office I realised that a couple of the (very excited) children were still following me. I sent them back and promised to come and tell them if there was any good news.


Receiving  a call from the UK Space Agency was very exciting. To then be told that your club was one of the two winning entries for the Astro-Pi Primary school competition was – literally – out of this world.

Because the results were not going to be announced officially until the following week,  I was asked if I could get away with not telling the children straight away. I explained that I had been actually running the club and that I would not escape the school alive if I didn’t tell the children what the call was about.

By the time I got back to the computing suite, most of the children had reluctantly returned to class. Fortunately one of the Y5 cohort had to come back through on the way to deliver the registers and I was able to tell her the fantastic news. Apparently there was quite a loud celebration when she delivered the news to her friends when she got back to her lesson.

Developing our code

We developed all of the code. We talked through the various elements the program would need to have and put together a flow diagram. As we started coding we tested the work in progress and added refinements and tweaks. The children had very definite ideas about usability and the highly interactive code is a result of this focus.

Their overall approach to the whole process was hugely impressive. However I think I am most proud of the way in which they had absolute confidence in their ability to write the program themselves, even when they got stuck on particular elements.  We split the code into small functions and allocated them to individual members of the team. When we assembled them into a single program, I was quite nervous that the whole thing just wouldn’t work. They were completely relaxed and seemingly unsurprised when it worked almost faultlessly first time.

I asked the children how they felt about winning the AstroPi competition, and apart from the obvious “it was great to win” sentiments, the key themes I picked up on were around confidence, pride and a general sense of success. I think most of this cohort were already firmly on the sci/tech side of things anyway. They key thing for me though, is that I can see that they have all developed strong skills around computational thinking, problem solving and taking a systematic approach to any task. These will serve them well whatever discipline they end up pursuing later in life.

Anyone can learn the essential skills of computer programming. Of course some people may find it easier than others.  But with a little practice and a positive attitude, everyone can get to the point where they can construct the steps needed to perform a particular task in their head, and then implement them in their language of choice. Once you can do that, you’re a coder.


The Code Clubbers with some Raspberry Pi goodies

You can watch the the Astro Pi flight computers launch on the 3rd of December, coverage will be on NASA TV!