This week's assignment idea is a system that contains an RGB LED and a Buzzer both controlled by phone via Bluetooth.
Which is simply a personal interest 😁
The application used to connect via Bluetooth module is "Arduino Bluetooth" on my mobile phone
Used to simulait electrical circuit
Avometer
Breadboard
Arduino Uno
Bluetooth module
Jumper wires
Crocodile wires
RGB LED
Circuit wiring:
Bluetooth module (represented by ultrasonic sensor) connected:
VCC -> 5v
GND -> GND
TX -> RX
RX -> TX
Buzzer on pin 2
Red on pin 3
Blue on pin 4
Green on pin 5
Defining pins and Serial reading variable
Setting pins as outputs and starting the Serial communication
Reading only if there is a serial input to avoid constant reading
Assigning each number to a command (on/off) for both buzzer and each LED pin
Working principle:
The phone GUI is used to send serial messages to the Arduino
Each colour of the LED RGP is linked to a button, when pressed it lights that colour on and one button turns them all off
The buzzer is linked with two buttons; one turns it on and the other turns it off
Connecting Bluetooth module
Connecting buzzer
Connecting RGB LED
I tried to upload the arduino code and it kept on giving me errors, turns out that i cannot use the USB when the bluetooth module is connected beacuse it is using the Serial monitor, so the solution is to remove the bluetooth module when uploading a code.
Disconnecting Bluetooth module