This Week assignment was to create a circuit with to Output controlled by Bluetooth. So, I used a Servo motor and RGB together with bluetooth.
The idea came up by thinking the back of the car. You can see which direction the car is heading by seeing the light emitted. if it turns left, the left light blinks, the same if it turns right.
Tinkercad
Arduino IDE
GUI Bluetooth
Arduino
Cable
Servo
RGB LED
Jumpers
Breaboard
Resistors 220ohm
Bluetooth Module
Title of Media
RGB Led :
GND ===> negative rail on breadboard
Green RGB Led ===> pin 3 Arduino Uno
Blue RGB Led ===> pin 5 Arduino Uno
Red RGB Led ===> pin 6 Arduino Uno
Servo:
Signal ===> pin 9 Arduino Uno
Negative===> negative rail on breadboard
Negative===> negative rail on breadboard
Defining pins and Serial reading variable
Setting pins as outputs and starting the Serial communication
Reading only the incoming data by using "Serial.read()"
Assigning each number to a command with special color and angle for the RGB and servo
First, I put the rgb on breadboard with tree 220-ohm resistors each leg then connected to the Arduino PINS
Then, I added the servo by connecting to PIN 9 arduino
Finally I added the Bluetooth module by connecting the RTX TO TX Arduino and TX to RTX Arduino
COMPLETE CIRCUIT
When enter "1" as incoming data the rgb become red and the servo do "0" degree angle
if I enter "2" as incoming data the rgb become blue the servo do "50" degree angle.
if I enter "3" as incoming data the rgb become green the servo do "100" degree angle.
if I enter "4" as incoming data the rgb become Violet the servo do "150" degree angle.
if I enter "5" as incoming data the rgb become Orange the servo do "180" degree angle.
if I enter "6" as incoming data the rgb become yellow the servo do "0" again degree angle.
I tried uploading the Arduino code but kept getting errors. I eventually realized that the USB can’t be used while the Bluetooth module is connected, since they both rely on the Serial monitor. The solution is to disconnect the Bluetooth module before uploading the code.
Title of Media