Skip to content

SALES INQUIRIES: 1 (888) 767-9864

Bluetooth Controlled LEDs on a Skateboard :: Student Project

If you’re going to ride – why not ride in style?

And if you’re going to ride in style, why not control your style through your cell phone via a Bluetooth module connected to an Arduino?

That’s just what Ben Isaacs did with his skateboard (long board).  He controls the LEDs through his phone via a HC-06 bluetooth module.

The Ride:

Bluetooth LED Skateboard

Pretty sweet looking ride!

Bluetooth LED Skateboard

Here is the bottom of the board.  Is any project truly complete without tape?

Bluetooth LED Skateboard

The Bluetooth Interface:

This is the phone interface he used to control the LEDs with the bluetooth module. The application end of the Bluetooth was developed by Whatakuai.  You can check it out here: http://www.whatakuai.com/de/bluetooth-and-app-inventor/Bluetooth LED Skateboard phone program

The Arduino Code:

Ben was also kind enough to share his code:

/*
  By Benjamin Caspar Isaacs
  Twitter: @Benjamincreater
  Attribution to: Great scott
  This code is in the Public domain
*/

char blueToothVal;           //value sent over via bluetooth
char lastValue;              //stores last state of device (on/off)

void setup()
{
  Serial.begin(9600);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT); // these are the output pin's for the Led's
  pinMode(4, OUTPUT);

}


void loop()
{
  if (Serial.available())
  { //if there is data being recieved
    blueToothVal = Serial.read(); //read it
  }
  if (blueToothVal == 'n')
  { //if value from bluetooth serial is n
    digitalWrite(2, HIGH);           //switch on LED
    if (lastValue != 'n')
      Serial.println(F("LED is on D2")); //print LED is on
    lastValue = blueToothVal;
  }
  else if (blueToothVal == 'f')
  { //if value from bluetooth serial is n
    digitalWrite(2, LOW);            //turn off LED
    if (lastValue != 'f')
      Serial.println(F("LED is off D2")); //print LED is on i have commented but you can uncomment it
    lastValue = blueToothVal;
  }

  if (Serial.available())
  { //if there is data being recieved
    blueToothVal = Serial.read(); //read it
  }
  if (blueToothVal == 'c')
  { //if value from bluetooth serial is n
    digitalWrite(3, HIGH);           //switch on LED
    if (lastValue != 'c')
      Serial.println(F("LED is on D3")); //print LED is on i have commented but you can uncomment it
    lastValue = blueToothVal;
  }
  else if (blueToothVal == 'f')
  { //if value from bluetooth serial is n
    digitalWrite(3, LOW);            //turn off LED
    if (lastValue != 'f')
      Serial.println(F("LED is off D3")); //print LED is on i have commented but you can uncomment it
    lastValue = blueToothVal;
  }

  if (Serial.available())
  { //if there is data being recieved
    blueToothVal = Serial.read(); //read it
  }
  if (blueToothVal == 'a')
  { //if value from bluetooth serial is n
    digitalWrite(4, HIGH);           //switch on LED
    if (lastValue != 'a')
      Serial.println(F("LED is on D4")); //print LED is on i have commented but you can uncomment it
    lastValue = blueToothVal;
  }
  else if (blueToothVal == 'f')
  { //if value from bluetooth serial is n
    digitalWrite(4, LOW);            //turn off LED
    if (lastValue != 'f')
      Serial.println(F("LED is off D4")); //print LED is on i have commented but you can uncomment it
    lastValue = blueToothVal;
  }

  delay(100);
}

Nice work Ben – very cool project!

6 Comments

  1. Avatar JohnnyFRX on September 19, 2016 at 7:47 am

    Very cool project…Nice Job! My youngest Son just got himself a skateboard. I should swipe it some time and add your ‘goodness’ to it as a surprise! I also just started playing with the HC-06 BT module. It is quite a versatile little addition to my Arduino arsenal.

    • Avatar MICHAEL JAMES on September 19, 2016 at 9:11 am

      I agree – great job Ben!

      I haven’t checked out the HC-06 Bt module yet, but this has gotten me interested to see how it works.

      • Avatar JohnnyFRX on September 19, 2016 at 9:18 am

        There are a bunch of free Android Apps on the google play site to interface with the BT module. I have already controlled a relay connected to a table lamp with it. There is also a nice app to receive data sent to your phone from the Arduino. I was monitoring my Arduino LDR ‘Live’ from across the room so I could choose what the best brightness threshold should be ultimately set to. Fun Stuff!!

  2. Avatar Dan Massey on September 19, 2016 at 9:41 pm

    This is so awesome Ben. Thanks for sharing it. I love the App addition to the Arduino. This is a whole other avenue to travel down. Good job!
    Dan

  3. Avatar Krishna on March 13, 2017 at 4:28 am

    Can you send me the applicaton project file .aia OR send me blocks image.
    gvk556@gmail.com

    Thanks

    • Avatar Benjamin Isaacs on March 25, 2017 at 1:01 am

      You will need to log in using your Google account ai2.appinventor.mit.edu/?galleryId=4854508502384640

Leave a Comment