Main Content

This is a wireless sensors project that involves using LoRa and WiFi to extend the range of BLE sensors. In addition to building sensors and gateways, I also want to integrate the data into nice looking visualizations using open source tools like Grafana and InfluxDB.

There are a lot of wireless sensor projects out there. Many use an Arduino with a temperature sensor and RF module sending data to a MQTT gateway, then display that data on a phone app. Since the introduction of the ESP8266, there’s also been efforts to make this wifi module run as a battery powered sensor.
But these approaches often resulted in devices that weren’t immediately practical - either too big or not energy efficient enough. While there exists commercial wireless modules for Zigbee and Z-wave that can be made into small, battery powered sensors, these modules are often difficult to build with and involve complex development tools. They’re not for everyone. Size, cost, battery life, and development tool complexity continue to be challenges for open source DIY wireless sensors.
“Makability” requires a really weird coincidence of cheap hardware that’s the right size and development tools that aren’t a pain to work with. To put it simply, we need fun hardware and fun software. It’s a difficult combination to find, but I think I’ve come across something close.

This is a wireless sensors project, but with emphasis on

- small, practical sensors that you can make [BLE module from Nordic]
- inexpensive, accessible hardware
- nice looking dashboards and data integration [Grafana, Node-RED, OpenHAB]
- flexible wireless architecture to fit different situations [Bluetooth with Wifi or LoRa bridging]
- easy firmware development [mBED, Arduino]

I’ll start with this low cost Bluetooth module, the nRF51822, from Nordic Semiconductor. This BLE modules has been kind of under the radar, even though it’s available on ebay and Aliexpress for cheap. In the picture below, the left two modules are from Red Bear Labs and Nordic’s own Beacon development module. They’re kinda expensive to just play around with. But the rest in the picture are different variations of the same nRF51822 module with different number of I/O pins broken out. For reasons I don’t understand, ebay and Aliexpress distributors sell a few useful varieties these modules. The round “Button Beacon” has an integrated CR2032 battery holder and a button! Super useful for making “Amazon Buttons” to do just about anything you want. And that’s exactly what we’ll do.

In the following steps, I’ll detail how to build a series of small sensors and how to bridge these BLE (and LoRa) protocols to MQTT. Then take the data and display it in useful ways.
Some example sensors include

- open/close sensors for doors & windows
- temperature / humidity sensor
- dog food sensor (Did I forget to feed the dog? How much food is left?)
- simple button to do stuff (turn on lights, sent a text message, etc)
- beacon location (what area of the house does the cat hang out in during the day?)”

Link to article