Learn with Raspberry Pi Sense HAT
By Rosie Hattersley. Posted
The Raspberry Pi Sense HAT is an add-on board for the Raspberry Pi, designed to provide a range of environmental sensors and input/output capabilities. It was originally developed for the Astro Pi mission, a project by the Raspberry Pi Foundation and the European Space Agency (ESA) to send Raspberry Pi computers to the International Space Station (ISS) for educational purposes.
Start out with the Raspberry Pi Sense HAT product page. Here you will find more information on the components, a link to buying a Sense HAT, along with links to Astro Pi, the Python library, and the Sense HAT Product Brief
Advertisement
Get started with Raspberry Pi – everything you need to know to start your journey!
Projects
Movement and LED-based projects to try for yourself

Raspberry Pi Sense HAT Pong
Paying homage to the original computer game, this walkthrough on how combine a Sense HAT and Raspberry Pi, plus some Python code to create classic Pong, is bound to appeal to retro gamers. There’s even a link to a video of the original game being played on an oscilloscope.
Sense HAT Marble Maze
Orientation sensors on the Sense HAT detect which way the virtual marble (in the guise of coloured LEDs) is travelling in this tricky maze puzzle. Have fun following the setup guide, before setting a timer and challenging your friends to escape the maze in the fastest time.
Night clock
Lorna Jane’s tutorial shows you how the LED matrix can be used as a useful and quirky display that can be used as an at-a-glance bedside time check, without having to turn on the light or phone display.
Raspberry Pi Sense HAT set up guide

Now we’ve whetted your appetite about things a Sense HAT can do, head to this useful guide to set up. As this guide explains, the Sense HAT contains a number of on-board sensors to measure temperature, humidity, colour, movement, and orientation, and also has an LED grid to display the results of your investigations. With its origins as a sensing device destined to go into space with the European Space Agency, and as a teaching aid as part of the Astro Pi project, there’s little the Sense HAT can’t do.
This tutorial walks you through displaying text, images, and measuring the orientation of the Sense HAT device, before detecting movement using the joystick for input, and putting it all together to create your own projects that sense and react to their surroundings.
magpi.cc/gettingstartedsensehat
Sense HAT documentation

The official documentation will walk you through some of the more advanced aspects of Sense HAT and how to use this Raspberry Pi accessory with different computer languages, including C++ as well as Scratch and Python. Each of the sensors (gyroscope and magnetometer and barometric pressure sensor among them) is covered, along with calibration for the magnetometer and accelerometer. The official documentation also covered reading and writing the EEPROM data. Also take a look at the corresponding Sense HAT Python documentation, linked to from the official documentation. Here you will find Python API examples and the Sense HAT API reference guide, ideal for all your coding needs.
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
Get started with Raspberry Pi in Raspberry Pi Official Magazine 161
There’s loads going on in this issue: first of all, how about using a capacitive touch board and Raspberry Pi 5 to turn a quilt into an input device? Nicola King shows you how. If you’re more into sawing and drilling than needlework, Jo Hinchliffe has built an underwater rover out of plastic piping and […]
Read more →
Win one of three DreamHAT+ radars!
That’s right, an actual working radar for your Raspberry Pi. We reviewed it a few months ago and have since been amazed at some of the projects that have used it, like last month’s motion sensor from the movie Aliens. Sound good? Well we have a few to give away, and you can enter below. […]
Read more →
RP2350 Pico W5 review
It’s Raspberry Pi Pico 2, but with a lot more memory
Read more →