Week #7- Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

Since security is a necessity, it shouldn't be hard to have. Security isn't just your own safety, it's also the security of your precious belongings. That's why we should always keep our precious items in safe places. Our project this week is to make a locker with password verification. The locker can be opened in 2 ways: a 4-digit password or through Bluetouth.

Tool Chain

Which software/machines/materials did you use in the assignment? Why?

A battery as a source of electricity

Tinkercad to imagine my electric circuit before appling it.

A servo motor for opening and closing the door

Cardboard for prototyping

Keypad to get input (password) from the user

An USB cable for uploading the code on the Arduino

Arduino UNO as the brain and controller

Arduino IDE for uploading the code to the Arduino

A buzzer to make a sond when an incorrect password is given.

Bluetooth Transceiver to transfer and revieve Blutooth signals from the user's phone.

MIT app inventor to make a simple app to open the door lock or close it through bluetooth

Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

I found an amazing tutorial that helped me alot!!!

First, I got my components. Please note that I used a 3x4 keypad not a 4x4 as the video recommended and I didn't use any push buttons or resistors or LCD.


I had 2 inputs: the keypad and the Bluetooth trancsiever.

And 2 outputs: the buzzer and the servo motor

Second, I drew my circuit on Tinkerkad to make sure everything is okay.

Note: I didn't find a Bluetooth transceiver in Tinkercad, but I did use it in the project.

Here's the exact connections

The Bluetooth transceiver has normally 6 pins, but we only connect the 4 middle ones.

The first pin from the left (RXD) ---> TXD (d1) in the arduino

The second pin from the left (TXD) ---> RXD (d0) in the arduino

The third pin from the left ---> GND (ground)

The fourth pin from the left ---> to a 5V source

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

Don't forget

You need to download and access 2 important files, the keypad library (Keypad.h) and the servo motor library (Servo.h)

#include <Keypad.h>

#include <Servo.h>


The code was kind of easy, I started with some declarations for the keypad, some libraries, and 4 variables for storing the password characters.

My "void setup" was pretty simple, it included the pinMode of the buzzer, the servo motor attach pin, the angle wich the motor should begin at, and the Serial monitor begin command(Serial monitor isn't obligatory to use in the code).

The "void loop" was a little bit complicated. First, by using the "counter" variable I numbered the characters entered of the keypad and separated them into 5 variables that we declared in the beginning:

"digit1", "digit2", "digit3", "digit4" and "enter"

This is the part where we check what the Arduino is receiving from the Serial Monitor or the Bluetooth transceiver.

**Note that both the Blurtooth transceiver and the Serial Monitor have the same input way.

When counter = 6, that means that the user has inputted 5 characters, now its time to check the correctness of the password, and either ways the password is right or wrong we have to reset all of our variables (digit1, digit2, digit3, digit4, enter, counter) so that the user can input new values.


Now,

MIT app inventor

I made a little app so I could use it when my phone is connected to Bluetooth. It's very easy all you have to do is:

1- Go to MIT App Inventor

2- Sign up, it's free.

3- Click on create apps, and create yours.

**For more details about MIT app inventor watch this tutorial:

(1) HC-05 Bluetooth Module with Arduino-MIT App Inventor - YouTube

Overcoming Challenges

What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)

I had to change some of the code and the connections to suit the 3x4 keypad.

The keypad has many characters that should be declared in the part before the "void setup". We need to specify its characters, number of rows and number of columns so that the Arduino can easily get information from it.

A very common mistake

You should always remember to disconnect the 2 pins (trigger and echo) before uploading, because Arduino uses these pins to transfer the code while compiling. When the compiling and uploading is finished reconnect them to their normal pins.

Another problem was getting the exact angle of the servo motor that opens the cardboard door, I made it as 180 degrees.


WhatsApp Video 2022-09-24 at 00.05.30.mp4

This was my first trial

The cardboard prototype is very simple, I used a shoe box and cut a 3-edged square (not a whole square) as the door then glued my components to it.

**Note that a 3-second sound from the buzzer means that the password is right and 1-second means the password is wrong

WhatsApp Video 2022-09-24 at 00.17.39.mp4

My second trial

Now that I have added my servo motor it looks more as a locker!

WhatsApp Video 2022-09-24 at 00.31.41.mp4

This is how it looked in the end :)

The locker can be opened manually (with the password) or by Bluetooth.

Final Project

How can you use the skills and knowledge that you've acquired this week in your final project?

Using many input and output sources (as the keypad and the LCD) was kind of hard trying to put all the code together and I had to face dozens of bugs.

I learned a lot about debugging and how to find where the problem is.

I'm sure that this skill will be useful in overcoming any bugs I face in the final project.

WOW!

What is the coolest thing that you've learned this week? What is something that you will never forget from this week?

Assignment Design Files