The idea consist of
2 outputs ;-
RGB light and Buzzer
Input : Bluetooth module
Arduino Bluetooth control app in android
Action :-
the user will control the different colors of the RGB by using the buttons 123 in the Arduino Bluetooth control app .
Button 4 will turn off the light .
any other button will release the alarm ( buzzer ).
The Idea was inspired by the application of the RGB colors in gaming setup . So I made a prototype of an RGB LED colors that can be controlled by a mobile app .
Softwares :-
Tinkercad : to draw the circuit
Arduino IDE : to write the Arduino code
for Bluetooth control : Arduino Bluetooth control
Arduino Bluetooth control
Components:-
1-arduino UNO
2-RGB LED
3-Buzzer
4-Bluetooth module
5-Breadboard
6-wires
Design process
I used tinkercad and drew the circuit :-
Buzzer :-
pin 7 Arduino
GND breadboard
RGB :-
Red: pin 8 Arduino
green : pin 10 Arduino
Blue :pin 9 Arduino
cathode :GND breadboard
Bluetooth module :-
VCC : 5v pin Arduino
GND : GND in Arduino
TXD : pin 0 Arduino
RXD : to the breaking circuit
which consist of 2 resistors
1k ohm / 570 ohm (as shown in the pic )
Arduino UNO :-
5v : +ve part bread board
GND : -ve part breadboard
then I used Arduino IDE to write the code
Bluetooth module circuit
Coding :-
char (incomingData) = 0 :-
it means the Arduino will have a part named incoming data and its state for now is 0
#definine
I used define command for defining the pins with the colors as shown in the pic
Void setup :-
Serial.begin (9600): means the arduino will be ready for serial communication.
pinMode
will assign the pins as OUTPUT pins with output components connected to them
if serial read is ...1 the LED will be red
if..... 2 the LED will be green .
IF ..... 3 the LED will be blue
IF...... 4 the LED and the buzzer will be off
void loop:-
While () ;
means the code action will be stopped as long as the serial that the Arduino is reading is 0
incomingData = Serial.read ();
means that the serial reading value will be restored in incomingData
IF /else :
will define the 5 statues as shown .
if serial reads any other value the alarm (buzzer ) will go on .
I had a problem with the uploading and found my friends discussing it in SLACK.
Problem 1 :-
during uploading the code i found that error : i googled it and found so many reasons related to the connection and the cable but in my case it was uploading the code while the pins 1/0 are connected.
problem 2 :-
a problem with the code it self the {} in the If and else condition .
I deleted the code and write it step by step after testing the components .
in Tinkercad : the Bluetooth module was no longer supported so i looked for it in an old project and i edited the whole project .
I can use the Arduino Bluetooth control app to open the Box it will be more cool .
All my life I was fascinated about controlling a car with a remote-control now i can build my own car and control it with my own phone .
Also the exercise Saeed gave us we could turn on a light in Saeed's office while we are setting in our home using slack