This week’s assignment involves building a simple smart circuit that communicates wirelessly via Bluetooth to control at least two action components (like an RGB LED and a buzzer). The inspiration comes from the desire to integrate Bluetooth communication with Arduino to control basic components.
Google: For searching about different code
YouTube: For searching and gathering inspiration
Tinkercad: A software to design and simulate electronic circuits
Electronic components: include RBG LED, buzzer, wires, Arduino, transistor,Blutooth module MD-BT13 ,and breadboard,
The Arduino IDE versions 2, 3, and 4 will be used for writing and implementing the code for the project.
Arduino Bluetooth controller: as enables wireless communication between an Arduino and a Bluetooth device, allowing remote control of components like RBG LED and buzzer via Bluetooth commands.
I used the Arduino UNO board to create a smart circuit that wirelessly communicates with a Bluetooth module. The circuit controls two action components: an RGB LED and a buzzer. These components were selected to allow for visible and audible feedback when controlled remotely via Bluetooth.
RGB LED: This allows the display of multiple colors by controlling its red, green, and blue pins. It’s used to show different states based on Bluetooth commands (e.g., red for "on", green for "active", blue for "idle").
Buzzer: The buzzer emits a sound when triggered by specific Bluetooth commands. It serves as an audible indicator for actions or events.
The circuit communicates wirelessly through the MD-BT13 Bluetooth module, which is connected to the Arduino UNO. Using a Graphical User Interface (GUI) on my phone (through an app like Arduino Bluetooth Controller), I can send commands to the Arduino to control the RGB LED and the buzzer.
The Arduino Bluetooth Controller app was used to create a simple interface that sends different commands to control the RGB LED and the buzzer:
Button 1 for Red (RGB LED),
Button 2 for Green (RGB LED),
Button 3 for Blue (RGB LED),
Button 4 to turn off the LED,
Button 5 to turn on/off the buzzer.
Button 6 to turn off the buzzer
The wiring for the circuit was developed using Tinkercad to visualize the connections before implementing them physically. The diagram shows the connections for the RGB LED, buzzer, and Bluetooth module to the Arduino UNO
I couldn't find bluletoothe module on tinkercad
1-Pin Setup:
pinMode(redPin, OUTPUT); sets the red LED pin (pin 6) as an output.
pinMode(greenPin, OUTPUT); sets the green LED pin (pin 5) as an output.
pinMode(bluePin, OUTPUT); sets the blue LED pin (pin 3) as an output.
pinMode(buzzerPin, OUTPUT); sets the buzzer pin (pin 9) as an output.
Serial Communication Setup:
Serial.begin(9600); initializes serial communication at a rate of 9600, enabling Bluetooth communication.
2-Loop Function:
Continuously checks if data is available from the Bluetooth (via Serial.available()).
Reads the incoming Bluetooth command with Serial.read().
Command Handling:
'1': Sets the RGB LED to red and turns off the buzzer (digitalWrite(buzzerPin, 0)).
'2': Sets the RGB LED to green and turns off the buzzer.
'3': Sets the RGB LED to blue and turns off the buzzer.
'4': Turns off the RGB LED and the buzzer.
Buzzer Control:
'5': Turns on the buzzer with a 1000 Hz tone using tone(buzzerPin, 1000) and prints "Buzzer ON".
'6': Turns off the buzzer with noTone(buzzerPin) and prints "Buzzer OFF".
Color Setting:
The setColor() function adjusts the RGB LED color by controlling its red, green, and blue pins using analogWrite()
I asked my colleagues about wiring of Bluetooth module, and they helped me to know more about how can i connect it with Arduino
When I ran the code to control the buzzer, it wasn't working. After troubleshooting the wiring and finding no issues, I reviewed the code and realized that I had set the buzzer to turn off using LOW. When I wanted to turn the buzzer on, I had used 1000 Hz for the tone. I then replaced LOW with 0, and the buzzer started working properly.
I learned how to use Bluetooth with Arduino and also discovered the importance of unit testing, which makes the troubleshooting process much easier.
I ennjoyed while making Robot Arm Circuit to make funny game
literally it was a funny learning journey ")
Title of Media