12/24/2012

Bluetooth Low Energy Demo with cB-OBS421i-14

In this post, we like to show you how easy it is to set up a Bluetooth Low Energy Serial link with the new cB-OBS421i-14 module and an Apple iPhone 4s using the new connectBlue Serial Port Service for Bluetooth smart.



connectBlue cB-OBS421i-14
The OBS421i-14 is the latest  Dual Mode Bluetooth 4.0 module (Bluetooth smart ready) developed by connectBlue. In this example we use the module in Low Energy (Bluetooth Smart) mode as a "peripheral" device. This post also applies to the new OLS425/426 modules which support Bluetooth Smart only.

connectBlue App
The demo software is available free of charge from the Apple App Store.
This app was originally designed to work with the OLP425 to show the integration of a battery gauge, a temperature sensor and one accelerometer. The integrated ASCII terminal is also available to test the serial data transmission. The App source code is available for connectBlue customer free of charge.

List of Tools I have used for this demo:

  1. ConnectBlue Bluetooth Smart Ready Module cB-OBS421i-14
  2. USB Adapter cB-ACC-34
  3. ConnectBlue configuration program "SPA Toolbox"
  4. Free Terminal program "Comm Operator Pal" (http://www.serialporttool.com/CommPalInfo.htm)
  5. Apple iPhone 4s
  6. ConnectBlue demo App "cB-OLP425"(https://itunes.apple.com/us/app/cb-olp425/id575523395?mt=8)

Configuration of the OBS421 module
We only focus on the minimal configuration based on the latest beta F/W of the modules to get the connection established. Click here to download the configuration software at connectblue.com.

If you are not familiar with the connectBlue Serial Port Adapter Toolbox please check out our other post "Getting started with connectBlue Serial Port Modules".







1. Name the module "cB-OBS421i-14-ES" (Local Name - AT*AGLN)

2. Activate Bluetooth Low Energy (Use Low Energy - AT*ALE)









3. Select Server Profile "SPP LE Peripheral" (AT*ADDSP)








Save your configuration and switch into "Data Mode" (make sure "Reset Module Going To Data Mode" is activated as well). Close the SPA Toolbox Software and start "Comm Operator Pal" 

How the Demo works!?

The Terminal Program
In general any terminal program (i.e. Hyperterminal, PuTTY, etc.) can be used, in this example we use Comm Operator Pal.


Interface settings:

Comm Operator Pal will ask you for the serial settings.
These are the same you have prior used with the SPA Toolbox.

In our example, the PC assigned the virtual port to COM11 and factory settings of the UART interface of the module are used.




















Preparation of the iPhone 4s



Please install the App from the link above and make sure Bluetooth is activated in your System Preferences.

Please note that only iPhone 4s/iPad3 and newer generations of iOS devices support Bluetooth 4.0+LE.

After starting the App, you can scan for available devices.

If you haven't activated Bluetooth yet, the App will ask you to do so.

To connect with the OBS421 module, simply click on the discovered demo device "cB-OBS421i-14-ES".

After you are "connected" please click on the "Chat" tab in the lower right corner to open the Terminal to transmit and receive ASCII characters.









The text "text send by iPhone 4s" can be transmitted by clicking on the "Send" button and is immediately shown in the terminal program "Comm Operator Pal".


You can now enter a "reply" in the terminal program and send it back to the iPhone.

















Due to a max. frame size of 20 characters in Bluetooth LE, the "reply" will be shown in two columns on the iPhone 4s.



























The communication can be continued, until the connection between the iPhone and the OBS421 is stopped.


For more information about the modules please check the following links:

No comments:

Post a Comment