For this week's assignment, you need to create a system for a security booth. When someone is seen trespassing on camera, you should be able to press a button. When the button is pressed, a "no entry" sign should appear on the screen, and an alarm sound should go off.
Arduino IDE to upload the code to the Arduino Uno
Autodesk Tinkercad Circuits to Simulate the electric circuits and Code Block
Electric Components:
breadboard, jumpers to connect the component
Buzzer & LCD2IC & Bluetooth module HC05
Arduino Uno to read the input signals from the Bluetooth module & accordingly, control the the message on LCD i2C and buzzer sound
Inputs
Bluetooth module HC05 : Bluetooth commands '1' and '2' sent to the Arduino over the Bluetooth connection. These commands are used to simulate someone entering (command '1') or leaving (command '2').
Action
is the behavior of the buzzer and the messages displayed on the I2C LCD:
When the Arduino receives the '1' command, it plays a tone at 1000Hz on the buzzer and displays "SOMEONE ENTERED" on the LCD for 2 seconds.
When the Arduino receives the '2' command, it plays a tone at 2000Hz on the buzzer and displays "SOMEONE LEFT" on the LCD for 2 seconds.
Brain
An Arduino UNO board will be used take inputs and generate actions
Then started following the diagram on my own circuit
Schematic View
Component List
Code Screens
Set the LCD address to 0x27 for a 16 chars and 2 line display
Connect the buzzer to pin 9
Set the buzzer pin as output
Initialize the LCD
Turn on the backlight
Initialize Bluetooth serial communication
if Bluetooth receives a signal above 0 command 1 the buzzer will play Play a tone at 1000Hz and LCD 2IC will display SOMEONE ENTERED
if Bluetooth receives a signal above 0 command 2 the buzzer will play Play a tone at 2000Hz and LCD 2IC will display SOMEONE left
hen uploaded the code to the Arduino IDE.
Uploading text code on Arduino
The Arduino board was connected to the laptop and the right port was chosen "Tools ==> Port ==> COM5 Arduino UNO"
Then, It was uploaded successfully
Building the physical circuit
The breadboard, Jumpers, Bluetooth module , LCD2IC, buzzer & ِArduino UNO were taken from the electronic kit
The circuit was built physically (exactly as it was designed on Tinkercad) using the hardware components and wires
breadboard was connected to the 5V for Arduino
Buzzer was connected to pin 9
LCDI2C that where SDA to PIN A4 AND SCL TO PIN A5
Bluetooth module tx to rx and rx to tx
I first wanted to use Servo motor instead of buzzer , and i connected it to an external 9V adapter to power the Arduino board, servo motor, and HC-05 Bluetooth module suing voltage regulator to drop the voltage down to 5V, which you will use to power the servos and Bluetooth that didn't work no matter how much troubleshooting i did , it turns out the servo was damaged. so i switched it to buzzer .