Smart Home
Design and program a smart device that perform a certain function or solve a problem: program Arduino UNO to read signals from multiple input components (Sensor, Switch, or variable resistor) to control multiple action components (Motor, Buzzer, LED...etc) using Arduino C (Text Code).
A smart home controlled via Bluetooth to play music and change the color of RGB LED to lightening the home
Hardware components
Electronic parts
RGB LED
9V adaptor
Jumper wires
Breadboard
Resistor
Bluetooth module
Screw terminal block
Arduino UNO
Buzzer
Software
a free, easy-to-use app for 3D design, electronics, and coding.
The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board
action components:
Displaying sound through buzzer and changing color of RGB led through Bluetooth module
Simulating the circuit on Tinkercad:
Wiring the electronic components:
Firstly I connected the circuit like the following diagram then used pins 0&1 which are TX & RX to connect them with the bluetooth module:
RX UNO (Pin 1) with TX Bluetooth
RX Bluetooth with TX UNO (Pin 0)
ground Bluetooth with ground arduino
power bluetooth with 5V
Then uploaded the code to the board .. After that I open the app on my phone choosed to connect with Bluetooth device and choose my module then went to buttons to send the numbers in the code
Number 1 -- LED Color is Blue - Motor Speed 100
Number 2 -- LED Color is Green - Motor Speed 170
Number 3 -- LED Color is Red - Motor Speed 255
The code starts with setup my outputs pins and the speed of serial communication to be 9600 then as a loop give the user 3 options If you pressed number from 1 to 3 in the app and then it will send the number to the Bluetooth module "the serial" & the output will be one of the following:
LED Color is Blue - Motor Speed 100
LED Color is Green - Motor Speed 170
LED Color is Red - Motor Speed 255
And all of that happens each 2 seconds.
by clicking the icon of debug button and it will start debugging the the code.
if there is any debug there a massage will appear at the bottom of the screen
and also the right button for check if there is any debug
action components:
buzzer - RGB LED
after connecting and coding the circuit the circuit didn’t work.
solution:
by the help of one of my colleagues we reconnect the circuit -as explained at design part-, then :
debugging the code it was correct.
troubleshooting the circuit by checking the connection of each component, and I found that I reversed the connection off RX and TX
I didn’t connect the connect the ground of bluetooth correctly.
the wrong circuit I reversed the RX and TX
Solution:
for the fist point:
RX of Bluetooth connected with TX (pin 1)of the Arduino
TX of Bluetooth connected with RX (pin 0)of the Arduino
for the second point:
connections of bluetooth as following:
RX->pin 1
Tx-> pin 0
Ground-> ground
power-> 5v pin
It will help to build the electric circuit of the final project understand the integration between all the components.
Being able to build this machine😁