The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

Review


(^192) The Official Raspberry Pi Projects Book raspberrypi.org/magpi
Review
Turn
your Pi into
a Lilliputian
ghetto
blaster
Pimoroni
Maker
Says
SPEAKER PHAT
SPEAKER PHAT
imoroni’s Speaker pHAT
may not sound all that
phat, but it does offer
a neat way to quickly add audio
to your projects. This Pi Zero-
sized board manages to cram
in a mini speaker, I^2 S DAC, and
mono amplifier. We particularly
appreciate the 1980s boombox-
style art on the top of the board,
complete with a ten-LED bar graph.
Since the 8 Ω speaker has just
2 W of power, you won’t exactly
be rocking the neighbourhood. It
sounds more like a tinny transistor
radio than a ghetto blaster,
offering little in the way of bass
(and obviously no stereo), so it’s
certainly no rival for high-quality
audio add-ons from the likes of
IQaudIO and JustBoom. But then
that’s not what it’s intended for;
instead, it should prove suitable for
projects that require audio output
for notification sounds or speech.
Indeed, it would be ideal for the
digital whoopee cushion in this
book (see page 102), precluding the
need to wire up a separate powered
speaker. Other use cases include
a retro gaming handheld or – by
pairing it with a mini microphone



  • a DIY voice assistant based on
    Amazon Alexa or the like.
    The Speaker pHAT comes in kit
    form, requiring about 30 minutes to
    assemble. First, you need to screw
    the speaker to the rear of the board,
    using tiny spacer nuts, which is a
    little fiddly. Then it’s time to get
    the soldering iron out. Soldering
    the speaker’s two terminals to the
    board contacts with the supplied
    24 AWG wire is a bit awkward and
    you need to use tweezers to hold
    the bare wire as it gets hot! It’s
    then simply a matter of soldering
    on the 40-pin female header and
    the pHAT is ready to use.
    Installation of the software is
    achieved with a single Terminal


command. It should then work as
the default audio output, although
you may need to reboot the Pi first.
We tested it out with aplay and

mplayer from the command line,
as well as Sonic Pi and YouTube
in the Chromium web browser.
There’s also a library for manually
controlling the LEDs if you want.

A tiny speaker board for adding sound to projects


P


MINI
PORTABLE
SPEAKER
Powered or
charged via USB
and connecting
to the audio
out port of a
standard Pi (but
not Zero), this
mini speaker
packs a punch.

magpi.cc/2diQyHq

Related


£12 / $16


magpi.cc/2kXdZsE


£12 / $13


Last word


Not one for audiophiles,
the „peaĩer pBe‰ oýers
rudimentary sound quality
with little power. It is
nevertheless a great way of
adding audio to projects, with
its tiny Zero-size footprint and
no need for a separate power
supply. It looks cute too.

It is nevertheless a great way


of adding audio to projects

Free download pdf