My task this week is to Design and program a smart device to communicate wirelessly that performs a certain function or solve a problem using Arduino UNO and coding on IDE Arduino software to read signals with a wireless communication device to control multiple action components using Arduino C (Text Code)
in this project I will use an advance simulation software called Fritzing
I will design a Smart door locker using Arduino UNO open the locker the door locker with my mobile and display message on LCD screen, I got the inspiration from this instructable project
To know how I did it, follow me to the next few steps.
This project will require the following components
Testing and coding components separately
In this stage we going to test each sensor and action and install libraries if needed
The first one is the Bluetooth module, which will be used to communicate wirelessly with mobile, it has 6 pins and we will use 4 pins only
RX, for receiving data and will be connected with Arduino TX pin
TX, for sending data and will be connected with Arduino RX pin
GND, will be connected with ( - )
VCC, will be connected with ( + )
The second one is the LCD I2C screen 16 x 2, which will be used to display messages on the screen to lock and unlock the door, it has 4 pins
SDA, Serial Data Line, and it will be connected to A4
SCL, Serial Clock Line, and it will be connected to A5
GND, will be connected with ( - )
VCC, will be connected with ( + )
The Third one is the SG90 Servo motor, Which will be used as a locker when it receives a signal from the mobile to lock or unlock, it has 3 pins
Signal, for the signal and its analog signal, and it will be connected to pin 10
GND, will be connected with ( - )
VCC, will be connected with ( + )
The LCD I2C Screen
Now let's test the screen
👈🏽as you can see in the simple code for testing.
it displays the message on screen as you can see in the picture 👉🏽
The Servo motor
now let's test the Servo motor
as you can see in the simple code for testing👉🏽.
It's a loop for setting the servo motor to 180 degrees and waiting for 1 second then returning as you can see in the picture 👈🏽
For the Bluetooth module, we only need to connect it according to the datasheet and use the Serial.read command
then install the mobile App from the Google Play Store "Arduino Bluetooth Control " to send commands to the board
Wiring and Merging the Code
In this stage we going to wiring the circuit, then merge the code and modify it to complete my project
Now, we going to add the condition for the first action to lock the door locker when I press on action button on the mobile and display message on the screen says " door is locked "
Then add the condition for the second action to open the door locker when I press on action button on the mobile and display message on the screen says " door is open "
Now let's try the Arduino Bluetooth Control mobile app that we downloaded before.
open the app and press connect
as you can see the device is not connected, so choose the Bluetooth module name
you should see it connected as a picture
choose buttons & slide
press setting to configure buttons
choose command button configurations
edit the two buttons A & B
set the A button to send 1 to Arduino and the B button to send 2 to Arduino
Now let's test the device 🫣
connect the mobile with Bluetooth, and try to lock and unlock
🎉works and functions perfectly 🎉
Lastly, you can download the code from here 👇🏽