The MagPi - February 2020

(Greg DeLong) #1
> Raspberry Pi A
Zero is at its heart

> The project cost
less than £

> It displays to a
Scroll pHAT HD

> The students
made use
of Python

> Enviro pHAT
measures
tri-axis motion

Quick FA C T S


“When the students saw the size of the
Raspberry Pi Zero they would be using and the
size of the pHATs involved, they quickly ruled out
having the device as a watch,” Jon says. “Instead,
the group focused on how they could combine two
pHATs (the Enviro pHAT and the Scroll pHAT HD)
to record data from an analogue pulse sensor and
accelerometer data from the on‑board sensors of
the Enviro pHAT. The Scroll pHAT HD would be
used to display the data recorded.”


Jon says the pulse sensor – which fits over the
forefinger and allows heartbeats to be measured –
uses a simple three‑resistor voltage divider to drop
its output voltage to 3 V. This is then fed into one of
the analogue pins on the Enviro pHAT.


Stepping up
As for the steps counter, the accelerometer data is
taken from the Enviro pHAT’s on‑board sensors.
“These two data sources are then read into the
students’ Python program and they’re displayed


across the LEDs of the Scroll pHAT HD,” Jon adds.
He says the design makes use of the fact that
both the Enviro pHAT and Scroll pHAT HD are I^2 C
devices with different registers for each pHAT.
“The students used a header with extra‑long pins
to solder to the Enviro pHAT; this meant that the
Scroll pHAT HD could then be ‘stacked’ on top of
the Enviro pHAT, effectively chaining up multiple
I^2 C devices.”
Given more time, Jon thinks the students could
strive for greater accuracy: “The project could look
at how to take the raw data from the accelerometer
and accurately count steps with it, and also how to
convert the high and low voltages recorded from the
pulse sensor into a count of heartbeats per minute.”
But it has taught valuable lessons in project
originality and creativity along with teamwork,
problem-solving, and presentation skills. “Running
this unit has proven that the Raspberry Pi is a great
device for teaching physical computing and the
students take to it with enthusiasm,” Jon says.

Elena Lardies Lopez,
Harriette Pemberton,
and Myrtle Morley
showcase their
class project in
a PowerPoint
presentation
wo of the main T
components in this
simple build that was
used to help students
learn more about
connecting and
controlling devices
with Raspberry Pi

The students learn about


connecting electronic


devices and controlling


them from a Raspberry Pi


Heart-rate monitor magpi.cc 15

PROJECT SHOWCASE

Free download pdf