Learn Sense HAT with Raspberry Pi
By Phil King. Posted
The Sense HAT is an official add-on board that adds a range of motion sensors to
Raspberry Pi, including a gyroscope, accelerometer, and magnetometer, along with
temperature, pressure, and humidity sensors. It also features an 8×8 LED matrix and
five-button joystick.
Advertisement
Christmas is coming – keep Santa on the right track with our Raspberry Pi gift guide!
Astro Pi resources
This versatile board was designed especially for a space mission. Two Astro Pi units – comprising a Raspberry Pi with Sense HAT in a special case – are currently aboard the International Space Station (ISS), orbiting 408km above the Earth. Astro Pi is an ESA (European Space Agency) project run with the Raspberry Pi Foundation. It enables young people to conduct scientific investigations in space by writing computer programs that run on the Astro Pi devices aboard the ISS. Students up to 19 years old can take part in the Mission Space Lab, while those 14 and under can get involved in the simpler Mission Zero. Even if you don’t want to take part, Astro Pi has a solid set of resources designed to help students set up the Sense HAT and collect data from it.
Experiment with the Sense HAT
While no longer available in print form, this compact book from The MagPi Essentials range can still be downloaded as a free PDF. An extensive feature on the Astro Pi mission details how the units were designed and then launched into space to reach their new home on the International Space Station – to be joined by British ESA astronaut Tim Peake soon after.

The book then launches into some step-by-step tutorials to help you get started with your Sense HAT, demonstrating how to display images on the LED matrix and how to read the various sensors on board, including the gyroscope, accelerometer, and magnetometer. Fun projects to code include a Gravity Simulator, Digital Magic 8 Ball, Interactive Pixel Pet, Astronaut Reaction Times Game, and Data Logger.
Raspberry Pi Projects

The Raspberry Pi Foundation’s learning resources website features several tutorials to help you get started with your Sense HAT and make some fun projects with it using Scratch or Python. Even if you don’t own a Sense HAT yet, you can experiment with writing Python programs in an online emulator to see the effects. Start with a simple Countdown Timer on the board’s LED matrix, before moving on to games such as Flappy Astronaut, Marble Maze, Tightrope, and Pong. More complex projects include an MP3 Music Player and Weather Logger. There's even a tutorial to explore SpaceCRAFT – a winning Astro Pi competition project – in which you can visualise data from the Sense HAT’s sensors in the Minecraft world.
When not editing books and contributing to The MagPi, Phil enjoys playing the piano (badly), astronomy, and watching classic sitcoms.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
M314 Alien Motion Tracker
Game over, man. Game over. It’s the ultimate tracker from Aliens.
Read more →
Christmas Gift Guide in Raspberry Pi Official Magazine 160
There’s a ton of great stuff in issue 160, including the incredible motion scanner, inspired by the film Aliens. It’s beautiful, it uses Raspberry Pi technology and makes a satisfying ping sound, and the best thing about it is that it actually works, thanks to a DreamHAT+ radar board. Yes, you too can join the […]
Read more →
Win a Raspberry Pi 500+ and Raspberry Pi Monitor!
Fancy getting the most powerful Raspberry Pi desktop setup? Raspberry Pi 500+ and Raspberry Pi monitor pair perfectly together for a portable – and fixed – desktop computer, powered by Raspberry Pi. We have a set to give away, and you can enter below. A Raspberry Pi 500+ & Raspberry Pi Monitor
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.