Keypad and Fingerprint-Scanning Safe

I am making a safe that is controlled by electrical components. Only the owner can open it by entering the correct password into the keypad and placing the right finger onto the fingerprint scanner.

Engineer

Caitlin W.

Area of Interest

Bioengineering, Biotechnology

School

Monta Vista High School

Grade

Incoming Sophomore

Final Milestone

My final milestone was attaching all the components inside the box. First, I designed the holes I was going to cut inside the box, using a 3D-designing software. According to these designs, I drew out the rectangular holes onto the box. I used a 3/32″ drill bit to drill out small hole, then used a 1/4″ drill bit to drill over the smaller holes. I drilled larger holes, so there was enough room for the blade of the handsaw to fit inside. After cutting out the holes with the handsaw, I spent a lot of time filing and sanding the edges, because they were a little small. After testing the circuit, I realized I need to attach the switch between the battery pack and the breadboard, so I severed the USB cord to expose the power and ground wires, which were pink and gray, respectively. After soldering these wires to solid-core wires, I used heat shrink tubing to re-insulate the exposed wires. I found out that the specific battery pack I was using has to be activated by pressing a button every time before use. Due to this, I drilled to more holes on the side of the box, one to expose the side of the battery pack, where the button was. Finally, I glued most of the components into the box with hot glue. I glued the servo and the L-brackets in with epoxy glue, because they needed to be fastened more securely.

Second Milestone

My second milestone involves attaching the fingerprint scanner to the other components, and the completion of the code. The fingerprint scanner has four wires that are badly color-coded. There are three white wires, connecting to power, ground, and serial communication. The last wire, the black wire, also connects to a communication pin. Because the fingerprint scanner operates at a different voltage level than the other component, I had to build a voltage divider using a 1k ohm resistor and a 560 ohm resistor. For the code, I used some sample code provided with the library to enroll my fingerprints. However, even after multiple enrolling and re-enrolling, only seven of my fingers worked. I edited my previous code so that once the correct password was typed in, a line would be printed that asked the user to scan a fingerprint on the scanner. Now, if both the correct password is entered and a valid fingerprint is scanned, the servo turns 90°. When the user finishes using the safe, and wants to lock the safe, they press any key on the keypad to return the servo 90° to its original position. Lastly, I added a switch to the circuit, where I can open and close the circuit.

First Milestone

My first milestone involves attaching the Arduino to the servo and the matrix keypad. Inputting the correct four-character password into the keypad turns the servo. First, I attached the keypad directly to the Arduino without the use of a breadboard. The pins on the keypad are only attached to digital pins on the Arduino, because the keypad is only used for input, not output. There are eight pins on the keypad, but 12 keys. After doing some testing and research on the Arduino website, I found out that each key is controlled by two different pins, one for the column of where the key is located, and one for the row. Pins 2-5 determine the row, where pins 6-8 determine the column. The servo had three wires to connect, communication, ground, and power wires. I used a breadboard, because I knew I would need to connect more components to the power and ground pins later. I wrote some code that controlled the actions of the servo based on the keypad. In the setup() method, I set the servo’s communication pin as an output pin, because digital pins are set as input by default. I also printed a instruction statement in the setup() method to instruct the user to input their password. This statement is in the setup() method, so it only runs once. In the loop method(), the getKey() function returns the key that the user pressed. If a key is pressed, the key pressed is displayed in the serial. When four characters are typed and displayed, the code checks if the four characters entered is equivalent to the user’s password. If not, a statement is printed informing the user. If the password is correct, a congratulatory statement is printed instead, and a value is assigned to the servo variable, which is the angle at which the servo turns towards. After inputting the correct password, the servo turns 90° clockwise, then returns 90° counterclockwise. Finally, the String containing the guessed password is reset to an empty String.

Starter Project

My Starter Project is the Junior Theremin. This is an electrical instrument that changes the pitch of the note depending of the distance of the user’s hand from the antenna of the theremin. There two modes, discrete and continuous mode. In continuous mode, the theremin plays one long note which can change in pitch, but there are no articulations. In discrete mode, each note is individual, separated by an articulation.  See the video for a short demonstration of the above-mentioned modes being played on the theremin. There are also two pushbuttons that can be used in discrete mode. When one of these ‘+’ and ‘-‘ buttons are held down, the notes are played in either a higher or a lower octave, respectively. The theremin acts like half a capacitor, where it is only one plate instead of two, and the user’s hand acts as the other plate, “completing” the capacitor. The distance of the “plates” would determine the capacitive reactance. which in turn determines the frequency of the current. First, the current is sent through a voltage regulator, which transforms the voltage from 9 V to 5 V. A 555 timer is used to create time delays or oscillations. The resulting current is sent from the microcontroller to the piezo, which acts like a speaker with piezoelectric properties. The microcontroller also controls the LEDs, which turn on in a pattern based on the frequency of the current.

Leave a Comment

Start typing and press Enter to search