3

(coco) #1

Build an NFC-powered door lock


TUTORIAL


Forget keys and codes; secure your private hackspace with fob access!


Build an NFC-powered


door lock


ven if it’s completely unnecessary,
there’s always something quite
exciting about adding extra layers of
security to your workspace entrance,
harking back to childhood days of
asking “what’s the secret password?”
before letting your friends into your den. If you’re
anything like us, your space will have some pricey toys
and expensive equipment in it, so it can certainly give
you some extra piece of mind to have it protected by
an additional barrier from any would-be intruders!
This is a great first project if you’re just getting
started in the world of hacking and Raspberry Pi, as
we’ll learn not only about accepting input to the system
from something other than a standard keyboard
and mouse, but also about operating a relay switch
to control an entirely separate (and higher voltage)
electrical circuit.

Before we get started we’re going to assume that
you already have your Raspberry Pi all set up with the
latest version of Raspbian installed and up-to-date.
With that all ready, start by connecting up all the
hardware components.
First, plug in the RFID reader to any of the USB
ports. This type of reader is especially easy to work
with as it acts just like a keyboard, in that the operating
system sees the data contained in any fob presented
to it getting typed in, followed by a new line. To see
this for yourself, open up a text editor and then hold
each fob to the reader in turn; you’ll see a string of
numbers getting quickly typed in followed by a newline
character each time.

GPIO PINS
Next, connect your relay to the GPIO pins. It’s a 5 V
relay, so the positive pin (which will be labelled either

Paul Freeman-Powell


Paul is a technology
enthusiast, geek,
writer, presenter, video
producer, YouTuber,
drummer, husband, and
father to three children,
including twins. You
can find his website at
switchedonnetwork.com

E


Above
The finished build
with all components
connected. The
Electronic Door Strike
is powered by a
separate 12 V power
supply and switched
by the relay switch

@paulfp
Free download pdf