Build a simple smart circuit that contains at least TWO action components that you can control wirelessly.
Use either the Android GUI or PC GUI to control the action components
Ardiono IDM:
to wirte down the code
Arduino bluecontrol:
control the code wireless
Tinkercad:
design the cuircuit but it doesn't have the blueotooth device.
Title of Media
Tinkercad design, imaging that there is bluetooth device
I tried to design the cuircuit on tinkercad, but I couldn't find bluetooth device. So, I used the connections from tinkercad then I added the bluetooth connection to it.
Materials:
Bluetooth module
arduino uno
Jumpers
resistors (1K, 560, 220)ohm
buzzer
RGB led
breadboard
I connected the wires, then tried many times and it wasn't work. So, I foundout that I need to dissconnect I/O inputs during the uploading.
after the code uploading, I tested the conditions and it works.
the conditions:
entering 1 -> red light
entering 2 -> green light
entering 3 -> blue light
entering 4 -> no light
anything else -> buzzer alarm
the code:
// Definig the constant integers we will use in the circuit by their pins no.
const int buzzer = 2;
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
char incomingdata = '0'; //character variable with initial data = 0
void setup() {
Serial.begin(9600);
//Defining the color lights and buzzer as outputs
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(buzzer, OUTPUT);
}
void loop() {
while (Serial.available() == 0);
incomingdata = Serial.read(); // reciving the read from the mobile app and store it in incomingdata variable
// the conditions are if the recived data =1, red light is on;
// if the recived data =2, green light is on
//if the recived data =3, blue light is on
//if the recived data =4, no light is on
// else any number is going to turn the buzzer on
if (incomingdata == '1') {
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, LOW);
} else if (incomingdata == '2') {
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
digitalWrite(bluePin, LOW);
} else if (incomingdata == '3') {
digitalWrite(redPin, LOW);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, HIGH);
} else if (incomingdata == '4') {
digitalWrite(redPin, LOW);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, LOW);
} else {
tone(2, 523, 2000); // play tone 60 (C5 = 523 Hz)
}
}
yes, cause at first I used servo motor but it didn't work. instructor adviced me to change it. So, I used RGB led.
when the servo motor wasn't working I changed it to RGB led.
when the arduino wasn't uploading the code, I disconnected the I/O inputs of the bluetooth device.
It will help me if i wanted to connect the device wirelessly.
may br the hackathon was cool, but I didn'y attend it