curl https://get.pimoroni.com/automationhat
| bash
This will guide through setting up for driver
software and examples. You may need to reboot
your Raspberry Pi afterwards.
04
Get sensitive
The PIR sensor has three connectors: one
for 5 V power in (which can be provided by the
HAT), ground, and in the centre is the data line.
Operation is very simple. If the sensor is triggered
by movement, the data line goes ‘high’ (outputs
current). After a period of no movement, it goes
low (no current). Its sensitivity can be controlled
by adjusting one of the potentiometers (the left
one when it’s turned upside down – see Figure 1).
The other potentiometer sets the minimum time
for which the sensor reports movement. We could
connect the PIR directly to the GPIO, but as the
HAT is now in the way, we’ll use its inputs instead.
Pimoroni’s Automation HAT
allows the safe connection of all
kinds of input and output devices
These motion sensors use
infrared to detect heat changes
caused by moving objects
Top Tip
Any buzzer
you like
You don’t have
use a loud siren. If
this is just for fun,
maybe a buzzer
may be better, or
could it play a silly
MP3 recording?
Adding alert
notifications allows
you to keep on eye
on things when
you’re away, and you
can add images too
TUTORIAL
Build an internet-connected room guard magpi.cc 43