Devices & Components
Arduino Uno Rev3
LED, Blue
Breadboard (generic)
5 mm LED: Green
Jumper wires (generic)
5 mm LED: Red
HC-05 Bluetooth Module
Software & Tools
Arduino IDE
Bluetooth Electronics
Project description
Code
Code
c_cpp
1 void setup() { 2Serial.begin(9600); 3 pinMode(3, OUTPUT); // put your setup code here, to run once: 4 pinMode(4, OUTPUT); 5 pinMode(5, OUTPUT); 6 } 7 8void loop() { 9 // put your main code here, to run repeatedly: 10 if(Serial.available()>0) 11 { 12 char data= Serial.read(); // reading the data received from the bluetooth module 13 switch(data) 14 { 15 case '1': digitalWrite(3, HIGH);break; 16 case '2': digitalWrite(4, HIGH);break; 17 case '3': digitalWrite(5, HIGH);break; 18 19 case '4': digitalWrite(3, LOW);break; 20 case '5': digitalWrite(4, LOW);break; 21 case '6': digitalWrite(5, LOW);break; 22 23 default : break; 24 } 25 Serial.println(data); 26 } 27 delay(50); 28}
Code
c_cpp
1 void setup() { 2Serial.begin(9600); 3 pinMode(3, OUTPUT); // put your setup code here, to run once: 4 pinMode(4, OUTPUT); 5 pinMode(5, OUTPUT); 6 } 7 8void loop() { 9 // put your main code here, to run repeatedly: 10 if(Serial.available()>0) 11 { 12 char data= Serial.read(); // reading the data received from the bluetooth module 13 switch(data) 14 { 15 case '1': digitalWrite(3, HIGH);break; 16 case '2': digitalWrite(4, HIGH);break; 17 case '3': digitalWrite(5, HIGH);break; 18 19 case '4': digitalWrite(3, LOW);break; 20 case '5': digitalWrite(4, LOW);break; 21 case '6': digitalWrite(5, LOW);break; 22 23 default : break; 24 } 25 Serial.println(data); 26 } 27 delay(50); 28}
Downloadable files
Circuit Diagram
Connection of HC-05 Hook the GND pin (Negative Pin) of HC-05 to Pin GND of Arduino. Connect Red VCC Pin (Positive Pin) of HC-05 to VCC of Arduino. Connect TX pin (Data Transfer Pin) of HC-05 to RX pin of Arduino. Connect RX Pin of HC-05 to TX Pin of Arduino. Connection of LED Hook the GND Pin (Negative Pin) of all led to Pin GND of Arduino. Connect VCC Pin (Positive Pin) of Red LED to Pin 3 of Arduino. Connect VCC Pin (Positive Pin) of Blue LED to Pin 4 of Arduino. Connect VCC Pin (Positive Pin) of Green LED to Pin 5 of Arduino.
Circuit Diagram

Comments
Only logged in users can leave comments