USB cable

Interfacing BBFuino with BlueBee

Introduction

Bluetooth wireless communication is becoming more and more common recently. In response to this trend, Cytron Technologies has came up with a new Bluetooth module called BlueBee, which provides hobbyists a wireless remote control on their microcontroller circuits thus robots through serial port communication service attached with BlueBee. In the section, a simple project will be constructed to illustrate how to use BlueBee for wireless communication to interface another Cytron product, breadboard friendly Arduino, BBFuino to control LEDs.

Hardware Required:

  • BlueBee module – 1
  • XBee Starter Kit without module – 1
  • Breadboard – 1
  • Resistor 330 Ohm – 2
  • LED – 2
  • Power adapter DC 12V – 1
  • UC00A Rev 2.0 – 1
  • Jumper (Male to Male)
  • Computer equipped with Bluetooth adapter or Bluetooth dongle

           BlueBee     XBee Starter Kit (without module)        Breadboard

        Leds and resistor          Power adapter DC 12V                 UC00A Rev2.0

        330 Ohm

       Jumper(Male – Male)

Software Required:

**HyperTerminal for Window Vista & 7 please download here.For Window XP, please refer to UC00A User Manual.

**Installation of Arduino IDE can refers to User manual (Fun & Learning With Arduino Projects).

**Installation of USB driver can refers to USB driver installation guide.

Related References:

**Users are encouraged to go through BBFuino user manual and Arduino user manual (Fun & Learning With Arduino Projects) for better understanding of BBFuino features and basic programming techniques used in Arduino.

Procedure:

Part I: Hardware Assembling

1. Plug in the BBFuino onto breadboard and complete the circuit part for LEDs as shown below:

                                                                          Figure 1: Circuit part for LEDs

Figure 2: Circuit part for LEDs design using Fritzing

2. Plugin in the BlueBee to XBee Socket of XBee Starter Kit (which is compatible) in a correct way.

Figure 3: XBee Socket, compatible to BlueBee

3. Move the mini jumper at key Selector to Trans for communication mode as shown.

Figure 4: Mini jumper at Trans of key selector for communication mode

*AT mode of key selector is used for configuration of properties of BlueBee like name, baudrate, mode, pairing code and others that will be used later in communication mode.

4. Plug in the XBee Starter Kit board with BlueBee onto another side of breadboard as shown.

Figure 5: Plugin the XBee Starter Kit onto the breadboard

**Only labeled pins side is plugged into breadboard since the size of breadboard is limited

and

**Avoid to plug in the unlabeled pins side onto breadboard where the track is connected since it consists of  GND and 5V to prevent short circuit occurs. Be careful.

5. Connect the BBFuino to XBee Starter Kit as shown below:

a) Connection at BBFuino

b) Connection at XBee Starter Kit

Figure 6: Connection between BBFuino and XBee Starter Kit

**TX from BBFuino to RX of XBee Starter Kit

**RX from BBFuino to TX of XBee Starter Kit

6. The completed circuit is shown below.

Figure 7: Complete circuit for interfacing BBFuino with BlueBee

Figure 8: Complete circuit for interfacing BBFuino with BlueBee design using Fritzing

7. Connect the power adapter DC 12V to BBFuino and turn it on. Both BBfuino and XBee Starter Kit wiill be turned on as seen by the power indicators (green LEDs). Also, the onboard orange LED on BlueBee will blinking at frequency about 2 Hz which signifying it is in the communication mode which is communicable.

Part II: Software Utilization and Configuration

In this section, the host computer used for demonstration is a laptop with default built-in Bluetooth adapter and the OS used is Windows 7.

i) Loading program to BBFuino

1. Open the Arduino IDE and open the program code of BBFuino, which can be downloaded through the attachments section at the bottom

2. Turn off the power adapter DC 12V if you turned it on previously. Connect BBFuino and the host computer through UC00A Rev2.0 using USB cable as shown below.

Figure 9: Connection between the host computer and BBFuino through UC00A Rev2.0

3. Compile the ready typed program code first to check any error occurs. After that, load the program into the BBFuino.

4. Remove the UC00A Rev2.0 from BBFuino and turn on the power adapter DC 12V again.

ii) Pairing with BlueBee

1. Right click the “Bluetooth Devices” icon at the Window Taskbar and choose “Add a Device” option.

    or

    Go to Control Panel > Hardware and Sound  and choose the “Add a Device” option under the “Devices and

    Printers” category.

Figure 10: “Bluetooth Devices” icon

2. Wait for the computer to search and list out available Bluetooth devices.

3. Choose the Bluetooth device called “BlueBee” and click Next.

4. Enter the pairing code for BlueBee which is “1234” in default and click Next.

5. Wait for the computer to finish the pairing and the installation of corresponding COM port for Bluetooth serial communication.

Figure 11: COM ports installation for Bluetooth wireless communication

*After pairing up, user can see the BlueBee onboard led will turn on and turn off. It repeats that action again after each interval about 3 seconds infinitely.

6. User can check the corresponding COM port installed for BlueBee by right click the “Bluetooth Devices icon” and choose “Show Bluetooth Devices”  option.

     or

     Go to Control Panel > Hardware and Sound > Devices and Printers

Next, right click the added BlueBee and choose “Properties”. The COM port installed for BlueBee is shown under the “Hardware Tab”. In this case, the COM port is COM68.

Figure 12: COM port installed for BlueBee

iii) Setting up hyperterminal for communication

1. Open the hyperterminal.exe.

2. Enter name for the new connection (for example: BlueBee Connection) and click  OK.

3. Choose the installed COM port for BlueBee from the “Connect using:” combo box (COM68 is choosen in this demonstration) and click OK.

4. Under the COM properties/Port setting, click the “Restore Defaults” button and click OK.

5. The above configurations will set up a serial communication with:

  • Baudrate = 9600
  • Databits = 8
  • Parity = None
  • Stop bits = 1
  • Flow control = None

6. After the new connection has been finished set up, the BlueBee will be called automatically for connection.

7. If the BlueBee is successfully connected to the hyperterminal, the on onboard LED of BlueBee will turn on and turn off twice. It repeats that action again after each interval about 2 seconds infinitely.

8. The BlueBee is ready for transmission. According to the program loaded into BBFuino, the following results is expected.

  • Type ‘1’ in hyperterminal will light up both LED1 & LED2 and get response with a string “LED1 and LED2 are on”
  • Type ‘2’ in hyperterminal will turn off both LED1 & LED2 and get response with a string “LED1 and LED2 are off
  • Type ‘3’ in hyperterminal will makes both LED1 & LED2 blinking and get response with a string “LED1 and LED2 are blinking”
  • Type character other than ‘1’, ‘2’ and ‘3’ will not change current state of LEDs and get response with a string “Nothing change”

Figure 13: LEDs are on when the ‘1’ on keyboard is pressed

9. A GUI control panel is also created to facilitate the interfacing BBFuino with BlueBee for LEDs lighting. It can be downloaded through the attachments section at the bottom.

Steps in using LEDs control panel GUI is shown in the following:

1. The downloaded file is a zip.file. Extract it.

2. The folder extracted contains setup.exe for LEDs control panel. Double click it for install.

3. After finish installed, the LED control panel will popped up and its appearance is like below:

Figure 14: The LEDs control panel GUI

4. First press the “Search” button to search available COM ports.

5. Choose the installed COM port for Blue Bee from the “COM” combo box. In this demonstration, COM68 is choosen.

6. Leave the baudrate as default value, 9600 and click the “Connect” button.

7. The message “COM68 is connected” will be shown in “COM status” textbox if it is successfully connected.

**If the BlueBee is unable to connect, press the RESET button on XBee Starter Kit and then press the “Connect” button again

**Make sure user is not calling BlueBee through the hyperterminal at the same time (please close the hyperterminal first). This may cause the LEDs control panel unable to connect BlueBee through the installed COM port.

8. After that, user can see the LEDs response by clicking any button likes “LED on”, “LED off” and “LED blink” in the “Transmit” group box.

Figure 15: COM status message and buttons in “Transmit” groupbox for clicking

Figure 16: LEDs are on when the “LED on” button is clicked

To learn more about how to build an GUI control panel, user can go to Cytron tutorial on Getting Started On Graphical User Interface GUI.

That’s all from me. Have a great fun with your BlueBee!! See you next time. If you have further inquiry, please do come to our technical forum to discuss, we seldom check the comments in tutorial page 🙂

Attachments:

Sample code and GUI.

In Github there are two folders:

  • Program code of BBFuino
  • LEDs control panel GUI

Buy

, , , , , , ,

Related Post

ThingSpeak

ThingSpeak: Store and Display Digital Compass Data to Web Services with Espresso Lite V2.0

esp8266-14_shieldremoved

EasyMP3 Shield with WiFly Remote

Jpeg

How to Make your Line Following Robot Faster?

Control Mobile Robot through WiFi with ESP-WiFi Shield (Arduino + Andriod)