This morning, the Raspberry Pi Foundation announced the immediate availability of the SenseHAT. The SenseHAT is the guts of the Astro Pi and has an inherent space-aged coolness built in. The board you hold in your hands is the same hardware that is going into space (enormous metal flight case not included). I was fortunate enough to be given one to look at and review.
If you prefer to get your information from a video, jump straight to the video demo.
If you don’t want to read everything and want to know where to buy one from, jump to the Pricing section.
Background
As I said above, the SenseHAT is the heart of the Astro Pi. British astronaut Tim Peake will be launching on 15th December on a mission known as “Expedition 46” (or Soyuz TMA-19M). Part of the payload of the spacecraft will be two Raspberry Pi model B+s with SenseHATs attached, wrapped in a metal flight case. Also contained within each case is a Pi camera: one is a regular camera, the other is a PiNoIR. The Soyuz spacecraft will lift off and travel to the International Space Station and return on 5th May next year. During the mission, Peake (and possibly other astronauts) will trigger experiments on the Pis that school children have written.
Hardware
The SenseHAT has the following features:
- A temperature and humidity sensor.
- A pressure sensor.
- A sensor combining a 9-degrees-of-freedom accelerometer, gyroscope and magnetometer.
- An 8×8 matrix of bright LEDs controlled by an onboard Atmel Tiny 88 chip.
- A 4-way digital joystick with a push button in the middle.
For full technical specifications, take a look at the Foundation’s blog post. For the technical schematic, take a look here.
Software
The software was easy to install. I won’t go into the method I used to install as the ‘official’ way is slightly different. According to the GitHub repository (which hadn’t been updated when I took the other route) says installing is as simple as this:
sudo apt-get update sudo apt-get install sense-hat sudo pip-3.2 install pillow sudo reboot
You only need “pillow” if you’re going to program in Python 3.
* If you have any problems getting it working after these installs, try enabling I2C through raspi-config.
The main bulk of the software is a Python library that I believe works in both Python 2 and Python 3. You use the library by first of all importing the package:
from sense_hat import SenseHat
and then instantiate the module as an object:
sense = SenseHat()
You can then use the in-built functions to access data from all the sensors and display information on the 8×8 matrix.
All the software is on GitHub in case you need to look at it and there is an API guide over at PythonHosted.org – pay particular attention to the API documentation (most notably set_imu_config() if you want to get the compass working correctly!)
Examples
The software comes with a few examples to get you going. They are:
- colour_cycle.py – lights up the 8×8 matrix and cycles through a lot of the colours available to you when programming it.
- compass.py – by holding the Pi in the right orientation, the 8×8 matrix shows a dot pointing North.
- pygame_joystick.py – a PyGame script that takes input from the joystick on the SenseHAT and lights up in the appropriate position. The joystick mimics the up-down-left-right arrows and carriage return, making it easy to pick up on the ‘key presses’ in Pygame.
- rainbow.py – a simple test of the 8×8 matrix – it displays an animated rainbow (see picture below – thanks to Alex Eames for the photo as my one didn’t show it off very well!).
- rotation.py – displays a ? symbol and rotates it through 4 different orientations. Rotation is really easy using the library.
- space_invader.py – loads an image file of a space invader icon and displays it on the 8×8 matrix.
- text_scroll.py – scrolls a message across the 8×8 matrix. Again, the library makes scrolling text very simple.
Photo credit: Alex Eames
Taking things further
I wanted to try out a few things on the board but didn’t have the time to create something myself. So, I took to Google and GitHub and found these terrific examples.
- A snake game by Martin O’Hanlon
- Using the SenseHAT to rotate a model of a spacecraft by Serge Schneider.
- Some other examples by Ben Nuttall
If you try these examples, you may have to change library references from “AstroPi” to “SenseHat”.
You can see a video of some of these examples as well as a general overview of the board below. I apologise for the abrupt cut-off – I ran out of space on my mobile phone!
If you’d like to see Matthew Timmons-Brown’s take on the board, view his video below:
The RRP for the board is $30 and that works out (ignoring the exchange rate disparity!) at £25. It is available now in the UK from The Pi Hut, Pimoroni, the RPF Swag Store and CPC. If you’re in the States, take a look at MCM Electronics.
Conclusion
The SenseHAT is a real stunner. It is stuffed with functionality. It has the killer three things that you want: control (the joystick), display (the matrix) and lots of sensors. The price is very reasonable for what you get, especially if you compare it to something like the Unicorn HAT which just has the 8×8 matrix. For effectively the same price, you get all this extra stuff to use! (Admittedly, the Unicorn does have bigger, brighter LEDs. You pays your money, you takes your choice).
The only negative thing I can think of is that the unused GPIO pins are not broken out. However, that’s not unusual for HATs in general so I don’t feel like marking the SenseHAT down at all. You could just about use the other pins by soldering onto the surface-mount points on the top.
Above all, the thing you should remember is that this hardware is going into SPACE. You’ll be able to use it to replicate the code that is being used on the International Space Station as well as develop your own experiments! As an educational tool, I can imagine it being used in a wide variety of different subjects and the price point makes it an attractive prospect for schools.
I have no hesitation in awarding this board a rating of 10/10.