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

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.

 magpi.cc/sensehatpong

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.

magpi.cc/sensehatmarble

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.

magpi.cc/sensehatnightclock

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.

magpi.cc/sensehadocs


From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.