User Guide
Table Of Contents
192
9.2 Speakers
There are two types of speaker that work well for this type of
Raspberry Pi project: stereo, desktop PC speakers; and speakers
that have an HDMI input and built-in amplifier.
Speakers that have an HDMI input extract the audio information
from the HDMI signal. If you are using the HDMI output then you
do not have to change your configuration to use these speakers.
Stereo PC speakers come in two varieties: passive, and active.
Active speakers have their own power supply and can play
sounds at a much greater volume. Both types usually have a 3-
pole 3.5 mm stereo plug that you can connect into the Pi’s 3.5
mm output jack.
By default, if you connect an HDMI cable to the Pi then any audio
signals will also use that. You can force the audio out through the
3.5 mm output jack with the amixer command:
1. On the Application Launcher, click LXTerminal.
2. Type the following command and then press Enter:
sudo amixer cset numid=3 1
9.3 A Basic Doorbell
To make a doorbell, you can use a Python script to detect when
the button is pressed and then play a sound.
To begin:
1. On the Application Launcher, click LXTerminal.
2. To make a new folder for your doorbell project,
type the following command and then press Enter:
mkdir Doorbell
3. Click the Raspbian Menu button, point to
Programming, and then click Python 3.
4. In the Python Shell, on the Menu, click File and
then click New Window.