Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

Control the world through Bluetooth with Arduino

Contents

These days almost every smartphone has Bluetooth. How awesome would it be if you could control the world by using just your phone’s Bluetooth feature? Well, it’s possible and much easier than you may think! Read on to find out how!

What is Bluetooth?

According to Wikipedia, “Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz[3]) from fixed and mobile devices, and building personal area networks (PANs). Invented by Dutch electrical engineer Jaap Haartsen, working for telecom vendor Ericsson in 1994”.

The HC-05 Bluetooth Module

HC-05 module is an easy-to-use Bluetooth SPP (Serial Port Protocol) module designed for transparent wireless serial connection setup. It is also very cheap and a really good choice for your projects.

Circuit Diagram

Code

				
					int led=8;

void setup() {
  pinMode(8,OUTPUT);
  Serial.begin(9600);
  }

void loop() {
  if (Serial.available()>0) {
    char data=Serial.read(); //reading the data from the bluetooth module
    switch(data){
      case 'a':digitalWrite(8,HIGH); // Pressing 'A' will power the led
      break;

      case 'b':digitalWrite(8,LOW); // pressing 'B' will turn off the led
      break;

      default: break;
    }
    delay(100);
  }
}
				
			

Upload it to the Arduino.

Next, Download this app to your Android:  https://play.google.com/store/apps/details?id=project.bluetoothterminal&hl=en

After downloading it, open the app. Tap “scan” and pair it with your HC-05 Bluetooth module. It may ask for a pin number; the default pin is: 1234

Now, Type “a” in the terminal. You should see your LED turning on.
Sending “b” will turn the LED off!

You can power the Arduino and the circuit from an external power source, and it will still work.

Congratulations! You have learned to control something using Bluetooth! Today a LED, tomorrow the WORLD!

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top