Remote Control Doorknob
This device will be designed to control who is authorized to turn the doorknob without opening it by hand. The goal is to construct a device that can act as a door that locks and unlocks by pressing various keys on a remote. There will be options that will allow the motor to rotate depending on the buttons used on the IR Remote. The project can go through 4 test scenarios: unlocking the door, locking the door, resetting the password, and using the incorrect inputs which leaves the door locked. These scenarios are determined from which hex keys are pressed on the IR remote and transmitted to the IR receiver.
Supplies
10k potentiometer: Controls the brightness of the LCD Screen.
LEDs (Green, Red): Indicator lights that the system is unlocked (Green) or locked (Red).
IR remote: Remote communicator to IR receiver that activates and resets password on the LCD Screen
IR receiver: Receives message after pressing the keys or buttons on the IR remote.
Arduino UNO: Microcontroller board that maintains control of the project through the input/output pins.
Buzzer: Alarm that indicates that the password is reset.
Breadboard: For connecting the wiring circuit together.
LCD Display module: Displays message on whether the door is open or locked based on the password given through the IR remote.
Servo motor: The doorknob that rotates indicating the door is open or locked.
Resistors used: (2) 100k ohm connected to the Red and Green LEDs, (1) 100k ohm connected to LCD module
Testing Example Codes and Component Functionality
When starting this project, I used example codes from the Arduino library to test if each component is stable and functional (ex: Blink program). These tests were conducted on the buzzer, LCD screen, servo motor, IR remote and IR receiver. I would test the LCD module with the setCursor Arduino code. I tested the servo motor with the Knob Arduino code. Then, I tested the LEDs and the buzzer with the blink program.
Examining Hexadecimal Keys on IR Remote
The IR Remote will act as the remote communicator to the IR receiver. Before setting up the wiring circuit, use an example code for the IR remote and find out what each hex key represents on my IR remote. I tested the hex keys with the following code below. Later on, I specified which message should be displayed on the LCD module in parenthesis.
Downloads
Setting Up the Wiring Circuit
After I tested the functionality of each component, I set up this wiring circuit based on the schematic design I made using Fritzing. Every pin for each component was connected on the breadboard and Arduino UNO board. The servo motor pins that I used was pin 9, the 5V and GND pin. The LCD pins used on the Arduino UNO was pins 2,3,4,5, 11, and 12. The buzzer pin used was pin 13 and the GND pin. The RED LED used pin 6 and the Green LED used pin 8. Each LED is connected to a 100k ohm resistor in case the LED burns out.
Adjusting the Wiring Circuit to Fit the Box
After I tested the functionality of each component, I realized that I need to attach this circuit to the box in order to continue the project. Keeping the components in order was a priority, so I would put tape around the LCD module, servo motor, IR receiver, and the loose LEDs that I am using. This wiring circuit was what I implemented before putting it in the box.
Combining the Wiring Circuit With the Box
Using a cardboard box didn’t work as well as I had intended because I didn’t take into account the size and proportions when I used a smaller box. I didn’t want to use a larger cardboard box because I would have to find a way to attach the USB cable to my laptop. The best course of action for me to continue the project was to use a shoebox which had the right amount of space to attach the wiring circuit and kept most of my components from falling out so many times.
The circuit will be attached to the side of the box and the USB cable will be on the lower end of the box in order to not have issues when connecting the Arduino circuit to my laptop. Some sources of error when doing this was that the Red LED was loose when I attached jumper wires to the cathode and anode pin. This caused the LED to fall out often. This occurred with every Red LED I had which gave me the idea to use some tape to hold it together with the wires I attached it to. Another source of error was the LCD module having issues with displaying words on the screen because the wires moved a bit causing the LCD screen to display random messages or no messages at all. Testing out the remote keys on the IR sensor, testing the brightness with the potentiometer, and checking to see which wires are loose on the LCD display are the best options to make sure the circuit is still running as intended. As soon as everything else is attached to the shoebox, it is important to test out the functionality of each component before finalizing this project.
Project Code
When I tested out each code that was mentioned before, I wanted to combine the code for the IR remote with the blink program and knob program. I decided to add a case statement for each hexadecimal key for the IR remote I was using. This was for the purpose of differentiating each scenario that was done for each hex key. I can change the hexadecimal keys and modify which remote keys are used to control the servo, LCD module, or the LEDs. This is the code that I worked on during my final exams.
Downloads
Scenario 1
After running the Arduino code, I used the hex keys (FFA25D, FF30CF, FF18E7, FF7A85, FF10EF) from step 2 to demonstrate how the door is unlocked (scenario 1).
The outcomes of this scenario:
- LCD module displays the message: "PIN Required"
- Red LED turns on.
- LCD module displays the message: "Requires 3 pins"
- LCD module displays the message: "Requires 2 pins"
- LCD module displays the message: "Require 1 pin"
- Servo motor rotates: 0° CCW
- Red LED turns off and Green LED turns on.
- Doorknob turns to the right
- LCD module displays the message: "Password Granted"
Scenario 2
In scenario 2, I used the hex key (FFE21D) from step 2 to demonstrate that the door is locked.
The outcomes of this scenario:
- Servo motor rotates: 180° CCW
- Red LED turns on.
- Doorknob turns to the left
- LCD module displays the message: "Locked"
Scenario 3
In scenario 3, I used the hex keys (FF6897, FF9867, FFB04F) from step 2 to demonstrate that the password is reset.
The outcomes of this scenario:
- LCD module displays the message: "Reset password?"
- Red LED turns on.
- LCD module displays the message: "Are you sure?"
- Buzzer proceeds to make a sound
- Servo motor rotates: 90° CCW
- Doorknob turns upward
- LCD module displays the message: "Password Reset"
Scenario 4
In scenario 4, I used the remaining hex keys on the IR remote from step 2 to demonstrate that the incorrect pin or password was used. (Ex: FF38C7 or FF5AA5)
The outcomes of the last scenario:
- Servo motor doesn’t rotate.
- Red LED turns on.
- Doorknob will not move after the initial command made using the IR Remote.