The possibilities of the Sense HAT
Did you realise the Sense HAT has been available for over two years now? Used by astronauts on the International Space Station, the exact same hardware is available to you on Earth. With a new Astro Pi challenge just launched, it’s time for a retrospective/roundup/inspiration post about this marvellous bit of kit.
The Sense HAT explained
We developed our scientific add-on board to be part of the Astro Pi computers we sent to the International Space Station with ESA astronaut Tim Peake. For a play-by-play of Astro Pi’s history, head to the blog archive.
Just to remind you, this is all the cool stuff our engineers have managed to fit onto the HAT:
- A gyroscope (sensing pitch, roll, and yaw)
- An accelerometer
- A magnetometer
- Sensors for temperature, humidity, and barometric pressure
- A joystick
- An 8×8 LED matrix
You can find a roundup of the technical specs here on the blog.
How to Sense HAT
It’s easy to begin exploring this device: take a look at our free Getting started with the Sense HAT resource, or use one of our Code Club Sense HAT projects. You don’t even need to own one in order to dive in. Emulators are available offline on Raspbian and online on Trinket.
Fun and games with the Sense HAT
Use the LED matrix and joystick to recreate games such as Pong or Flappy Bird. Of course, you could also add sensor input to your game: code an egg drop game or a Magic 8 Ball that reacts to how the device moves.
Once December rolls around, you could brighten up your home with a voice-controlled Christmas tree or an advent calendar on your Sense HAT.
If you like the great outdoors, you could also use your Sense HAT to recreate this Hiking Companion by Marcus Johnson. Take it with you on your next hike!
Art with the Sense HAT
The LED matrix is perfect for getting creative. To draw something basic without having to squint at a Python list, use this app by our very own Richard Hayler. Feeling more ambitious? The MagPi will teach you how to create magnificent pixel art. Ben Nuttall has created this neat little Python script for displaying a photo taken by the Raspberry Pi Camera Module on the Sense HAT.
It’s also possible to incorporate Sense HAT data into your digital art! The Python Turtle module and the Processing language are both useful tools for creating beautiful animations based on real-world information.
A Sense HAT project that also uses this principle is Giorgio Sancristoforo’s Tableau, a ‘generative music album’. This device creates music according to the sensor data:
Science with the Sense HAT
This free Essentials book from The MagPi team covers all the Sense HAT science basics. You can, for example, learn how to measure gravity.
Our online resource shows you how to record the information your HAT picks up. Next you can analyse and graph your data using Mathematica, which is included for free on Raspbian. This resource walks you through how this software works.
If you’re seeking inspiration for experiments you can do on our Astro Pis Izzy and Ed on the ISS, check out the winning entries of previous rounds of the Astro Pi challenge.
But you can also stick to terrestrial scientific investigations. For example, why not build a weather station and share its data on your own web server or via Weather Underground?
Your code in space!
If you’re a student or an educator in one of the 22 ESA member states, you can get a team together to enter our 2017-18 Astro Pi challenge. There are two missions to choose from, including Mission Zero: follow a few guidelines, and your code is guaranteed to run in space!
That grid draw is just what I’ve been looking for.
That Sense Hat is a powerful piece of technology.
That’s a pretty amazing piece of hardware for $40
Is it compatible with the Raspberry Pi 3 model B?
Raspberry Pi Staff Janina Ander — post author
Yes, the Sense HAT is compatible with that model. You can use it with any Pi apart from the Compute Modules. If you want to use it with the Zero, you’ll have to use a soldered-on header or a hammer header, and for info on how to use it with the old form factor Model A and B, check out this forum post: https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=109521
How was the orange and white animation, under the “Art with Sense Hat” section, made? I couldn’t find a link to this project. It looks like a variation on Conway’s game of Life.
Raspberry Pi Staff Janina Ander — post author
I was thinking the same, but couldn’t find details for it myself. If you’d like to try Conway’s Game of Life on the Sense HAT, you can find a Python script Ben has written for it here: https://github.com/bennuttall/sense-hat-examples
to get you on the right path with the orange and white art