• Adding Bluetooth to your project on the cheap

    Introduction:

    These days, projects that communicate wirelessly is a must. Be it via, WiFi, radio, Bluetooth or whatever else it beats wires, because wires suck. So it’s pretty great to find that Bluetooth serial modules can be found on the cheap, this one is less than £6 from DealExtreme and is pretty perfect for adding to any project.

    The module is small and actually pretty powerful, we managed to get data out of it around 40-50feet away. It’s insanely simple to set up on boards like Arduino and mbed and only takes a little more effort to get working on a PIC or ARM board.

    Specifications:

    Dimensions: 1.73 in x 0.63 in x 0.28 in (4.4 cm x 1.6 cm x 0.7 cm)
    Weight: 0.25 oz (7 g)
    Range: 40-50 Feet
    Voltage In: 3.6V – 6V
    Link: DealExtreme

    Set Up:

    The device is incredibly simple to set up, just hook up the pins as follow:

    Bluetooth Module Pin Generic Microcontroller Pin Arduino Pin
    RXD (receive data pin) TX pin 1 (TX)
    TXD (transmit data pin) RX Pin 0 (RX)
    GND (ground) GND Gnd (Power)
    VCC (voltage in) 3.6V – 6V 5V (Power)

    The device is assigned a random name, as of yet I haven’t figured out how to rename it but when I do I’ll update the page, however this means you’ll need to find out what it’s name is. If you have Bluetooth on your phone or PC check for its name.

    Once set up you’ll notice the blinking red LED on the module, this shows the module is on but not connected to another device. The LED will become a continuous red once something is connected.

    Sending data (Arduino):

     

    1. void setup() {
    2.   // put your setup code here, to run once:
    3.   Serial.begin(9600);
    4.  
    5. }
    6.  
    7. void loop() {
    8.   // put your main code here, to run repeatedly:
    9.  
    10.   Serial.write("Hello World!\n");
    11.  
    12.   delay(100);
    13.  
    14. }

    To check if it works, try opening up an app like BlueTerm on Android. Once you connect, you should see a stream of “Hello World!”‘s on your screen.

    Receiving data (Arduino):

    1. void setup() {
    2.   // put your setup code here, to run once:
    3.   Serial.begin(9600);
    4.  
    5. }
    6.  
    7. void loop() {
    8.   // put your main code here, to run repeatedly:
    9.  
    10.   data = Serial.read();
    11.  
    12.   delay(100);
    13.  
    14. }

    Using BlueTerm, or any other Bluetooth communication app you should be able to send it a letter or number and it’ll send it back!

    One Response to Adding Bluetooth to your project on the cheap

    1. November 26, 2012 at 2:48 pm

      You’ve provided the same code twice here =(

    Leave a Reply