Arduino RFID Door Lock by pcmofo
Contest WinnerFeatured

Step 2: Build the Arduino controller

IMG_0231.JPG
IMG_0229.JPG
IMG_0230.JPG
Controller.png
Controller_board.png
The first step to building a RFID door lock with a basic Arduino is to bread board out a basic working arduino. Most Arduino pre-flashed ATMega 168 chips come with the default blink program pre installed. Connect a LED to digital output 13 and verify that everything is working.

The hardware portion of this RFID reader would be too simple if we used a regular arduino with built in USB programmer. Since I plan on putting this into the wall and not touching it again I dont want to use a big bulky $30 arduino board when I can buy a $5 ATMega 168 and make a much smaller custom PCB.

Because I chose to make a basic Arduino circuit myself I need an external USB->Serial FDIT programmer. I have included Eagle schematics of the controller with a power supply built from a 7805 voltage regulator. In testing I used a bread board power supply.

To get an arduino up and running all you really need is the ATMega168 with the arduino software flashed on it, 2x 22pF capacitors, 16mhz crystal, 10k ohm resistor, push button and a breadboard. The hookup for this is well known but I have included the entire schematic for the circuit.

The arduino is going to trigger 4 outputs, 1 each for Red/Green/Blue LEDs, and 1 to trigger the TIP31A to send 12vDC to the door lock. The arduino receives serial data in on its Rx line from the ID-20 RFID reader.

Controller_PCB.pdf(612x792) 12 KB
 
Remove these adsRemove these ads by Signing Up
insignia96 says: May 8, 2011. 9:36 PM
What's Hilarious is that I, at this point in time, have an arduino, i am custom etching a shield, I have an outlet box, 2 RGB status leds, and to shorten this list up almost an identical project/Instructable I am working on and This is the first time I have read through this. Pretty funny, I guess great minds think alike!
boudreau-inventor2 says: Apr 30, 2011. 7:41 AM
I have couple questions. Where did you find the breadboard power supply for 12 volts? And, what size is the breadboard you are using?
PrivatHost says: Apr 7, 2011. 10:36 AM
What diode (D1) did you used?

Is it the 1N4007 ?
usamasiraj says: Apr 29, 2010. 11:06 PM
Hi i am a bit confused about the connections of header, header1 and the tip31a transistor. Do we have to connect Header from the rfid reader schematic to the controlling schematic. And what about the header1.??? Please help me out
kipfan23 says: Apr 5, 2011. 8:48 PM
Both of the headers do have to be connected. header1 is used to connect the ATMega to the reader while Header is used for the RGB LED.
usamasiraj says: Apr 29, 2010. 11:55 PM
I am also confused about the schematic, since the pins in the pictures and the pdf seems to be different..Please explain which one is right??..Thank u
kipfan23 says: Apr 5, 2011. 8:44 PM
The pdf is a PCB layout, the image is a schematic. the pins on the ATMega in the schematic might not be in the same place as the pins in real life. It looks like the pins on the left are used for basic arduino functioning while the pins on the right are used for signal. you can look up the datasheet for the ATMega online to find the excact placement of all of the pins.
Hope this helped!
chrisgward says: Jun 26, 2010. 7:45 PM
What's the value of C7?
kipfan23 says: Apr 5, 2011. 8:40 PM
0.1uF
randomkid88 says: Nov 14, 2010. 2:17 PM
Where did you get/make the programming interface? I can't find one to save my life.
pcmofo (author) says: Nov 15, 2010. 10:44 AM
Everything you need is at Sparkfun.com If you are not familiar with a programmer and arduino being separated then you should start with a Arduino Uno which is USB plug and play.
bl3nd3r says: Nov 19, 2009. 11:58 AM
Great tutorial and implementation!

If you have an arduino already, would it be possible to program the chip (ATMega168) and then put it onto the custom board? Would this save you from needing an external USB->Serial FDIT programmer?

Thanks.
pcmofo (author) says: Nov 19, 2009. 12:23 PM
Yes you could do this. You still need all the parts listed in the pictures but the programing could be done with a working arduino of the same type with a removable chip.
ledfreak01 says: Sep 17, 2010. 2:16 PM
hi pcmofo i my com. wont open up the circuit picturesw do you mind sending them to me :) @ nicholas.labrecque01@gmail.com thanx
chriscross93 says: Aug 24, 2010. 5:16 PM
This project looks awesome, great job! I've been putting together a shopping list, but I cannot find some of the resistor values. I'm probably overlooking something but nevertheless could someone point me in the right direction? Thanks!
chrisgward says: Nov 21, 2009. 11:05 PM
Hi. I am currently working on a PCB design for the arduino board, based on the schematic. When I finish them, would you like me to put them up here for you?

Thanks
chrisgward says: Nov 21, 2009. 11:12 PM
If you would rather, I could make my own "Instructable" and you could link it over.
pcmofo (author) says: Nov 22, 2009. 9:14 AM
Thats great! Either one would work. I have done the reader on a single sided PCB. When I made the PCB designs I was still using a Arduino Pro Mini for development. I added a few things since then but here is a picture of the reader and controller. http://grab.by/JsH

I added a jumper to the serial line so if you reprogrammed then you could "disconnect" the serial line. The Pro Mini has programming pins on the top so there are none on the PCB. Using a normal Arduino you would need the standard FDTI header to program.

I tried to make all the traces as large as possible and single sided PCB to make it easy for others to build It seems that double sided PCB is unavoidable building it from scratch.

I also setup the headers so that I could use Sparkfun 6 pin polarized pin headers to connect the two boards, or solder the reader side permanently and have a plug on just the controller side for installation purposes allowing you to seal up the reader to make it more tamper proof.

Let me know how your progress goes, I would love to get a PCB version made asap!
chrisgward says: Nov 24, 2009. 12:32 AM
I have almost finished the "arduino board", but yet to purchase one, it may take some time to get the measurements right. And there are some things I don't understand about the schematic (don't worry, its not your fault, i'm only 12), like VCC, the "U$2" and there being 2 headers (i have alot to learn ;))
chrisgward says: Mar 28, 2010. 12:07 AM
Sorry I haven't replied in a while, I just have been really busy. Anyways, I am going to change the design a bit, so that you can use an ICSP to program. And I lost all of the other files reinstalling my computer :(, oh well, just started again today,
chrisgward says: Mar 28, 2010. 3:38 AM
I just finished building a design for both of the boards, they havent been tested, but here are the images (some of the header pinouts have changed though)
http://grab.by/3mL8
http://grab.by/3mLc
pcmofo (author) says: Apr 2, 2010. 7:44 AM
 I took a look at your pictures. You really were able to pack those components in there. I made a prototype PCB design for single sided board so I could etch it my self and test the basic design on a schematic and work out any bugs with what connector to use or what size to make the finished board. 

The reader is easy to make single sided. The controller is more difficult. I was able to do it with a few jumpers crossing the board. I am going to get some of the overhead transparencies and try to etch my own board. I have all the stuff for a single sided board. 

I hope to etch it soon and will let you know how it goes. Your design looks super compact though. Ideally I would like to pick an enclosure for each of them that are readily available from an online electronics store then design a PCB to fit with the mounting holes etc included. Then send that out to a fab company and get a few made.
chrisgward says: Apr 2, 2010. 4:21 PM
would you like me to upload the eagle files and/or the gerber files?
pcmofo (author) says: Apr 5, 2010. 6:57 AM
 Yes! That would be awesome!
chrisgward says: Apr 4, 2010. 3:57 PM
I was just wondering, the RGB LED on the reader board appears to be recieving 5v based on the schematic. Does the ATMega drop the voltage down to 3.3v, or should I put in some more vregs?
pcmofo (author) says: Apr 5, 2010. 6:58 AM
 If you look at the reader, the resistors are there. Depending on the LED's you use etc it seemed the best idea to get 5v to the reader and then drop it down to led level. 
chrisgward says: Apr 16, 2010. 9:56 AM
I have made another design, where all of the components except for the rgb and reader have been moved over to the main board, and added some vregs to the main board.
pcmofo (author) says: Apr 16, 2010. 11:18 AM
 Awesome. I would live to see this.
chrisgward says: Apr 16, 2010. 10:09 AM
Assuming these designs pass, the two boards together should cost around $15 for both $10 for the arduino board $5 for the RFID reader board. Not inc. components.
pcmofo (author) says: Apr 16, 2010. 11:19 AM
 That sounds like the makings of a great kit!
chrisgward says: Apr 16, 2010. 7:56 PM
Yeah! You should make a kit!
chrisgward says: Apr 16, 2010. 9:09 PM
(removed by author or community request)
chrisgward says: Apr 19, 2010. 2:38 AM
forgot to put some components in, the new price is US$99.23 + postage
pcmofo (author) says: Apr 19, 2010. 7:00 AM
How are you getting the boards made? I have all the components.. I just need the boards...
chrisgward says: Apr 19, 2010. 7:17 AM
I was going to get them made at batchpcb just for the prototyping then when/if i were going to sell them, i would find a fab house in aussie to get them made (a lot closer to home).
pcmofo (author) says: Apr 19, 2010. 12:37 PM
 Cool. I will love to get some made... only concern that I have is that the boards need to fit a specific size box so that like the reader can be mounted outside etc. Can you send me the board files so I can see how it lines up with my existing box?
chrisgward says: Apr 19, 2010. 9:29 PM
the boards are really small, the arduino board being  2.12"x1.79" or 53.8mmx45.4mm, it should be able to fit the smallest of boxes, the rfid board is even smaller. Here is a link to the board files (eagle only) http://arduinorfid.comlu.com/main/eagle.html.
chrisgward says: Apr 16, 2010. 10:07 PM
(removed by author or community request)
chrisgward says: Apr 17, 2010. 12:49 AM
(removed by author or community request)
chrisgward says: Apr 18, 2010. 10:41 AM
(removed by author or community request)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!