The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1

154 THE OFFICIAL RASPBERRY PI BEGINNER'S GUIDE


Gyroscope sensor: Used to sense changes in angle over time, technically known as angular
velocity, by keeping track of the direction of Earth’s gravity field – the force which pulls things
down towards the centre of the planet. Put simply, the gyroscopic sensor can tell when you
rotate the Sense HAT relative to the surface of the Earth and how quickly it’s rotating.
Accelerometer: Similar to the gyroscope sensor, but rather than monitoring an angle relative
to the Earth’s gravity it measures acceleration force in multiple directions. Combined, readings
(data) from the two sensors can help you track where a Sense HAT is pointing and how it’s
being moved.
Magnetometer: Measures the strength of a magnetic field, and is another sensor which can
help track the Sense HAT’s movements: by measuring the Earth’s natural magnetic field, the
magnetometer can figure out the direction of magnetic north. The same sensor can also be
used to detect metallic objects, and even electrical fields. All three of these sensors are built
into a single chip, labelled ‘ACCEL/GYRO/MAG’ on the Sense HAT’s circuit board.
Humidity sensor: Measures the amount of water vapour in the air, known as the relative
humidity. Relative humidity can range from 0%, for there being no water at all, to 100%, for
the air being completely saturated. Humidity data can be used to detect when it might be
about to rain!
Barometric pressure sensor: also known as the barometer, it measures air pressure.
Although most people will be familiar with barometric pressure from the weather forecast,
the barometer has a secret second use: it can track when you’re climbing up or down a hill or
mountain, as the air gets thinner and lower pressure the further you get from Earth’s sea level.
Temperature sensor: Measures how hot or cold the surrounding environment is, though it
is also affected by how hot or cold the Sense HAT is: if you’re using a case, you may find your
readings higher than you expect. The Sense HAT doesn’t have a separate temperature sensor;
instead, it uses temperature sensors built into the humidity and barometric pressure sensors.
A program can use one or both of these sensors; it’s up to you.

Installing the Sense HAT
If you have a physical Sense HAT, start by unpacking it and making sure you have all the
pieces: you should have the Sense HAT itself, four metal or plastic pillars known as spacers,
and eight screws. You may also have some metal pins in a black plastic strip, like the GPIO
pins on the Raspberry Pi; if so, push this strip pin-side-up through the bottom of the Sense HAT
until you hear a click.
The spacers are designed to stop the Sense HAT from bending and flexing as you use the
joystick. While the Sense HAT will work without them being installed, using them will help
protect your Sense HAT, Raspberry Pi, and GPIO header from being damaged.
Free download pdf