Getting hands-on with Bluetooth 4.2 Low Energy

[ad_1]

Bluetooth 4.2 Low Energy (BLE) – AKA Bluetooth Smart – is becoming an increasingly attractive solution for designers thanks to its simplicity and low power consumption. Plus, it provides the added bonus of getting your products to market with far fewer legal hoops to jump through.

investigating bluetooth

In simple terms, BLE splits the 2.4GHz band into 40 channels – 37 data channels and 3 advertisement channels (pictured below). There are two players in a BLE connection – a central device and a peripheral device. The peripheral device advertises its presence on the advertising channels and central devices scan the advertising channels looking for peripherals to make a connection with.

Connections are exclusive, peripherals can only connect with one central device at a time, and so once a connection is made, the peripheral will stop advertising its presence.

Service discovery

Once connected, the central device will perform a service discovery to find out what data the peripheral has to offer. It receives a profile back which is essentially an envelope containing the types of data on offer.

BLE channelsThe Bluetooth Special Interest Group has defined a number of standard profiles for specific application types to aid interoperability and speed up development. These include heart rate, environmental sensing, glucose measurement and find-me (for lost keys etc.).

In this hands-on demo, I used a LattePanda (DFR0418) with Cypress USB dongle (CY5677) as the central device and a Sensirion smart Humigadget (SHT31) as the peripheral device and set about experimenting. LattePanda was selected because I wanted to try out a Windows 10 PC for under £100!

And we’re off!

With the hardware prepared, next to sort out the required software. The Cypress dongle requires free Cysmart software from Cypress. I also need to ensure the .NET Framework 3.5 is enabled for this software to run. Once installed, insert the dongle into a USB port and you’re ready to go.

Next, I need to run up the Cysmart software, ensuring the Sensirion sensor is active and advertising its presence on BLE, and then I can ‘Start Scan’ to find out what’s available to connect to. Along with a number of listed Bluetooth devices (probably phones) is the Smart Humigadget. Now I can select and see what this device is advertising, as well as which Bluetooth mode it is compatible with.

At this stage, I can connect to create an exclusive connection with the Humigadget. This stops it advertising itself and provides a full profile for the device. I can now click the ‘Pair’ button to pair my central device with the peripheral. Now the raw data is being received by the central device, although not in a human-usable format at this stage – it would need converting in the app to read out the data on a tablet or phone.

Dev Kit

Now that you’ve reached this stage, there is loads more to investigate from here. It’s a reasonably small jump to hooking up a BLE-enabled dev kit so you can develop your own Bluetooth Smart applications. With standard profiles, emphasis on low power consumption and design simplicity, there’s nothing to stop you getting started with BLE today.

Want to find out more? For step-by-step instructions, complete with screen grabs, read the full “What you can do in a day” blog post at DesignSpark.

Mark Gauntlett completed his degree in Electronic Engineering in 1991 and went on to work in real-time digital signal processing applications engineering, later moving into technical marketing as an applications engineer for RS Components.

See also: Interview – Making the BBC Micro:bit Bluetooth Smart

[ad_2]

Source link

Leave a Reply