Arduino Door Lock Code

This will be a quick post since I’m tired…I finished the code for the Arduino door lock.

(Watch the second video in HD to see the LCD display)

General Logic of Code:

The user (aka Noelle or I) enters the passcode via the LCD shield. If the passcode matches the numbers in the code, the Arduino will turn the servo. The servo will be attached to our door lock, so the rotating servo will turn the lock. If the incorrect code is entered, a “Try Again” message will appear. I tried to make the code modular by breaking it up into functions. The two main functions consist of entering the number and turning the servo.

Complications & Other Notes: 

(1) I haven’t had the time to solder the wires to a circuit board, so the connection between the servo and the Arduino is terrible. As a result, I have to fiddle with the servo wire (in the uploaded video) before the servo receives the signal to turn.

(2) The uploaded video of the working arduino/servo was recorded early this afternoon. After recording the video, I continued to fiddle with the circuit. It was during this period of time that I accidentally shorted the servo. (Accidentally attached servo power to ground and ground to power–oops! But the two pins were so close to each other…) So now the servo is fried. Frown. Anyway, I put in an order to Amazon this afternoon, but that means I can’t tinker with circuit to try to get a better connection until I get the replacement servo. Lesson learned though: check power/ground connections before turning on power source!!!

(3) I opened up the servo to see the gears on the inside since it’s pretty much useless now. Pictures below!

(4) Code can be found here

Servo PCB
Servo gears


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s