RGB lamps
This week's assignment idea was to build a simple smart circuit that contains at least two action components that you can control wirelessly and use either the android GUI or PC GUI to control the action components.
I love lights and lamps very much so i think that it will be cool to control a lamp lights wirelessly.
I used Tinkercad to design the circuit , the resistor calculator to calculate the ohm of resistor , Arduino IDE to write and download the code on the Arduino UNO and
Materials : I used a 9 volt adapter , Arduino UNO , Bluetooth module (HC-05) , RGB led , 3 resistors 220 0hm , 1 resistor 560 ohm , 1 resistor 1000 ohm, buzzer, large Breadboard , Jumper wires.
Arduino IDE
Arduino Bluetooth Control
Tinker cad
Resistor calculator
Tinkercad circuit
My circuit in Real
I start to design the circuit using Tinker cad .
1- I connect the 5v pin of Arduino to positive of the breadboard and the GND pin to the negative of the bread board.
2- I connect the buzzer directly to the Arduino the negative terminal to GND and positive terminal to pin 11.
3- I connect the RGB led negative terminal to GND , Red terminal with 220 ohm resistor to pin 2 , Green terminal with 220 ohm resistor to pin 3 , Blue terminal with 220 ohm resistor to pin 4 .
4- I connect the TX of the HC-05 to the RX of the Arduino.
6- I connect the TX of the Arduino with 560 and 1000 ohm resistor to the GND then i take a wire after the 560 ohm resistor and connect it with the Rx of the Hc-05.
First : I define my pins to make it easier when i call them and incomingdata that will come from the Arduino Bluetooth control.
Second : Then in Void setup i define the pins output.
In Void Loop : I used while condition means that while there is no incoming data there is nothing will happen.
Then I use if and else if and else conditions :
if serial read is 1 the RGB led will be blue and if serial read 2 the the RGB led will be purple and if serial read 2 the the RGB led will be purple and if serial read 3 the the RGB led will be cyan and if serial read 4 the light will turned off .
In void loop (Finally) : If serial read anything else the buzzer will turned on.
I connected everything like i made in Tinkercad
Micheal Henry and Yasser Hassan helped me to figure out how to upload the code because there was an error that i didn't understand . They told me that to remove TX and Rx pins from the Arduino before uploading because Arduino use this pins while he upload the code.
I got stuck three times first i didn't know how to connect the HC-05 but when i followed the circuit in videos wire by wire i make it finally .
second time when i upload my code and everyone helped me in slack community.
Third i didn't find the HC-05 Bluetooth name and Micheal told me to pair it first with my mobile.
Honestly my final project against using mobile because my idea to stay away from mobiles not to use them.
we made an arm robot in the end of week session and it's very interesting and fun to me.
Making Arm Robot