Introduction
Adding short-range wireless connectivity like Bluetooth Low Energy (BLE) to an existing Long-range / LoRaWAN Application can be very useful for many use cases.
• Geo location
When GPS is not available, an indoor positioning solution can track objects and vehicles.
A BLE beacon (peripheral) is required for positioning and send a signal frequently. A BLE locator device (central) scan the Bluetooth activity around and transmit the location of the beacon via LoRaWAN to a network server. In general, the location of the beacon device is determined in the cloud by triangulation based on the signal strength of the BLE beacon. Outdoor positioning may be also possible using LoRa technology and TDoA (Time Difference of Arrival) technique if the end-node is covering by at least 3 LoRa Gateways with accurate time references (GPS inside).
• Manufacturing provisioning
Simplified the LoRaWAN end-node provisioning (OTAA/ABP keys exchange) and regional band selection using BLE for an easy wireless setup, calibration, diagnostics, parameters and software update via a smartphone or a tablet application.
• Local data collection / On-site Maintenance
With BLE, a LoRa IoT node become accessible to the user or the maintenance operator which can take control locally on the device with an App installed on his mobile.
• HMI replacement
To interact with the LoRaWAN end-node, an HMI device such as smartphone or tablet can replace obviously external interaction (button, display, etc.).
• No Wi-Fi or cellular service in-sight
Majority of BLE-based IoT applications use mobile phones as gateways to the cloud via its cellular connection. But in absence of a cellular or mobile phone, this is where LoRa comes in. LoRa and BLE perfectly complement each other in an IoT battery-powered network to extend its battery life and limiting de facto its maintenance. Together, BLE and LoRa provide the combination of short-range, inter-device communications and long-haul backhaul over distance and allow the implementation of an IoT networks in a much broader geographic area even with no Wi-Fi or cellular service in sight.
The purpose of this abstract is to demonstrate by simple example how to answer some of the use cases listed above by adding a Microchip ATBTLC1000ZR BLE solution to an existing LoRaWAN Application based on ATSAMR34 Xplained Pro board.
More information on these product could also be found here :
https://www.microchip.com/design-centers/wireless-connectivity/low-power-wide-area-networks/lora-technology/sam-r34-r35
http://www.microchip.com/ATBTLC1000-zr
Get a Microchip ATSAMR34 Xplained Pro evaluation kit
The ATSAMR34 Xplained Pro evaluation kit is a hardware platform used to evaluate the ATSAMR34 Low Power LoRa® Sub-GHz SiP. It is supported by Atmel Studio 7.0 IDE and a collection of sample codes are available from Advanced Software Framework (ASFv3) since the 3.44.0 release. The Xplained Pro MCU series evaluation kit includes an on-board Embedded Debugger (EDBG), and no external tools are necessary to program or debug the ATSAMR34. The kit offers a set of features that enable the user to get started with the ATSAMR34 Low Power LoRa® Sub-GHz SiP peripherals right away, and to understand how to integrate the device in your own design. The ATSAMR34 Xplained Pro kit contains the following items:
- One ATSAMR34 Xplained Pro
- One external antenna
https://www.microchip.com/DevelopmentTools/ProductDetails/dm320111
Get a Microchip ATBTLC1000ZR Xplained Pro evaluation kit
Microchip's ATBTLC1000ZR-XPRO Xplained Pro extension evaluation kit is used to evaluate the ATBTLC1000-ZR110CA BLE module. The ATBTLC1000-ZR110CA module is based on Microchip's industry – leading lowest power Bluetooth 5 certified SoC.
https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATBTLC1000ZR-XPRO
Get a RN4871 CLICK board
RN4871 click board carries the RN4871 Bluetooth® 5 certified low energy module from Microchip.
The click is designed to run on a 3.3V power supply. It uses ASCII Command Interface over UART for communication with target microcontroller, with additional functionality provided by the following pins on the mikroBUS™ line: RST, CS, and INT.
https://www.mikroe.com/rn4871-click
Software Installation
Note: ASFv3 is an MCU software library providing a large collection of embedded software for AVR® and SAM flash MCUs and Wireless devices. ASFv3 is configured by the ASF Wizard in Atmel Studio 7.0 (installed as an extension to Studio). ASFv3 is also available as a standalone (.zip) with the same content as Studio extension (https://www.microchip.com/mplab/avr-support/advanced-software-framework).
Important: Until the next Atmel Studio IDE release, you have to manually install the Device Part Pack for developing with SAMR34/R35 on Atmel Studio 7.0 IDE. (all products released in between IDE releases of Atmel Studio should be manually added by user to develop applications).
- Go to Tools -> Device Pack Manager
- Check for Updates
- Search for SAMR34 and click install
- Repeat the same for SAMR35
- Restart Atmel Studio 7.0 IDE
Hardware Setup with ATBTLC1000ZR-XPRO
To demonstrate LoRaWAN end-device Provisioning and Debugging over BLE by connecting SAMR34-Xpro and ATBTLC1000ZR-XPRO you do need also a FTDI TTL-232R-3V3 cable and follow the table and wiring below:
- In order to connect in LoRaWAN, you will need to be in range of your gateway. If you don’t have gateway, check the world map (https://www.thethingsnetwork.org/map) to see if your local community has gateway deployed around your location.
- Plug the antennas and always make sure you have the antennas plugged to your boards before powering it up.
- Connect the ATSAMR34-Xpro board to the PC through the micro-USB cables.
- USB cable must be connected to the EDBG USB connectors of the ATSAMR34 kit.
- The USB ports powers the board.
- Connect the FTDI cable the host PC. A COM port will be mounted. This port mounted will be used to communicate with the kit.
- Launch Tera Term program and configure the serial ports mounted with: 115200 bps, 8/N/1
Adding LoRaWAN provisioning & debugging over BLE with ATBTLC1000ZR
Based on LoRaWAN Mote Application generated from ASFv3, this sample code demonstrates how to provision & debug a LoRaWAN end-device over a BLE connection between a smartphone and a BTLC1000ZR module.
For more information on Microchip ATSAMR34 LoRa SiP and ATBTLC1000ZR Bluetooth 5 certified module, visit Microchip webpages:
https://www.microchip.com/design-centers/wireless-connectivity/low-power-wide-area-networks/lora-technology/sam-r34-r35
https://www.microchip.com/wwwproducts/en/ATBTLC1000-ZR
Follow the tutorial here:
https://github.com/MicrochipTech/atsamr34_btlc1000_lorawan_ble_provisioning
Adding LoRaWAN provisioning & debugging over BLE with RN4870/71 Module
https://github.com/gd91/atsamr34_rn487x_lorawan_ble