This week's assignment is to communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
I searched for examples of a smart house on google and inspired me to make a circuit that controls the switches of the light using a mobile.
For software:
Fritzing to create the circuit and simulate it.
Arduino ide to create and upload the code to the circuit.
Arduino blue-control App on the mobile phone to control the switch.
For hardware:
Arduino Uno as a brain.
LCD 16*2
mini breadboard.
Bluetooth module hc05.
rely module
jumpers for wire connecting.
mini bulb light.
Power Adaptor 9 v
first, connect the ground and 5v from Arduino to the breadboard.
connect the LCD ground and VCC to the ground and 5v of the board, and SCL and SDA from LCD to pins 5A, and 4A on Arduino.
connect the Bluetooth module ground and VCC pins to the ground and 5v of the board, and the important part connect the TX of Bluetooth to the RX pin of Arduino and the RX of Bluetooth to the TX of the Arduino.
finally connect the lamb's first pin to the vin of Arduino and the other to ON of the relay, and connect the relay, the ground, and cm to the ground of the board ,vin to 5v of the board, and at last in pin to pin 4 of the Arduino.
First I included the liquid crystal library to control the LCD, then defined the lamp pin to control the relay state, and defined a character variable to put the incoming data in it, and then give a pin mode to each of the pins (output or input)
In the void loop, I identify the incoming data to read the serial every time I send something to it.
And make an if condition, if I send number 1 the LCD shows the light-on message, delays 2 seconds, and turns the lamp on.
and if I send number 2 the LCD shows light off message, delays 2 seconds, and turns the lamp off
connect the circuit as it was drawn at fritzing.
I connect the yellow wire from the TX of Bluetooth to the RX of Arduino, and the orange wire from the RX of Bluetooth to the TX of Arduino.
connect the LCD to 4A and 5A of the Arduino and ground and VCC to the board.
connect the Arduino and relay to the Arduino and board.
finish the connection of the circuit and upload the code to Arduino but first unplug the TX and Rx pins of Bluetooth from Arduino and plug them again after loading the code.
Connect the Bluetooth to your mobile, then open the Arduino blue control app and connect it to Bluetooth.
Now let's control the light.
Title of Media
when I uploaded the code to Arduino and tried to start the circuit but it didn't work. so I rechecked the circuit and found that I forgot to connect the input of the relay to pin 4 of Arduino 😅 and it was the soul of the circuit.
I connected it and it worked .
I learned to design the circuit with the new software "fritzing" ,so i watched videos on how to use it on YouTube.