BLUTOOTH SWITCH (ARDUINO)
Hi, Using this we can control leds using Smart Phone via Blutooth. We can also control home appliances using Relay with it. For Video : CLICK HERE .
THING'S NEEDED
- Arduino UNO R3.
- HC - 05 Blutooth Module.
- Leds or Relay (For 240v).
- Breadboard.
- Jumper Wires.
- 9V Battery
CIRCUIT DIAGRAM
WIRING
ARDUINO TO BLUTOOTH MODULE
- Connet the VCC of Blutooth Module to 5 + of Arduino.
- Connect the GND of Blutooth Module to GND od Arduino.
- Connect TX of Blutooth Module to RX of Arduino.
- Connect RX of Bultooth Module to TX of Rduino.
ARDUINO TO LEDS
- Led 1 - Pin 13 of Arduino.
- Led 2 - Pin 12 of Arduino.
- Led 3 - Pin 11 of Arduino.
- Led 4 - Pin 10 of Arduino.
APPLICATION IN PHONE
CODE
// Bluetooth switch
// scientist BENIELS LAB
void setup() {
Serial.begin(9600); pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
if(Serial.available()>0)
{
char data= Serial.read(); // reading the data received from the bluetooth module
switch(data)
{
case '1':
digitalWrite(13,HIGH);
break; // when a is pressed on the app on your smart phone
case '2':
digitalWrite(13,LOW);
break; // when d is pressed on the app on your smart phone
case '3':
digitalWrite(12,HIGH);
break;
case '4':
digitalWrite(12, LOW);
break;
case '5':
digitalWrite(11,HIGH);
break;
case '6':
digitalWrite(11, LOW);
break;
case '7':
digitalWrite(10,HIGH);
break;
case '8':
digitalWrite(10, LOW);
break;
case '9':
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
break;
case '0':
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
break;
default : break;
}
Serial.println(data);
}
delay(50);
}SUBSCRIBE TO "scientist BENIEL'S LAB" IN YOUTUBE FOR MORE ELECTRONIC'S & ROBOTIC'S PROJECTS.THANK YOU


Comments
Post a Comment