Arduino Bluetooth Basics

[tabby title=”Overview”]
This video will show you the basics of controlling an Arduino through bluetooth. Click the “Step” tags for a walkthrough!

[tabby title=”Step 1″]

Acquiring the Parts
Here’s what you will need:

  • A Bluetooth Capable Smartphone (I’ll be using an Android).
  • An Arduino ($10.99)
  • An Arduino Bluetooth Module ($6.45)
  • An LED ($0.99)

[tabby title=”Step 2″]


You can download the Fritzing sketch here.

Screen Shot 2014-03-08 at 7.38.33 PM

[tabby title=”Step 3″]



A good Android program for Arduino is called Ardudroid on the Google Play store.



int ledPin = 13; 
int state = 0;
int flag = 0; 
void setup() {
 pinMode(ledPin, OUTPUT);
 digitalWrite(ledPin, LOW);
 Serial.begin(9600); // Default connection rate for my BT module
void loop() {

 if(Serial.available() > 0){
 state =;

 if (state == '0') {
 digitalWrite(ledPin, LOW);
 if(flag == 0){
 Serial.println("LED: off");
 flag = 1;

 else if (state == '1') {
 digitalWrite(ledPin, HIGH);
 if(flag == 0){
 Serial.println("LED: on");
 flag = 1;

[tabby title=”Links”]

Follow Tinkernut!
Google +


5 Responses

  • edmandowling // //

    Hi, I have done the set up as shown and I have connected the bluetooth module to my phone but when I try send information to turn off the LED, nothing happens. It I have the LED set HIGH in setup and try to turn it off via blutooth nothing happens. Any advice how to solve this for me?

  • schwad // //

    I am having the same problem as edmandowling. I am using the HC-06, will this make any difference?

Leave a Reply