1

The title seems to be too general (I can't think of a good title). I'll try to be specific in the question description.

I was required to make an industrial control box that collects data periodically (maybe 10-20 bytes of data per 5 seconds). The operator will use a laptop or mobile phone to collect the data (without opening the box) via Bluetooth, weekly or monthly or probably at even longer period.

I will be in charge of selecting proper modules/chips, doing PCB, and doing the embedded software too. Because the box is not produced in high volume, so I have freedom (modules/chips to use, prices, capabilities, etc.) in designing different components.

The whole application requires an USART port to read in data when available (maybe every 5-10 seconds), a SPI port for data storage (SD Card reader/writer), several GPIO pins for LED indicator or maybe buttons (whether we need buttons and how many is up to my design).

I am new to Bluetooth. I read through wiki and some googling pages. Knowing about the pairing, knowing about the class 1 and class 2 differences, knowing about the 2.1 and 4.0 differences.

But I still have quite several places not clear to decide what Bluetooth module/chip to use.

  1. A friend of mine mentioned TI CC2540 to me. I checked and it only supports 4.0 BLE mode. And from Google, BT4.0 has payload of at most 20 bytes. Is BT4.0 suitable for my application when bulk data will need to be collected every month or several months? Or it's better to use BT2.1 with EDR for this application? BT4.0 BLE mode seems to have faster pairing speed but lower throughput?

  2. I read through CC2540, and found that it is not a BT only chip, it has several GPIO pins and uart pins (I am not sure about SPI). Can I say that CC2540 itself is powerful enough to hold the whole application? Including bluetooth, data receiving via UART, and SD card reading/writing?

  3. My original design was to use an ARM cortex-M/AVR32 MCU. The program is just a loop to serve each task/events in rounds (or I can even install Linux). There will be a Bluetooth module. The module will automatically take care of pairing. I will only need to send the module what data to send to the other end. Of course there might be some other controlling, such as to turn the module to low power mode because the Bluetooth will only be used once per month or something like that. But after some study of Bluetooth, I am not sure whether such BT module exists or not. Is programming chips like CC2540 a must?

  4. In my understanding, my designed device will be a BT slave, the laptop/phone will be the master. My device will periodically probe (maybe with longer period to save power) the existence of master and pair with it. Once it's paired, it will start sending data. Is my understanding on the procedure correct? Is there any difference in pairing/data sending for 2.1 and 4.0?

  5. How should authentication be designed? I of course want unlimited phones/laptops to pair with the device, but only if they can prove they are the operator.

It's a bit messy. I will be appreciated if you have read through the above questions. The following is the summary,

  1. 2.1 or 4.0 to use?
  2. Which one is the better choice? Meaning that suitable for the application, and easy to develop.
  3. How the pairing and data sending should be like for power saving? Are buttons useful to facilitate the sleep mode and active pairing and data sending mode for power saving?
  4. How the authentication should be done? Only operators are allowed but he can use any laptops/phones.

Thanks for reading.

user534498
  • 3,926
  • 5
  • 27
  • 52
  • 1
    One big consideration is the device that the user will be using to connect to your box - If it is iOS then you will probably need to use BT4.0 as BT2.1 connections would require your device to MFi certified - something you probably don't want to get involved in for this scenario. The other option to consider if power isn't a problem is WiFi - it is much faster than BT4.0 – Paulw11 Feb 27 '15 at 10:17
  • @Paulw11 Thanks! I was not aware of MFi. I will look into it. Wifi is not an option because bluetooth is customer's requirement. Energy is actually an important option because the device might be installed with solar power. – user534498 Feb 27 '15 at 11:41
  • sounds like a fun project, good luck! – AndersK Mar 26 '15 at 06:07

2 Answers2

4

My two cents (I've done a fair amount of Bluetooth work, and I've designed consumer products currently in the field)... Please note that I'll be glossing over A LOT of design decisions to keep this 'concise'.

2.1 or 4.0 to use?

Looking over your estimates, it sounds like you're looking at about 2MB of data per week, maybe 8MB per month. The question of what technology to use here comes down to how long people are willing to wait to collect data.

For BLE (BT 4.0) - assume your data transfer is in the 2-4kB/s range. For 2.1, assume it's in the 15-30kB range. This depends on a ton of factors, but has generally been my experience between Android/iOS and BLE devices.

At 2MB, either one of those is going to take a long time to transfer. Is it possible to get data more frequently? Or maybe have a wifi-connected base station somewhere that collects data frequently? (I'm not sure of the application)

Which one is the better choice? Meaning that suitable for the application, and easy to develop. ARM/avr32 + CC2540 (or the like) CC2540 only or the like (if possible) ARM/avr32 + some BT modules ( such as Bluegiga https://www.bluegiga.com/en-US/products/ ) Should Linux be used?

This is a tricky question to answer without knowing more about the complexity of the system, the sensors, the data storage capacity, BOM costs, etc...

In my experience, a Linux OS is HUGE overkill for a simple GPIO/UART/I2C based system (unless you're super comfortable with Linux). Chips that can run Linux, and add the additional RAM are usually costly (e.g. a cheap ARM Cortex M0 is like 50 cents in decent volume and sounds like all you need to use).

The question usually comes down to 'external MCU or not' - as in, do you try to get an all-in-one BT module, which has application space to program on. This is a size and cost savings to using it, but it adds risks and unknowns vs a braindead BT module + external MCU.

One thing I would like to clarify is that you mention the TI CC2540 a few times (actually, CC2541 is the newer version). Anyways, that chip is an IC level component. Unless you want to do the antenna design and put it through FCC intentional radiator certification (the certs are between 1k-10k usually - and I'm assuming you're in the US when I say FCC).

What I think you're looking for is a ready-made, certified module. For example, the BLE113 from Bluegiga is an FCC certified module which contains the CC2541 internally (plus some bells and whistles). That one specifically also has an interpreted language called BGScript to speed up development. It's great for very simple applications - and has nice, baked in low-power modes.

So, the BLE113 is an example of a module that can be used with/without an external MCU depending on application complexity.

If you're willing to go through FCC intentional radiator certification, then the TI CC2541 is common, as well as the Nordic NRF51822 (this chip has a built in ARM core that you can program on as well, so you don't need an external MCU).

An example of a BLE module which requires an external MCU would be the Bobcats (AMS001) from AckMe. They have a BLE stack running on the chip which communicates to an external MCU using UART.

As with a comment above, if you need iOS compatibility, using a Bluetooth 2.1 (BT Classic) is a huge pain due to the MFI program (which I have gone through - pure misery). So, unless REALLY necessary, I would stick with BT Classic and Android/PC.

Some sample BT classic chips might be the Roving Networks RN42, the AmpedRF BT 33 (or 43 or 53). If you're interested, I did a throughput test on iOS devices with a Bluetooth classic device (https://stackoverflow.com/a/22441949/992509)

How the pairing and data sending should be like for power saving? Are buttons useful to facilitate the sleep mode and active pairing and data sending mode for power saving?

If the radio is only on every week or month when the operator is pulling data down, there's very little to do other than to put the BT module into reset mode to ensure there is no power used. BT Classic tends to use more power during transfer, but if you're streaming data constantly, the differences can be minimal if you choose the right modules (e.g. lower throughput on BLE for a longer period of time, vs higher throughput on BT 2.1 for less time - it works itself out in the wash).

The one thing I would do here is to have a button trigger the ability to pair to the BT modules, because that way they're not always on and advertising, and are just asleep or in reset.

How the authentication should be done? Only operators are allowed but he can use any laptops/phones.

Again, not knowing the environment, this can be tricky. If it's in a secure environment, that should be enough (e.g. behind locked doors that you need to be inside to press a button to wake up the BT module).

Otherwise, at a bare minimum, have the standard BT pairing code enabled, rather than allowing anyone to pair. Additionally, you could bake extra authentication and security in (e.g. you can't download data without a passcode or something).

If you wanted to get really crazy, you could encrypt the data (this might involve using Linux though) and make sure only trusted people had decryption keys.

Community
  • 1
  • 1
SJoshi
  • 1,866
  • 24
  • 47
2

We use both protocols on different products.

Bluetooth 4.0 BLE aka Smart

  • low battery consumption
  • low data rates (I came up to 20 bytes each 40 ms. As I remember apple's minimum interval is 18 ms and other handset makers adapted that interval)
  • you have to use Bluetooth's characteristics mechanism
  • you have to implement chaining if your data packages are longer
  • great distances 20-100m
  • new technology with a lot of awful premature implementations. Getting better slowly.
  • we used a chip from Bluegiga that allowed a script language for programming. But still many limitations and bugs are build in.
  • we had a greater learning curve to implement BLE than using 2.1

Bluetooth 2.1

  • good for high data rates depending on used baud rate. The bottle neck here was the buffer in the controller.
  • weak distances 2-10 m
  • Its much easier to stream data

Did not notice a big time difference in pairing and connecting with both technologies.

Here are two examples of devices which clearly demand either 2.1 or BLE. Maybe your use case is closer to one of those examples:

  • Humidity sensors attached to trees in a Forrest. Each week the ranger walks through the Forrest and collects the data.
  • Wireless stereo headsets
OneWorld
  • 17,512
  • 21
  • 86
  • 136