6
\$\begingroup\$

I want to get started with Bluetooth 4.0 / Bluetooth Low Energy / BLE. I know it's different from a normal Bluetooth.

Currently I'm using BlueSmirf Bluetooth 2.1 module, UART interface and SPP profile.

I have a simple operation sending a string to arduino. Up to 512 byte/second. Since I'm using BlueSMirft BT module, it's easy and everything is transparent.

It's seems it's not easy to do this in BT4. http://www.bluegiga.com/BLE112_Bluetooth_low_energy_module

I just want to get the basic idea how difficult it's to learn BT 4.0 before I buy the development kit. Not cheap, $350+.

  1. Do you have a sample code on how to setup and send a simple string using BT4?
  2. Bluetooth low energy technology supports very short data packets (8 octet minimum up to 27 octets maximum) that are transferred at 1 Mbps. http://www.bluetooth.com/Pages/low-energy-tech-info.aspx With this limitation, can I send data 512 bytes / second?

Thanks!

\$\endgroup\$
13
\$\begingroup\$

I have also been playing around with BLE, and decided to go with the Nordic nRF8001 chip because it looked easier to work with and didn’t require expensive IAR tools. nRF8001 is slightly cheaper than the CC2540 part in BLE112, but it is slave-only.

I bought Nordic’s nRF8001 development kit for $99, which includes nRF8001 samples and several nRF8001 boards (one with a trace antenna and one with an SMA connector) with standard 0.1" header for easy interfacing with your microcontroller development board. The documentation assumes that you have the $399 nRFgo development board and want to use the included nRF8200 microcontroller. I didn’t, so instead I wired an nRF8001 board directly to an Arduino.

You speak SPI to nRF8001, but basically with 2 different slave select-like pins. One pin (REQN) is a traditional slave select which is brought low to indicate that the master (you) want to send a message. The other pin (RDYN) is for the slave (nRF8001) to indicate that it received something over RF that it wants to send to the master, or that it is ready to receive a command from master. Master then brings REQN low and starts receiving.

The protocol is very concise and well documented (in the Product Specification PDF provided by Nordic) and I wrote an Arduino sketch to setup the nRF8001 and have it talking to my iPhone 4S in an afternoon. The format is basically one length byte, one command byte, and then optional command-specific arguments.

You will need Nordic’s nRFgo Studio software to create a configuration specifying the services your device will support; it will then include a services.h file containing the setup messages you need to send to nRF8001. I finally managed to emulate a heart rate monitor and display numbers in Nordic’s iOS demo app.

One big benefit of nRF8001 compared to BLE112 is that, apart from the proprietary setup messages generated by nRFgo Studio, you only deal with a well documented serial protocol. No firmware upgrades! It’s very cool that the CC2540 has an on-board 8051 microcontroller, but you’ll either need to pay thousands of dollars for the IAR tools or deal with the limitations and annoyances of BlueGiga’s software stack. A raw CC2540 is cheaper than nRF8001 plus a microcontroller, but BlueGiga’s boards are not cheap.

(There is a UART on the nRF8001 that is brought out on the boards included in the development kit, but it’s only for Bluetooth’s Direct Test Mode and isn’t ordinarily used.)

\$\endgroup\$
  • \$\begingroup\$ I would love to talk with you in more detail about this. Please stop by the chat room at some point if you get a chance. I'm in there pretty much every weekday from 10am til 6pm EST and various other times as well. Use the @ to ping me and I'll be sure to stop by. \$\endgroup\$ – NickHalden Nov 17 '12 at 4:47
  • \$\begingroup\$ Could you post/add the schematic for the arduino and the nRF8001? If possible the arduino sketch would be awesome! \$\endgroup\$ – Roger May 30 '13 at 23:13
  • \$\begingroup\$ I'm probably the last person in the world to find out my iPhone 4s has BLE (actually after Googling it, found out it was the first device to implement BT 4.0). Now I'm tempted to get one of these development boards too. \$\endgroup\$ – tcrosley Apr 10 '14 at 0:42
3
\$\begingroup\$

The presentation on the BlueGiga website for this module, last slide, provides the data throughput:

http://www.bluegiga.com/files/bluegiga/Bluetooth_LE/LowEnergy_HowItWorks.pdf

The actual application data throughput is limited to 200kbps, although the data is transmitted at 1Mbps.

You want to transfer 512 bytes per second == 512 x 8 = 4096 bits per second

4096 x 60 seconds = 245760 bits per minute which is 45kbps more than Bluetooth low energy can support.

Thus, only if you can reduce your data load, it has a chance of working.

Also, don't forget, BLE is low power/energy because it is designed to only send small amounts of data irregularly. If you are sending the large amount of data you are proposing, I am not entirely sure you will achieve large power savings in your application. The module you highlighted from BlueGiga needs 27mA in transmit. Some of their other modules (v2.1+EDR) can consume as little as 7mA, but they can also reach 70mA.

Unfortunately I can't comment on your programming question as I have not had a chance to actually use these modules.

Good luck!

\$\endgroup\$
  • 6
    \$\begingroup\$ Why are you multiplying by 60? 4096 bits per second is 4kbps (vs 200kbps max). His application will transfer 245760 bits per minute. \$\endgroup\$ – Ricardo Tomasi Feb 26 '12 at 20:26
2
\$\begingroup\$

http://dmitry.gr/index.php?r=05.Projects&proj=15&proj=11.%20Bluetooth%20LE%20fakery shows an interesting approach to BLE: the author reuses an extremely cheap (1 - 2 $) and simple nRF24L01+ module for sending BLE advertisements. For some applications, that might already be enough.

\$\endgroup\$
2
\$\begingroup\$

There are many ways. Tgr two most popular chipsets are CC2541 from TI and nRF51822 from Nordic. I have a nice comparison that goes into details: http://www.argenox.com/library/wp_bluetooth.php

\$\endgroup\$
0
\$\begingroup\$

you make a mistake in your calculation. 512 x 8 = 4096 bits per second: this is OK and of course 4096 can be send with 1 Mbit/sec, 1000000 bit can pass, not just 4096. why you multiply that by 60 ? to find in minutes ? 1Mbit can transfer 100Kbyte.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.