Introduction and preparation

Thanks to its low power characteristics and low development and purchasing costs, Bluetooth® Low Energy (BLE) technology continues to gain momentum. From a technical point of view, the low power characteristics of Bluetooth® Low Energy make it especially suitable for connectionless sensor applications that can be used in a broad range of wireless scenarios such as in medical, industrial or smart home markets.

Although Low Energy technology was introduced more than 10 years ago, many companies are still hesitant to substitute classic Bluetooth® BR/EDR (“Bluetooth Classic”) technology. This can be due to several reasons: Bluetooth® Classic is still the dominant wireless technology for short-range consumer applications such as headsets, speakers and mobile devices. The product development teams would have to extend their competencies to Bluetooth® Low Energy, which could require a lengthy changeover process. To make entering the exciting world of Bluetooth® Low Energy a little easier, just follow this step-by-step tutorial for an example of how to start your own developments.

For this tutorial, we will learn how to read out a sensor using Panasonic Industry’s PAN1781 Bluetooth® Low Energy module with an embedded microcontroller – and subsequently send its data wirelessly to a handheld device via an emulated serial port over Bluetooth® Low Energy. This is, as we will see, arguably the easiest way to send data without much effort. However, to fully exploit the possibilities of Bluetooth Low Energy, we will also devote a future article to the programming of custom GATT services. But let’s not get ahead of ourselves...

Concept of the application

  1. Scan for the PAN1781 with any device supported by Bluetooth Low Energy (for example, a modern smartphone).
  2. Connect your mobile phone with the PAN1781.
  3. The sensor is read out periodically every second by the PAN1781.
  4. The PAN1781 sends out the PM Sensor Values (0, PM2.5, PM10) to the connected smartphone.
  5. The sensor values are displayed on the smartphone.

Required Hardware

PAN1781 – BLE 5.1 Module

Panasonic’s PAN1781 is a Bluetooth 5.1 Low Energy RF Module based on the Nordic nRF52820 single-chip controller. The compact memory size coupled with a low deep-sleep current of 300nA makes the PAN1781 ideally suited for battery-powered IoT applications. The integrated Cortex M4 processor allows the PAN1781 to be used in standalone mode, thereby eliminating the need for an external processor. This is particularly advantageous in the global semiconductor crisis which makes it important to use the available material resources efficiently.

SoC

nRF52820

Technology

Bluetooth LE 5.1

Performance

64 MHz

Memory

256 kB Flash, 32 KB RAM

Interfaces

16 GPIOs shared with up to UART, 2x SPI, 2x I2C, USB 2.0

Voltage Range

1.7V to 5.5V

Temperature Range

-40°C to +85°C

Size

15.6 x 8.7 x 2 [mm]

SN-GCJA5 – PM Sensor

Panasonic Industry’s Particulate Matter (PM) sensor SN-GJA5  is reliably able to detect smoke, environmental dust and other unwanted dangerous pollutants in the air by providing three different diameters of particles: 1.0μg, 2.5μg and 10μg. SN-GCJA5 has an excellent accuracy and quick response based on laser scattering technology which surpasses LED-based concepts in several regards. The uncomplicated I²C & UART (TTL) connectivity makes it easy to use with microcontrollers.

Operating Voltage

5V

Indicatable Range

0μg/m3 – 2,000μg/m3

Interface

I2C or UART (TTL)

Operating temperature

-10°C to +60°C

Size

37 x 37 x 12 [mm]

Smartphone

In principle, any smartphone with Android or iOS can be used. For this tutorial, we will use an Android-based smartphone.

Required Software

Visual Studio Code (VS Code)

The VS Code is an open-source Integrated Development Environment (IDE) that gained popularity over the last few years thanks to its cross-platform possibilities and a massive amount of third-party extensions. For building and flashing PAN1781 and other Nordic-based devices the nRF Connect SDK Extension is needed for VS Studio Code. Detailed instructions can be found here:

Getting Started with nRF Connect for Visual Studio Code - Zephyr Project

The code for reading the sensor and sending out the data via BLE can be found on Panasonic Industry’s GitHub page:

panasonic-industry-europe/pan1781-sn-gcja5-BLE (github.com)

A detailed description of how to load the code base into VS Studio and flash it to the PAN1781 can be found in the README file that is included in the GitHub repository.

Finished installing the development environment and flashing the code to the PAN1781? Stay tuned for the second part and learn how to read out the sensor and how to send the respective data to a smartphone via Bluetooth®.

Learn more:

Bluetooth® Low Energy modules
Wireless Connectivity

Bluetooth® Low Energy modules

Bluetooth® Low Energy modules are optimized for low power consumption without loss of performance or range.
Particulate matter (PM) sensor, laser type
Sensors

Particulate matter (PM) sensor, laser type

High precision laser sensor to detect floating particle in the air.