Introduction: Add Simple Bluetooth to Arduino

Picture of Add Simple Bluetooth to Arduino

Sometimes when you are first starting a new project, there is a lot of debugging going on, and with an Arduino platform, using the serial port to spit out data can be a very useful tool. Well what if there is no room to plug a USB cable into your Arduino when it is in location? Or what if you only have a short USB cable? Adding a virtual serial COM port to your Arduino projects is the solution to this problem. This is also a useful tool for remotely controlling or monitoring and Arduino's I/O without the need to internet connection or running wires back to a computer.

Step 1: Necessary Materials

Picture of Necessary Materials

The only extra piece of hardware or software for this is a serial bluetooth module. There is no special software needed, assuming that you already have Arduino installed. I like to use the cheap bluetooth modules that are found on eBay for less than $10. They are simple to use/interface and I have not had any trouble using them thus-far. You will also, of course, need an Arduino compatible MCU, I am using an Arduino UNO R3. Since these bluetooth modules have a standard serial interface, you can just as easily use them on any other MCU that has a serial port. On the software side, we will be using the standard Arduino IDE, I currently use 1.6.1 but any version should do. I will also be using the SoftwareSerial library, one that comes packaged in the Arduino install. The SoftwareSerial library is unnecessary but I prefer to use it so that I do not have to remove my bluetooth module from the Arduino serial port when I need to upload a new sketch.

Step 2: Adding SoftwareSerial to Your Sketch

Picture of Adding SoftwareSerial to Your Sketch

The SoftwareSerial library allows you to use two digital I/O pins to act as a serial port that is controlled via the library files. The library works just like the built in Serial function of Arduino. After importing the library, which I am assuming you know how to do, it is also in the pictures, you simply initialize the library by creating an instance with a name and describing the RX and TX pin numbers. Once you have initialized the library and given this new serial port a name, using it is exactly the same as using the standard Serial.'whatever' functions.

Step 3: Expanding Bluetooth Capabilities

As far as what else can be done using bluetooth, that is all up to you! I have mentioned creating Android apps that use bluetooth in a previous Instructable, here, but I plan on creating a more universal Instructable for sending commands via bluetooth to an Arduino based system. Stay tuned and I hope you enjoyed! And please vote!

Comments

phyominthant (author)2016-05-31

Currently I am looking for a code that scan the bluetooth signal and shows the signal strength of bluetooth that detected. It will be multiple bluetooth scan. Can you help me with this?

VenkadeshN (author)2016-03-27

I'm looking for a way to display the data on a lcd from a sensor to the android phone? (other way around)..can you help?

jordantallent (author)VenkadeshN2016-04-19

If you have an Android app that can read that sensor data, it is pretty easy to establish a bluetooth connection then you just want to send that data from the phone to the Arduino. I created a robot a few years ago where I used the MIT app inventor to read the accelerometer data from the phone and sent it to the Arduino robot to make it go forward, backward, left and right. Check out my published project on MIT app inventor. The OrientationSensor1.OrientationChanged is where I was sending everything from. Not sure that this is the best practice but it worked!

ai2.appinventor.mit.edu/?galleryId=5861877993439232

VenkadeshN (author)jordantallent2016-04-19

OH i see ..thanks jordantallent..well i'm a novice and currently learning.. i'll look into what you've made. ANd thanks again for introducing me to MIT appinventor, I just came to know its existence! yes.

VenkadeshN (author)2016-03-27

I'm looking for a way to display the data on a lcd from a sensor to the android phone? (other way around)..can you help?

ibenkos (author)2015-04-18

Im looking for a code for a HM-10 connected to 6 servos, I found one but it only works on android phone and I have a iPhone. Need help, thanks

jordantallent (author)ibenkos2015-04-21

I am actually unfamiliar with iPhone App creation, as it requires a Mac and I am a PC user. Maybe someday I'll own a Mac and start messing with creating Apple Apps. I'm sure that you can find an Instructable on using an iPhone's bluetooth to control Arduino.

ibenkos (author)jordantallent2015-04-21

I have been looking for a instructables for it and I cant find any, but thanks

acheide (author)2015-04-17

Thanks.

About This Instructable

21,216views

436favorites

License:

Bio: I am an application engineer for an industrial distributor. I help to support our sales team in programming of new projects for our customers. I ... More »
More by jordantallent:Automatic Window CurtainsHow to Use a 3D PenMy Shapeoko 2 Workflow
Add instructable to: