Author Archives: David Honess

Sense HAT Emulator Upgrade

via Raspberry Pi

Last year, we partnered with Trinket to develop a web-based emulator for the Sense HAT, the multipurpose add-on board for the Raspberry Pi. Today, we are proud to announce an exciting new upgrade to the emulator. We hope this will make it even easier for you to design amazing experiments with the Sense HAT!

What’s new?

The original release of the emulator didn’t fully support all of the Sense HAT features. Specifically, the movement sensors were not emulated. Thanks to funding from the UK Space Agency, we are delighted to announce that a new round of development has just been completed. From today, the movement sensors are fully supported. The emulator also comes with a shiny new 3D interface, Astro Pi skin mode, and Pygame event handling. Click the ▶︎ button below to see what’s new!

Upgraded sensors

On a physical Sense HAT, real sensors react to changes in environmental conditions like fluctuations in temperature or humidity. The emulator has sliders which are designed to simulate this. However, emulating the movement sensor is a bit more complicated. The upgrade introduces a 3D slider, which is essentially a model of the Sense HAT that you can move with your mouse. Moving the model affects the readings provided by the accelerometer, gyroscope, and magnetometer sensors.

Code written in this emulator is directly portable to a physical Raspberry Pi and Sense HAT without modification. This means you can now develop and test programs using the movement sensors from any internet-connected computer, anywhere in the world.

Astro Pi mode

Astro Pi is our series of competitions offering students the chance to have their code run in space! The code is run on two space-hardened Raspberry Pi units, with attached Sense HATs, on the International Space Station.

Image of Astro Pi unit Sense HAT emulator upgrade

Astro Pi skin mode

There are a number of practical things that can catch you out when you are porting your Sense HAT code to an Astro Pi unit, though, such as the orientation of the screen and joystick. Just as having a 3D-printed Astro Pi case enables you to discover and overcome these, so does the Astro Pi skin mode in this emulator. In the bottom right-hand panel, there is an Astro Pi button which enables the mode: click it again to go back to the Sense HAT.

The joystick and push buttons are operated by pressing your keyboard keys: use the cursor keys and Enter for the joystick, and U, D, L, R, A, and B for the buttons.

Sense Hat resources for Code Clubs

Image of gallery of Code Club Sense HAT projects Sense HAT emulator upgrade

Click the image to visit the Code Club projects page

We also have a new range of Code Club resources which are based on the emulator. Of these, three use the environmental sensors and two use the movement sensors. The resources are an ideal way for any Code Club to get into physical computing.

The technology

The 3D models in the emulator are represented entirely with HTML and CSS. “This project pushed the Trinket team, and the 3D web, to its limit,” says Elliott Hauser, CEO of Trinket. “Our first step was to test whether pure 3D HTML/CSS was feasible, using Julian Garnier’s Tridiv.”

Sense HAT 3D image mockup Sense HAT emulator upgrade

The Trinket team’s preliminary 3D model of the Sense HAT

“We added JavaScript rotation logic and the proof of concept worked!” Elliot continues. “Countless iterations, SVG textures, and pixel-pushing tweaks later, the finished emulator is far more than the sum of its parts.”

Sense HAT emulator 3d image final version Sense HAT emulator upgrade

The finished Sense HAT model: doesn’t it look amazing?

Check out this blog post from Trinket for more on the technology and mathematics behind the models.

One of the compromises we’ve had to make is browser support. Unfortunately, browsers like Firefox and Microsoft Edge don’t fully support this technology yet. Instead, we recommend that you use Chrome, Safari, or Opera to access the emulator.

Where do I start?

If you’re new to the Sense HAT, you can simply copy and paste many of the code examples from our educational resources, like this one. Alternatively, you can check out our Sense HAT Essentials e-book. For a complete list of all the functions you can use, have a look at the Sense HAT API reference here.

The post Sense HAT Emulator Upgrade appeared first on Raspberry Pi.

European Astro Pi Challenge winners

via Raspberry Pi

In October last year, with the European Space Agency and CNES, we launched the first ever European Astro Pi challenge. We asked students from all across Europe to write code for the flight of French ESA astronaut Thomas Pesquet to the International Space Station (ISS) as part of the Proxima mission. Today, we are very excited to announce the winners! First of all, though, we have a very special message from Thomas Pesquet himself, which comes all the way from space…

Thomas Pesquet congratulates Astro Pi participants from space

French ESA astronaut Thomas Pesquet floats in to thank all participants in the European Astro Pi challenge. In October last year, together with the European Space Agency, we launched the first ever European Astro Pi challenge for the flight of French ESA astronaut Thomas Pesquet to the International Space Station (ISS) as part of mission Proxima.

Thomas also recorded a video in French: you can click here to see it and to enjoy some more of his excellent microgravity acrobatics.

A bit of background

This year’s competition expands on our previous work with British ESA astronaut Tim Peake, in which, together with the UK Space Agency and ESA, we invited UK students to design software experiments to run on board the ISS.

Astro Pi Vis (AKA Ed) on board the ISS. Image from ESA.

In 2015, we built two space-hardened Raspberry Pi units, or Astro Pis, to act as the platform on which to run the students’ code. Affectionately nicknamed Ed and Izzy, the units were launched into space on an Atlas V rocket, arriving at the ISS a few days before Tim Peake. He had a great time running all of the programs, and the data collected was transmitted back to Earth so that the winners could analyse their results and share them with the public.

The European challenge provides the opportunity to design code to be run in space to school students from every ESA member country. To support the participants, we worked with ESA and CPC to design, manufacture, and distribute several hundred free Astro Pi activity kits to the teams who registered. Further support for teachers was provided in the form of three live webinars, a demonstration video, and numerous free educational resources.

Image of Astro Pi kit box

The Astro Pi activity kit used by participants in the European challenge.

The challenge

Thomas Pesquet assigned two missions to the teams:

  • A primary mission, for which teams needed to write code to detect when the crew are working in the Columbus module near the Astro Pi units.
  • A secondary mission, for which teams needed to come up with their own scientific investigation and write the code to execute it.

The deadline for code submissions was 28 February 2017, with the judging taking place the following week. We can now reveal which schools will have the privilege of having their code uploaded to the ISS and run in space.

The proud winners!

Everyone produced great work and the judges found it really tough to narrow the entries down. In addition to the winning submissions, there were a number of teams who had put a great deal of work into their projects, and whose entries have been awarded ‘Highly Commended’ status. These teams will also have their code run on the ISS.

We would like to say a big thank you to everyone who participated. Massive congratulations are due to the winners! We will upload your code digitally using the space-to-ground link over the next few weeks. Your code will be executed, and any files created will be downloaded from space and returned to you via email for analysis.

In no particular order, the winners are:

France

  • Winners
    • @stroteam, Institut de Genech, Hauts-de-France
    • Wierzbinski, École à la maison, Occitanie
    • Les Marsilyens, École J. M. Marsily, PACA
    • MauriacSpaceCoders, Lycée François Mauriac, Nouvelle-Aquitaine
    • Ici-bas, École de Saint-André d’Embrun, PACA
    • Les Astrollinaires, Lycée général et technologique Guillaume Apollinaire, PACA
  • Highly Commended
    • ALTAÏR, Lycée Albert Claveille, Nouvelle Aquitaine
    • GalaXess Reloaded, Lycée Saint-Cricq, Nouvelle Aquitaine
    • Les CM de Neffiès, École Louis Authie, Occitanie
    • Équipe Sciences, Collège Léonce Bourliaguet, Nouvelle Aquitaine
    • Maurois ICN, Lycée André Maurois, Normandie
    • Space Project SP4, Lycée Saint-Paul IV, Île de la Réunion
    • 4eme2 Gymnase Jean Sturm, Gymnase Jean Sturm, Grand Est
    • Astro Pascal dans les étoiles, École Pascal, Île-de-France
    • les-4mis, EREA Alexandre Vialatte, Auvergne-Rhône-Alpes
    • Space Cavenne Oddity, École Cavenne, Auvergne-Rhône-Alpes
    • Luanda for Space, Lycée Français de Luanda, Angola
      (Note: this is a French international school and the team members have French nationality/citizenship)
    • François Detrille, Lycée Langevin-Wallon, Île-de-France

Greece

  • Winners
    • Delta, TALOS ed-UTH-robotix, Magnesia
    • Weightless Mass, Intercultural Junior High School of Evosmos, Macedonia
    • 49th Astro Pi Teamwork, 49th Elementary School of Patras, Achaia
    • Astro Travellers, 12th Primary School of Petroupolis, Attiki
    • GKGF-1, Gymnasium of Kanithos, Sterea Ellada
  • Highly Commended
    • AstroShot, Lixouri High School, Kefalonia
    • Salamina Rockets Pi, 1st Senior High School of Salamina, Attiki
    • The four Astro-fans, 6th Gymnasio of Veria, Macedonia
    • Samians, 2nd Gymnasio Samou, North Eastern Aegean

United Kingdom

  • Winners
    • Madeley Ad Astra, Madeley Academy, Shropshire
    • Team Dexterity, Dyffryn Taf School, Carmarthenshire
    • The Kepler Kids, St Nicolas C of E Junior School, Berkshire
    • Catterline Pi Bugs, Catterline Primary, Aberdeenshire
    • smileyPi, Westminster School, London
  • Highly Commended
    • South London Raspberry Jam, South London Raspberry Jam, London

Italy

  • Winners
    • Garibaldini, Istituto Comprensivo Rapisardi-Garibaldi, Sicilia
    • Buzz, IIS Verona-Trento, Sicilia
    • Water warmers, Liceo Scientifico Galileo Galilei, Abruzzo
    • Juvara/Einaudi Siracusa, IIS L. Einaudi, Sicilia
    • AstroTeam, IIS Arimondi-Eula, Piemonte

Poland

  • Winners
    • Birnam, Zespół Szkoły i Gimnazjum im. W. Orkana w Niedźwiedziu, Malopolska
    • TechnoZONE, Zespół Szkół nr 2 im. Eugeniusza Kwiatkowskiego, Podkarpacie
    • DeltaV, Gimnazjum nr 49, Województwo śląskie
    • The Safety Crew, MZS Gimnazjum nr 1, Województwo śląskie
    • Warriors, Zespół Szkół Miejskich nr 3 w Jaśle, Podkarpackie
  • Highly Commended
    • The Young Cuiavian Astronomers, Gimnazjum im. Stefana Kardynała Wyszyńskiego w Piotrkowie Kujawskim, Kujawsko-pomorskie
    • AstroLeszczynPi, I Liceum Ogolnokształcace w Jasle im. Krola Stanislawa Leszczynskiego, Podkarpackie

Portugal

  • Winners
    • Sampaionautas, Escola Secundária de Sampaio, Setúbal
    • Labutes Pi, Escola Secundária D. João II, Setúbal
    • AgroSpace Makers, EB 2/3 D. Afonso Henriques, Cávado
    • Zero Gravity, EB 2/3 D. Afonso Henriques, Cávado
    • Lua, Agrupamento de Escolas José Belchior Viegas, Algarve

Romania

  • Winners
    • AstroVianu, Tudor Vianu National High School of Computer Science, Bucharest
    • MiBus Researchers, Mihai Busuioc High School, Iași
    • Cosmos Dreams, Nicolae Balcescu High School, Cluj
    • Carmen Sylva Astro Pi, Liceul Teoretic Carmen Sylva Eforie, Constanța
    • Stargazers, Tudor Vianu National High School of Computer Science, Bucharest

Spain

  • Winners
    • Papaya, IES Sopela, Vizcaya
    • Salesianos-Ubeda, Salesianos Santo Domingo Savio, Andalusia
    • Valdespartans, IES Valdespartera, Aragón
    • Ins Terrassa, Institut Terrassa, Cataluña

Ireland

  • Winner
    • Moonty1, Mayfield Community School, Cork

Germany

  • Winner
    • BSC Behringersdorf Space Center, Labenwolf-Gymnasium, Bayern

Norway

  • Winner
    • Skedsmo Kodeklubb, Kjeller Skole, Akershus

Hungary

  • Winner
    • UltimaSpace, Mihaly Tancsics Grammar School of Kaposvár, Somogy

Belgium

  • Winner
    • Lambda Voyager, Stedelijke Humaniora Dilsen, Limburg

FAQ

Why aren’t all 22 ESA member states listed?

  • Because some countries did not have teams participating in the challenge.

Why do some countries have fewer than five teams?

  • Either because those countries had fewer than five teams qualifying for space flight, or because they had fewer than five teams participating in the challenge.

How will I get my results back from space?

  • After your code has run on the ISS, we will download any files you created and they will be emailed to your teacher.

The post European Astro Pi Challenge winners appeared first on Raspberry Pi.

Desktop Sense HAT emulator

via Raspberry Pi

If this post gives you a sense of déjà-vu it’s because, last month, we announced a web-based Sense HAT emulator in partnership with US-based startup Trinket.

Today, we’re announcing another Sense HAT emulator designed to run natively on your Raspberry Pi desktop, instead of inside a browser. Developed by Dave Jones, it’s intended for people who own a Raspberry Pi but not a Sense HAT. In the picture below, the sliders are used to change the values reported by the sensors while your code is running.

sense-emu

So, why do we need two versions?

  • For offline use, possibly the most common way Raspberry Pis are used in the classroom.
  • To accommodate the oldest 256 MB models of Raspberry Pi which cannot run the web version.
  • To allow you to integrate your Sense HAT program with any available Python modules, or other Raspberry Pi features such as the Camera Module.

The emulator will come pre-installed in the next Raspbian release but, for now, you can just install it by typing the commands below into a terminal window:

sudo apt-get update
sudo apt-get install python-sense-emu python3-sense-emu python-sense-emu-doc sense-emu-tools -y

You can then access it from the Desktop menu, under Programming.

The emulator closely simulates the Sense HAT hardware being attached to your Pi. You can read from the sensors or write to the LED matrix using multiple Python processes, for example.

sense-idle

Write your code in IDLE as before; there are also a number of examples that can be opened from the emulator’s built-in menu. If you then want to port your code to a physical Sense HAT, you just need to change

sense_emu

to

sense_hat

at the top of your program. Reverse this if you’re porting a physical Sense HAT program to the emulator, perhaps from one of our educational resources; this step isn’t required in the web version of the emulator.

sense-emu-prefs

There are a number of preferences that you can adjust to change the behaviour of the emulator, most notably sensor simulation, otherwise known as jitter. This costs some CPU time, and is disabled by default on the low-end Raspberry Pis, but it provides a realistic experience of how the hardware sensors would behave. You’ll see that the values being returned in your code drift according to the known error tolerances of the physical sensors used on the Sense HAT.

This emulator will allow more Raspberry Pi users to participate in future Astro Pi competitions without having to buy a Sense HAT: ideal for the classroom where 15 Sense HATs may be beyond the budget.

So, where do you start? If you’re new to the Sense HAT, you can just copy and paste many of the code examples from our educational resources, like this one. You can also check out our e-book Sense HAT Essentials. For a complete list of all the functions you can use, have a look at the Sense HAT API reference here.

You can even install this emulator on other types of Linux desktop, such as Ubuntu! For more information on how to do this, please visit the emulator documentation pages here.

The post Desktop Sense HAT emulator appeared first on Raspberry Pi.

Astro Pi Coding Challenges: a message from Tim Peake

via Raspberry Pi

Back in February, we announced an extension to the Astro Pi mission in the form of two coding challenges. The first required you to write Python Sense HAT code to turn Ed and Izzy (the Astro Pi computers) into an MP3 player, so that Tim Peake could plug in his headphones and listen to his music. The second required you to code Sonic Pi music for Tim to listen to via the MP3 player.

Astro_Pi_Logo_WEB-300px

We announced the winners in early April. Since then, we’ve been checking your code on flight-equivalent Astro Pi units and going through the official software delivery and deployment process with the European Space Agency (ESA).

Crew time is heavily regulated on the ISS. However, because no science or experimentation output is required for this, they allowed us to upload it as a crew care package for Tim! We’re very grateful to the UK Space Agency and ESA for letting us extend the Astro Pi project in this way to engage more kids.

The code was uploaded and Tim deployed it onto Ed on May 15. He then recorded this and sent it to us:

Tim Peake with the Astro Pi MP3 player

British ESA astronaut Tim Peake’s message to the students who took part in the 2016 Astro Pi coding challenges to hack his Astro Pi mini-computer, on the International Space Station, into an MP3 player. The music heard is called Run to the Stars composed by one of the teams who took part.

In total, there were four winning MP3 players and four winning Sonic Pi tunes; the audio from the Sonic Pi entries was converted into MP3 format, so that it could be played by the MP3 players. The music heard is called Run to the Stars, composed with Sonic Pi by Iris and Joseph Mitchell, who won the 11 years and under age group.

Tim tested all four MP3 players, listened to all four Sonic Pi tunes, and then went on to load more tunes from his own Spacerocks collection onto the Astro Pi!

Tim said in an email:

As a side note, I’ve also loaded it with some of my Spacerocks music – it works just great. I was dubious about the tilt mechanism working well in microgravity, using the accelerometers to change tracks, but it works brilliantly. I tried inputting motion in other axes to test the stability and it was rock solid – it only worked with the correct motion. Well done to that group!!

“That group” was Lowena Hull from Portsmouth High School, whose MP3 player could change tracks by quickly twisting the Astro Pi to the left or right. Good coding, Lowena!

Thanks again to everyone who took part, to our special judges OMD and Ilan Eshkeri, and especially to Tim Peake, who did this during his time off on a Sunday afternoon last weekend.

The post Astro Pi Coding Challenges: a message from Tim Peake appeared first on Raspberry Pi.

Principia schools conferences

via Raspberry Pi

Principia

In November this year the UK Space Agency (UKSA) is holding two special conferences to celebrate the educational work linked to Tim Peake’s Principia mission. These events will be an opportunity for kids of all ages to show their projects to a panel of leading space experts – hopefully including Tim himself!

Tim’s schedule after he returns to Earth is hectically busy, but he’s very keen to be at the events and meet children, and everyone involved is working hard towards this goal. The conferences will be held at:

Attendance is free, and UKSA are offering travel bursaries to help with the cost of getting there. However, if you want to go, you’ll need to apply for one of the available places.

The Principia mission has a huge range of linked educational activities, one of which is our own Astro Pi, and the conferences will be attended by students selected from across them all. There are about 500 student places available for each event; the individuals and teams who submit the strongest applications presenting their projects will be invited to take part.

Astro_Pi_Homepage_Cover

Astro Pi is one of many Principia activities

You certainly don’t need to have won one of the Principia competitions to be invited to participate: the organisers want to see all kinds of work linked with Tim’s mission. They want your application to tell the story behind what you did, describe what you’ve learned by carrying out the project, and explain what long-term effects the work has had on your school. We expect the conferences will include students presenting a huge variety of work, from activities linked to official competitions to creative ideas that students and teachers have generated themselves.

To illustrate the kind of applications we’re hoping to see, it’s worth mentioning the testimonial about Astro Pi that maths teacher Gillian Greig, from The Priory School in Hitchin, wrote last year. We think it’s a great example of the kind of story the organisers will enjoy seeing. Gillian, we hope you and your students will apply!

Of course, we’d love to see a strong Astro Pi contingent at both conferences, so we strongly encourage anyone who engaged with Astro Pi to apply. You can apply as an individual, a group, a class, or even an entire school. The applications will be judged by a panel who will select projects that show dedication and thoughtfulness.

Laser-etched Astro Pi

Flight equivalent Astro Pi units will be available at the conferences

Dave Honess, who manages Astro Pi, will be at both conferences with a number of flight equivalent Astro Pi units that can be used by attendees for their presentations.

The deadline for applications is Thursday 15 September 2016 at 12 noon. Apply here!

You can find more details about the application process, the conference venues, and arrangements for travel and accommodation on the Principia website. And if you have any questions, feel free to post them below – we’ll do our best to answer them.

Good luck!

The post Principia schools conferences appeared first on Raspberry Pi.

Astro Pi: Coding Challenges Results!

via Raspberry Pi

Astro_Pi_Logo_WEB-300px

Back in early February we announced a new opportunity for young programmers to send their code up the International Space Station to be used by British ESA Astronaut Tim Peake.

Two challenges were on offer. The first required you to write Python Sense HAT code to turn Ed and Izzy (the Astro Pi computers) into an MP3 player, so that Tim can plug in his headphones and listen to music. The second required you to code Sonic Pi music for Tim to listen to via the MP3 player.

The competition closed on March 31st and the judging took place at Pi Towers in Cambridge last week. With the assistance of Flat Tim!

The judges were selected from companies who have contributed to the Astro Pi mission so far. These were;

12omdfin_(live)-600x0

Orchestral Manoeuvres In the Dark (Andy McCluskey and Paul Humphreys)

We also wanted to have some judges to provide musical talent to balance the science and technology expertise from the aerospace people. Thanks to Carl Walker at ESA we were able to connect with synthpop giants OMD (Enola Gay, Electricity, Maid of Orleans) and British/French film composer Ilan Eshkeri (Stardust, Layer Cake, Shaun the Sheep).

ilanEshkeri_composing_Stardust

Ilan Eshkeri working on the Stardust soundtrack

We also secured Sam Aaron, the author of Sonic Pi and Overtone, a live coder who regularly performs in clubs across the UK.

sam-aaron

Sam Aaron at TEDx Newcastle

Entries were received from all over the UK and were judged across four age categories; 11 and under, 11 to 13, 14 to 16 and 17 to 18. So the outcome is that four MP3 players and four songs will be going up to the ISS for Tim to use. Note that the Sonic Pi tunes will be converted to MP3 so that the MP3 player programs can load and play the audio to Tim.

The judging took two days to complete: one full day for the MP3 players and one day for the Sonic Pi tunes. So without further ado, let’s see who the winners are!

MP3 Player Winners

11 and under

11 to 13

14 to 16

  • Winner: Joe Speers
  • School: n/a (Independent entry)
  • Teacher/Adult: Craig Speers
  • Code on Github

17 to 18

Sonic Pi Winners

11 and under

11 to 13

  • Winner: Isaac Ingram
  • School: Knox Academy
  • Teacher/Adult: Karl Ingram

14 to 16

17 to 18

Congratulations to you all. The judges had a lot of fun with your entries and they will very soon be uploaded to the International Space Station for Tim Peake. The Astro Pi Twitter account will post a tweet to indicate when Tim is listening to the music.

The Raspberry Pi Foundation would like to thank all the judges who contributed to this competition, and especially our special judges: Andy McCluskey and Paul Humphreys from OMD, Ilan Eshkeri and Sam Aaron.

The post Astro Pi: Coding Challenges Results! appeared first on Raspberry Pi.