Contact me
I tried to make a simple copy of the a wirless door lock
and its bell
what inspired me is that I wanted to control a lock wirelessly for my project
then I added the buzzer for a door bell experience
for controlling the project using the phone
for circuit simulation
for the programming
buzzer
to make the bell sound
HC-05 bluetooth module
arduino uno
jumper wires
relay
relay is essential here to control the solenoid lock
because arduino output is 5v
and the solenoid needs 12 v
so it works as a medium between the arduino and the high voltage components
breadboard
solenoid lock
to control the lock and unlock
adaptor 12 v
connecting the ground and vcc from the arduino to the breadboard
then connecting the buzzer to the pin 11 and the ground
the relay takes input from the pin 2
and connected the HC-05
vcc ->vcc
gnd -> to the ground
rx -> tx
tx -> RX
I connected the circuit as the simulation
firstly put the buzzer on the arduino directly the ground on the pins side
and pin 11
then connected arduino's vcc and ground to the bread board
the relay has to sides
the arduino side
which is connected to the vcc , ground ,and the input signal at pin2
the other side is connected like a switch in series with the power circuit for the solenoid
ground to the common ground and the normally open pin to the vin in the arduino to take the 12 v provided by the adaptor
the HC-05 has 4 pins
vcc to the common vcc
gnd to the common ground
RX to TX on arduino pin 1
TX to RX on arduino pin 0
Coding
this is the whole code which I'll break into pieces
setting our first things
as I'll receive data from the serial
I'll store it in a variable so I can use it , I chose char as it will be a single character , I'll use numbers specifically .
I set my pin mode for the pins I'll use
I'll only use 2 pins for minimum
2 -> the lock
11 -> the buzzer
this code ensures that it the code can't progress till the user enters a value
here are the incoming data and the orders taken by them
if pressed 1
the buzzer will make a tone for 10 seconds
pressing 2 kills the tone
pressing 3 opens the lock
pressing 4 closes it again
a demo video of the wireless controlling with the 12 v adaptor
here I used the laptop as a power source which eventaully couldn't open the solenoid lock
but opened the relay
Title of Media
Title of Media
on tinkercad I couldn't find the HC-05 module which made me search for another simulation program which is fritzing
there I found the module and done the wiring before wiring in real
Title of Media
Title of Media
I learned a lot of things that can help me in my final project
1- the wireless control is a nice-to-have feature that I want to add to my project
2-I applied a new way of connection to power the solenoid using the same power source for the arduino.
Title of Media
Title of Media