Introduction: Garage Door Fingerprint Lock

This is an electronic garage door opener designed around a SparkFun GT-511C1R fingerprint scanner. There is already a very good instructable by user nodcah that describes how to build almost this exact device, from which I took 99% of my inspiration. I'm posting this to easily share with my local makerspace, and for anyone who likes to see things done slightly differently.

Step 1: Soldering/Wiring

The door opener system consists of two components: a control panel on the outside of the garage with the fingerprint scanner, a small screen, and some buttons in a weatherproof housing; and a small box inside the garage that verifies when a recognized fingerprint has been scanned and opens the door, and also converts whatever power you provide into 3.3 Volts. An ATMega328p microcontroller is the brains of the exterior control panel, and an ATTiny lives in the box inside the garage. The two MCUs communicate over a serial connection. The ATTiny biases a transmitter to close the connection for the garage door switch when it receives a specific code phrase over the serial connection. This way a mildly clever vandal can't break into the garage by ripping off the control panel and crossing a couple wires.

Though the datasheet claims this FPS can handle up to 6 Volts, I'm skeptical since the better model requires 3.3, and since the MCUs are happy with 3.3 Volts and the LCD requires it we'll just power the whole thing that way.

Parts List:

  • GT-511C1R Fingerprint Scanner (make sure to buy the JST connector too)
  • Nokia 5110 LCD
  • ATMega328p microcontroller
  • ATTiny85 microcontroller
  • MCP1700-3V3 voltage regulator
  • 10 uF capacitor (2)
  • 10 kOhm resistor (3)
  • 100 Ohm resistor (3)
  • tall momentary pushbutton (3)
  • ic sockets, 28-pin and 8-pin, protects MCUs when soldering and nice if you want to reprogram them
  • terminal block, for connecting the control panel wires to the interior box without the need to solder
  • weatherproof exterior utility box, like this one maybe
  • a small rectangular piece of acrylic for the front cover of the control panel to keep things classy
  • 5V DC converter, such as a phone charger

Use the attached schematic to solder together the circuits for the control panel and interior module on some protoboard or however you like to roll. You will solder the JST connector and some flying wires (I found ribbon cable keeps things organized) for the FPS and LCD, so they can hang loose and be secured to the front panel of the control panel. Examining the code in later steps will reveal that the buttons wired to pins 12, 13, and 14 (i.e. Arduino pin 6, 7, and 8) serve the functions "up", "OK", and "down", respectively. So, you may want to arrange them this way on the board to keep things nice and logical.

I cut the microUSB connector off of an extra phone charger to power everything, since they're cheap and easy to come by if you stay away from the Apple Store. You could run the whole thing with batteries (although don't give too much voltage to the poor little MCP1700 or he'll get hot), but the FPS must drain a lot of power because when I tried it with 3xAAA it only worked for about a day.

The two modules are connected by three wires - one for 3.3V, one for ground, and one from TX on the ATMega328p to pin 5 (aka Arduino pin 0) on the ATTiny, which will be RX for a software serial connection. Twisting them together makes them easier to thread through and looks neato.

Step 2: Coding and Flashing

I used the Arduino IDE to write and compile the attached code for the two MCUs- garagefinger.ino for the ATMega328p in the control panel and tiny_switch.ino for the ATTiny85 inside the garage. NokiaLCD.cpp and NokiaLCD.h are barebones libraries for the LCD that I put together from examples on the Arduino site - they should be put in the "libraries" folder for your Arduino IDE, wherever that lives (on Windows it's usually %HOMEPATH%\Documents\Arduino\libraries).

You will also need to obtain Arduino libraries for the FPS. Note that the FPS libraries linked on SparkFun's site will not work - they are for the more expensive model (GT-511C3) and not this cheapo version. Working libraries for the GT-511C1R can be found on github.

If you think a clever hacker might read this and solder the wires coming out of your garage onto something with a serial connection, you'll want to replace all instances of "secretstring" in each file to your own password - you may want to make it longer if you're really paranoid. You should also change the String buf in tiny_switch.ino so that it has the same length as your password. The variable overrideCode defined at the top of garagefinger.ino also contains an 8-bit representation of the sequence of up/down button presses that can be used to open the garage door and load new fingerprints into the sensor without scanning an known fingerprint. This is useful the first time you use the device, since the scanner's memory will be empty. One of the menus has an option to change the override sequence, after which the new sequence will be stored in EEPROM and will remain even if the device is powered off. You might want to change this initial value as well, in case you think clever, patient hackers are waiting to steal all the cool stuff you have in your garage by entering the standard override code before you have a chance to change it.

There are several ways to compile the code onto the MCUs. If you have an Arduino, you can simply compile the code directly onto it, then pop out the ATMega328p and use it in this project - but that won't work for the ATTiny. You could use the Arduino as ISP method described in NaughtySlayer18's instructable Programming the ATTiny. If you, like me, have a Raspberry Pi, you can use it to program your AVRs by downloading Kevin Cuzner's build of avrdude for the Raspberry Pi and following his detailed instructions. You will need to put the compiled files garagefinger.hex and tiny_switch.hex on your Pi, which Arduino normally hides from the user. On Windows, look in the most recent build* directory in %HOMEPATH%\AppData\Temp (be aware Arduino seems to delete this directory upon exit).

Step 3: Assembly

I used this weatherproof outlet box as the container for the control panel on the outside of the garage. I cut a piece of acrylic to fit into the interior of the box. Any reasonably rigid material could be used - I went with acrylic because I could cut it precisely with a laser cutter and it looks boss. I cut holes in the acrylic for the buttons, LCD, and FPS, as well as holes for screws to hold the protoboard in place and make it possible to remove in case I want to reprogram the chip with even cooler menus. I cut some standoffs out of acrylic, tapped holes in them for screws, and glued them into the outlet box with Gorilla Glue. I used hot glue to secure the FPS and LED to the control panel, but a less reckless and lazy person could use more tiny screws.

I mounted the outlet box on the outside of my garage after drilling a 1/2" hole through the doorframe and threading the 3 connecting wires through. I stuck the ATTiny's board inside a little project box, which I attached to the inside of the doorframe using some hook-and-loop tape (e.g. Velcro). I screwed the 3 wires from the control panel into the proper locations on the terminal block on the ATTiny board, as well as two wires from the garage door motor's door button terminals, leading to the collector and emitter of the transistor. I left the mind-numbingly primitive button wired in parallel to the garage door motor so I can still use it when I'm inside the garage.

Step 4: Usage

Pushing any of the three buttons will light up the screen and fingerprint scanner. The device waits for a finger to be pressed on the scanner. If the finger scanned is recognized, it will open the door and present a menu system that can be used to do things such as open/shut the door again, add or delete fingerprints to/from the scanner's memory, change the brightness/contrast of the display, etc. For the most part, the device will time out after roughly 8 seconds, turning off the screen and scanner and requiring authorization to get back into the menu system. To change the timeout length, study and modify the waitForButton function in garagefinger.ino.

An override sequence of up/down button presses, followed by "OK" can be used to gain access to the system. This is useful the first time the device is activated, since there will be no scans in the fingerprint scanner's memory, or if you want to allow someone access to the garage if you are away on vacation. The initial sequence is given by the 8-bit binary representation of the number stored in the variable overrideCode in garagefinger.ino, with "1" representing "up" and "0" representing "down". The code can be changed using the menu system, after which it will be stored in EEPROM and thus be saved even if power is disconnected from the device. A word of warning: if you change the override sequence and forget it without adding any fingerprints to the device, you will be effectively locked out and have to reprogram the ATMega328p and force an EEPROM erase to clear the forgotten code (or you could use a hammer to reprogram the whole thing and just not go in your garage any more).

Note that this gizmo is effectively still just a button - it doesn't know if your garage is open or closed. A little modification of the code and the addition of a photoresistor or, better yet, a Hall effect sensor could remedy this fairly easily. Then the code could be modified to allow the door to be closed without needing to scan a fingerprint, or to close the garage door after a preset amount of time if it is left open.

Comments

author
AJMansfield (author)2015-07-12

For better security, you could add challenge-response authentication between the outside and inside modules. That way simple replay attacks won't work either. (e.g. in Wargames, the way David used a tape recorder to break out of the room.)

author
robotmaker (author)AJMansfield2016-06-03

another item on security is that plastic is a bad enclosure ,its better to use metal with a tamper switch

the board and parts can be taken by the thief and plastic can easy get cracked

author
AJMansfield (author)robotmaker2016-06-06

A metal enclosure would mainly be better for making it resistant to vandalism, so is a good idea, but wouldn't do much to make it more resistant to being cracked by a determined opponent, since they will be able to get in one way or another. The tamper switch is a good idea though - the way to use it is to program the device to instantly delete its cryptographic key if the tamper switch is activated or the box loses external power (you'd need to add e.g. a large capacitor to give it enough time after losing external power). Then even an advanced adversary with the capability to snoop directly into the electronics as they are running may inadvertently thwart their efforts just by opening it up. You'd then have to have a way to manually reset the system and send the outside box a new key (after confirming that no covert additions have been made to capture it during this process) for initial setup, for when the power goes out, or for when you need to service the system.

author
Datawolf (author)AJMansfield2015-12-16

You want to improve the security, when a screwdriver is enough to open the box ?

author
AJMansfield (author)Datawolf2015-12-16

The point of using a challenge-response protocol is that it then doesn't matter if the outside hardware becomes compromised (e.g. by someone with a screwdriver) because they will still be unable to get the door to open - the only way to open the door is to use the original control pad because only it can formulate a correct response to the challenge sent by the interior module.

author
albedozero (author)AJMansfield2015-07-12

Good call (and good reference). You'd need to add an extra wire from TX on the ATTiny to RX on the ATMega, though - unless maybe you set up a hash algorithm on the ATTiny. Now you've got me thinking about how to code it.

author
albedozero (author)albedozero2015-07-14

Another thought - I wonder what kind of
security the FPS library uses? The serial connection between that and
the ATMega chip could be vulnerable too.

author
AJMansfield (author)albedozero2015-07-14

There are libraries for arduino that implement the needed crypto for a challenge-response already, for example https://github.com/lucadentella/ArduinoLib_TOTP.

author
Ryan AlbertA (author)2016-11-04

hi sir im joseph i would like your project ..i need your code for my thesis project

author
robotmaker (author)2016-06-06

here is the link to the board ,its TTL so should be easy to hook up to arduino or if use EZ ROBOT board it has interface already made

i already bought 5 for my robots

http://www.digikey.com/product-search/en?mpart=B5T001001G&v=39

author
robotmaker (author)2016-06-06

Face ID board is very costly but I use them in my robots for face recognition so I only need another low cost wifi camera for the door
Robot board like arduino I use is EZ robot plus recognition board

author
robotmaker (author)2016-06-06

Most locks you buy has a tamper switch and way you use it ,you have Bell or alarm circuit ,so does stop anyone breaking in

Nobody is going to stay there with alarm sounding off
Second you would set it up so the alarm stays on till you reset it from the inside

That's design I am working besides face ID and wifi plus can easy add to the robots I design to unlock the door if needed

author
robotmaker (author)2016-05-30

Biggest cost is the scanner with shipping
Would great to see it go down in price

author
jstork (author)2015-07-12

What is the estimated cost?

author
albedozero (author)jstork2015-07-12

$33.50 for the fingerprint scanner and cable, $7-$10 for the LCD, about $10 for the boxes, maybe $4 for the two AVR chips and a few extra bucks for the bits and pieces, depending on your build. So figure $60 unless you like to change things halfway through like me :)

author
robotmaker (author)albedozero2016-05-29

Looks like a good circuit,but amazon has a fingerprint with keypad door lock for $60

author
albedozero made it! (author)robotmaker2016-05-30

Fair point - I will respond with an image:

diyguy.jpg
author
albedozero (author)albedozero2016-05-30

But seriously - my 'ible is far from the first of this kind. Someone should whip up a cheaper build - if we all work together we can someday beat Amazon.

author
OlivierU made it! (author)2016-01-11

Can someone plz help me. I finished this build and now stuck on getting into the access menu. this is the first time i have powered it on, and the override code doesn't seem to work! I thought the buttons were my issue. but I have rebuilt the button circuit on a bread board and seem to be the same! The LCD and the finger scanner both seem to work as i get a 'not recognized' label on the LCD screen when using the scanner. Plz help!

WIN_20160112_17_01_49_Pro.jpgWIN_20160112_17_00_22_Pro.jpg
author
albedozero (author)OlivierU2016-01-19

Your build looks much neater than mine :) If you used the garagefinger.ino code without modification, the override code should be up-down-up-down-up-up-down-down followed by OK. I assume you've double-checked you haven't inverted the buttons or something like that. If you're still stuck, you could manually enroll some fingerprints in your FPS using the FPS_Enroll example code in the github repository (https://github.com/mdcanham/Fingerprint_Scanner-TTL-GT-511C1R). Then you can get logged in to your garage door opener and reprogram the override to whatever you want.

author
OlivierU (author)albedozero2016-01-28

Thanks for the reply!

I have tried all of the above and more. I have experimented with the sensor, the display, the library and your code and still seem to have no luck. What I did mange to find while tinkering with the finger scanner is that it sometimes misbehaves.

An example being, uploading the 'Blink' Sketch from the GT library --> seems to be working.

Whilst the 'Enroll' sketch has proven difficult as I see no communication in Serial. Nothing. Only a little RX light on the Arduino board, flashing as I furiously send random characters down the serial line.

And yes I have even qaud checked all my hardware connections, there solid. According to a multimeter.

All I can gather is that it might be my finger sensor. I'll just have to get another and finish this amazing build, Once and for all.

I'll post another comment when I do finish.

author
Statonwest (author)2015-08-22

Nice work. How much did this cost?

author
vmoorthi (author)2015-07-23

I would like to know how to start this project.....I'm new to this world....

author
vmoorthi (author)2015-07-23

could you please explain it briefly abt how to do this project sir...I would like to do it....this was my frst project I like to do......

author
allangee (author)2015-07-13

Couldn't someone just smack the outer box off the wall and jump the exposed wires? A wireless connection from inside to outside would make it more secure, albeit more expensive as well.

author
albedozero (author)allangee2015-07-14

Shorting the wires won't work - the inside box expects a specific code phrase over a serial connection on one of the wires - not trivial to replicate. However, there are security concerns with this or your wireless method re AJMansfield's comment below. Wireless is cool though, and less destructive.

author
TakW (author)2015-07-12

Glad to know I'm a mildly clever vandal. That was my first thought. :)

author
jmacdonald13 (author)2015-07-12

This is great and so nice of you to credit the original. :-)

author
jeangio77 (author)2015-07-12

congratulations! excellent project

author
DIYdd (author)2015-07-11

nice

author
ProtectLift (author)2015-07-10

This is a great project! I love the references and the credit you give from everyone you've been inspired by (or borrowed from). That's what this site is all about! Can't wait to try it for myself. I especially like that you were able to take the ATMega chip off of the Arduino board and run it on your own. Nice job.

author
knexfun101 (author)2015-07-10

nice job! that's a good idea.

author
amy_rotfl (author)2015-07-09

Wow. Hope to make this one day

author
tomatoskins (author)2015-07-09

Really cool project! Much better than those boring 10 key ones from the store!

About This Instructable

42,674views

1,068favorites

License:

Bio: Physics professor, keyboard player, pizza chef, coffee enthusiast
More by albedozero:Raspberry Pi Stompbox Synth ModuleAVR/Arduino Flashing With Raspberry Pi5V/3.3V Breadboard Power Supply
Add instructable to: