This week assignement was to make projet who has 2 input and 2 output so , I searched something useful for my desk, and I found an automatique box to put my things and then lock them.
TinkerCad
Arduino IDE
Arduino Uno
Arduino Uno cable
servo motor
BreadBoard
Glue Gun
Jumpers
Cardboard
Cutter
9V DC adaptor
4X3 Keypad
LCD I2C
IR Sensor
LEDS
Resistor
I started to make circuit on Tinkercad, I'm using 2 components as input and 4 components as Output.
Input:
Keypad 4X4: to enter the password so that my box open.
IR sensor: to sense the presence of someone near the box.
Output:
LCD I2C screen : to display messages.
Servo motor: to open and close the box itself.
2LEDS (RED and Green) = to tell us is the password is wrong or not.
So before making my physical circuit, I used Tinkercad how the LCD screen work. So First I started to display a simple message "hello world" and after this I started to make my circuit .
Also, the keypad the keypad in Tinkercad is 4X4 and the one that we have in our kit is 4X3, so I had to search how to code this in arduino IDE.
First, I started to download the libraries of keypad and lcd then started the program with <Keypad.h> and <LiquidCrystal_I2C.h> without forgetting <Servo.h> because of servo motor that I going to use. after finishing this I started to define my components and pinmode . I use the wors "ROWS" and "COLS" to tell arduino that my keypad has 4 ligne and 3 colognes and their Pins. after this, I made a password "4321" and another variable called "inputCode" to stock the code that I will put on physically.
So, in the void setup (), define the nature of my pins if its Leds) or input (IR sensor), then I made the angle of my servo 0 degree , then initialised my lcd so that the first message should be "System Read" with a delay of 1.5 sec and then clear.
In the loop I used an if condition so that " If Ir sensor sense a precense , the lcd display a message telling welcome and enter the password, if the password is correct my servo motor does 60-degree angle and the green Led become High but to validate the password you must click # " . Else the servo stay 0 degree and the Red Led become with a message telling "Wrong Code".
This part is when the IR sensor doesn't sense any presence it , the LCD display a message telling me that there is nobody around. and if I touch "*" the lcd display a message "Retry again"
Circuit
Demo
I started to connect the 7 pins of my keypad to (Pin 2 to Pin 8) of the Arduino after this i wired my servo and ir sensor to pin 9 and 10 and the leds (green and red) and finally the lcd screen. Then I uploaded my code to Arduino.
After uploading my code and tested that everything is ok, I started the fabrication of the cardboard. As you can see in the video, I entered the password and my box open automatically and the green led turned high to prove that the password is correct. If the password is incorrect the red led turn high .
Title of Media
I was an amazing week , we entered deep in electronics. The EOW session we made a
Title of Media