What is Bluetooth Low Energy?
BLE is hot lately. Everyone is designing some product with a BLE interface. So why? Because BLE is a great way to connect cell phones with your product. Considering that 80% of all humans will soon be clutching a smart phone, BLE is a great way to connect them with your products. If you want to learn more about the basics of BLE download this workshop presentation. I taught this course to about fifty engineers last quarter. It got great reviews. Email me if you want to take the class.
Cypress has a great $49 BLE development kit CY8CKIT-042 BLE. We literally can’t keep enough of these things in stock. I use it to develop customer demos and teach classes. Yes, lots of silicon companies have a BLE development kit, but what makes this one so easy to use is PSOC Creator. Our BLE stack is encapsulated in a graphical drag and drop interface. You can easily configure complete custom BLE profile in a few minutes. Why does this matter? BLE has a list of standard profiles, but not everyone is developing a heart rate monitor or iBeacon. In fact, practically everybody needs a custom BLE profile. It turns out they are hard to develop in other tools, but easy with PSOC Creator. Here is a custom profile example I taught at my last BLE class. It reads a capacitive slider on the kit and sends position data to a smart phone. It also takes input from the phone via a GUI and sets RGB led colors on the board. The phone GUI is CySmart, for Android or Apple.
Many BLE customers are interested in a UART BLE bridge. Just UART in one side, a BLE link and UART on the other side. In other words, a simple wireless wire. Here is a BLE UART example project for the CY8CKIT-042 BLE. You need two kits to run it. Data rate is ~100 Kbps, but I was limited by the USB-UART driver for the kit. Windows only allows 115 Kbps. I believe the actual BLE link will handle 200 Kbps according to tests by other FAEs. My test transferred the text of Caesars Gallic War (De Bello Gallico) from one kit to the other.
BLE Mesh Network
So here is something very interesting. Many customers are also asking “can I do a mesh network on BLE”? The answer is yes. This project configures CY8CKIT-042 BLE as a mesh network node. Data from one node flood fills to all the others. I have not dug into the packet structure etc.yet. This is another example of how engineers are coming up with new and useful use cases for BLE networking.
I2C over BLE
In the continuing theme of customers doing unnatural things with BLE here is the latest request, an I2C over BLE project. Runs on the CY8CKIT-042 BLE. Full instructions are in the ZIP file. One kit is programmed as “central” the other as “peripheral”. Just program in the hex files and give it a try.
Getting government certifications to ship an RF product in USA, Canada, Europe, Japan and Korea can be expensive. And not a whole lot of fun. Cypress has developed a product to address the issue. CYBLE-022001-00 is BLE module with complete FCC, IC, MIC, KC and CE certification. It comes in a very small 10×10 mm surface mount form factor. No external components are required. Even the antenna is on the module. This is already a very popular product with customers, and it has not even been officially released. The datasheet requires an NDA. If you’d like more information contact me via
BLE IOT Sensor and Win10 Host App
The most common question I get is for a simple IOT sensor example. This post shows how to easily set up a BLE device which broadcasts the state of an input pin in its advertisement data. You can use it to show data from passive IR sensor, switch, light sensor or anything else. I also include a C# example to read this data using the BLE host on any Win10 laptop. It’s a very neat demo.
First thing you need is an IOT device. We’re going to use a PSOC BLE development kit: CY8CKIT-042 BLE. You can buy it direct from Cypress, at Mouser or DigiKey. Next thing you need is PSOC Creator. It’s a free integrated development environment from Cypress. Don’t let the “free” fool you though. Creator is highly sophisticated, easy to use and makes BLE development easy. Here’s an example of configuring BLE inside Creator.
Next thing you need is the Creator project. Download it from here, unzip, open with PSOC Creator and program your CY8CKIT-042 BLE. It will start advertising as “BLE Sensor v3”. Data from pin p1.0 on the kit is populated in BLE advertising data with service UUID 0xAAAA. You can verify this with any smartphone application which shows BLE advertisement data.
Finally, you need a Win10 application to view the BLE data. Download here. I used the Microsoft “BLE Watcher” console application, fixed up some references and modified it to read the 0xAAAA service data. You will need to download and install Visual Studio Community from Microsoft here to modify the source code. Otherwise, just run the executable. The console application uses Microsoft API calls to access the BLE host on your laptop, then displays data it receives as shown below.
That’s it. Now you have a working IOT BLE sensor and host application. Connect anything wirelessly to your PC or even the internet.