Earlier, in a series of blogs on eStorm-B1 BLE module, we have discussed about few applications of the module such as smart metering, as a Bluetooth to serial adapter along with a demo of the same. Further to a very positive response to the module, Embien has come up with an Evaluation Kit for the same. Incorporating various features targeting different market segments, we have designed the EVK as a ready to use product. This blog will introduce the reader to the kit for eStorm-B1 BLE module and in detail its application as a BLE to RS232 MODBUS converter

RS232 Modbus serial interface 

RS232 serial interface is still one of the most used wired communication standards. Introduced in 1960, it has survived and still surviving onslaught from many advanced standards because of its reliability and simplicity. They are intended to operate over a distance up to 15 meters and the maximum data rate is around 160 Kbits per second. They are often being used in many applications such as data acquisition systems, PLCs etc. While the underlying logical layer can be handled by UART interface, there are many possible application layer protocols that can be run on it. One of the most popular industrial protocol standards is called Modbus.

Modbus is a serial communication protocol developed for transmitting information over serial lines between electronic devices. The Modbus network can have one Master device and up to 247 slave devices. The master device can request or write the information to the slave and the slave device will supply the information. Registers are allocated for each data in the slave device and the master will write or read data to and from a slave device’s register.

It is an open protocol, where the manufacturer can build into their equipment without any royalties. The protocol has multiple versions such as Modbus RTU, Modbus ASCII for serial communication and Modbus TCP for Ethernet. Modbus has become the standard communication protocol in industry and it is a commonly available means of connecting industrial electronic devices.

Need for Wireless Communication 

Day by day, the communication interfaces and protocols are being updated to handle large data more reliably and over a longer distance. Of late, due to the advent of Industry 4.0 and IIoT, the need for wireless communication becomes inevitable. Industry 4.0 brings smartness in automation and data exchange in manufacturing technologies. It includes IoT, cloud computing, etc which calls for seamless data communication. Existing infrastructure can enable them with minimal changes using wireless technologies. This necessitates a suitable gateway for converting the wired serial interfaces to wireless.

Embien, following the current industry trends has launched a wireless module “eStorm-B1” under its eStorm series of solutions. The BLE module can support wireless serial communication with the available UART interface and can readily be used as a BLE to UART converter bridge. In addition to the COTS BLE module, Embien has also launched an evaluation kit “eStorm-B1 EVK”. This evaluation kit can support quick evaluation of eStorm-B1 module features.

Following are the features of eStorm-B1 EVK,

  1. 1X RS232 or RS485 serial interface
  2. 1X CAN interface
  3. 1X LIN interface
  4. One analog input and one isolated digital input for external sensor interface
  5. One digital output for external load control
  6. Onboard EEPROM
  7. Onboard Accelerometer
  8. Battery operated with inbuilt battery charger
  9. Compact dimension with mounting holes
  10. Screw type PCB connectors for serial and CAN interface enabling rigid connection to external devices
Evaluation kit for eStorm-B1 BLE module

Evaluation Kit for eStorm-B1 BLE Module

eStorm-B1 EVK as Wireless Modbus gateway

Of various interfaces, one that interests us for this blog is the presence of a RS232 interface. eStorm-B1 EVK based BLE to RS232 Modbus converter is suited for wireless Modbus gateway applications discussed earlier. eStorm-B1 EVK supports three wire RS232 serial communication via null modem cable and is exposed via a screw type PCB Terminal connector. Designed for rugged industrial environments, the EVK can operate in 5V DC input and RS232 receiver can accept up to +/- 30V input withstanding surges up to 15-kV (HBM) in the RS232 lines. Optional enclosure is also available.

On the protocol front, it includes a fully tested Modbus Client stack. It can query Modbus slaves present in the line. Android application is also available that can be used to configure the device and acquire data. Some of the features supported by the eStorm-B1 EVK based Wireless Modbus Gateway are,

  • Configuration of baud rate, Stop and data bits.
  • Modbus RTC/ASCII support
  • Continuous data acquisition
  • Notification based on change of value
  • Customizable buttons in the App for simple configuration of Modbus slaves

Thus eStorm-B1 as a wireless Modbus gateway can be used to interface with multiple devices for applications such as wireless data acquisition via existing data acquisition device, controlling the machines via PLCs for various industrial automation application, etc.

About Embien

Embien Technologies is a leading provider of embedded design services for the industrial automation. We have done various types of Data acquisition Systems, Industrial Human Machine interfaces, BLE based pH Meters, precision measuring instruments etc. We are currently working on enabling the industry 4.0 initiatives to make them smarter and greener.

In a series of blogs on BLE, we have discussed in detail about the Bluetooth technology, its classifications, its popular variant BLE and various hardware design considerations such as SoC selection, RF layout and Antenna selection. These posts were primarily in perspective of hardware design.  Bringing up the software functionality is mostly straight forward as the stack is provided by the silicon vendor and will run with little or no modifications. But improving and optimizing the performance is a different story altogether. In this series of blog, we will discuss about various parameters related to BLE operations and important considerations while working with BLE devices.

To begin with, some of the important aspects of Bluetooth low energy communication are as follows,

  1. Advertisement interval
  2. Connection interval
  3. Slave latency
  4. Connection supervision timeout
  5. Data throughput

Understanding the above aspects will help any developer to lower the device power consumption, increase the speed of connection and improve the reliability of data transmission and reception.

In the following sections of this blog, we will discuss in detail about the BLE Advertisement process along with a practical example based on Embien’s eStorm-B1 Bluetooth Low Energy module by capturing the Advertisement packets using the nRF sniffer.

BLE Physical Layer

It is important to know about the BLE physical layer, such that we understand the BLE communication better, because physical layer includes the actual RF radio and is in charge of sending the signals over the air.

Bluetooth Low Energy is similar to classic Bluetooth where both of them use 2.4GHz spectrum but differ from each other with different modulation index. Classic Bluetooth uses 79 channels whereas BLE uses only 40 channels and are the channels of both are spaced differently. Due to this, the BLE and classic Bluetooth cannot communicate. But there are modules that can support both BLE and classic Bluetooth which operates by switching its modulation parameters and the channels.

The 2.4GHz spectrum of BLE is divided into 40 channels (0 to 39) which extend from 2402MHz to 2480 MHz with 2MHz spacing. Among the 40 channels, BLE advertisement takes place in 3 channels (37, 38 and 39) and data exchange takes place in remaining 37 channels.

The following image illustrates the channel layout of BLE with 3 advertising and 37 data channels.

Channel Layouts of BLE

BLE – Channel Layout

BLE Communication

BLE communication takes place between a “central device” (for example Android Smartphone or iPhone) and a “peripheral device” (for example eStorm-B1 BLE module). Any BLE communication can happen only with the following two modes,

  1. Advertisement mode
  2. Connection mode

BLE advertisement mode by default is uni-directional and will be initiated only by the peripheral device through sending advertisement packets. The peripheral device will broadcast advertisement to every device around it.

Connection can be initiated only by the central device (within the communication range of the peripheral device) to receive more information. Only in connection mode, both the peripheral and central device can send packets.

Connection cannot be done between two devices without using advertisements and central device cannot send any packets to peripheral device without a connection. 

BLE advertisement Interval

BLE peripheral device in advertisement mode will send advertisement packets periodically on each advertising channels (channel 37, channel 38 and channel 39) at a user defined interval called “Advertisement interval”. Setting advertising interval is the first and foremost task for any developer, since the value has great impact on the connection speed and power consumption. The advertising interval can be as short as 20 milliseconds or as long as 10.24 seconds.

In practical case, the time interval between the advertisement packets will have a fixed interval set by the user and a random interval between 0 millisecond to 10milliseconds. This random interval will be added automatically in order to avoid collision between advertisements of different devices.

Interval between BLE Advertising events

BLE Advertisement Interval

A short advertisement interval will enhance the central device to find the peripheral device quickly. On the other hand, due to frequent radio operation the power consumption becomes higher. So the developer should set a value balancing the speed and power consumption.

eStorm-B1 module – UART to BLE setup for capturing advertisement packets and interval

In this example, eStorm-B1 BLE module and PC communication is established via UART. UART interface is available in the module in TTL level and a UART to USB Bridge is used to connect the module with the PC via USB port. A windows console application “UART_BLE” is developed to simply the process of communications such as,

  1. Starting and stopping advertisements
  2. Transmit and receive data’s
  3. Set and get BLE RF parameters such as
    1. Transmit power
    2. Advertisement interval and
    3. Connection interval
  4. Enabling interrupts
  5. Get interrupt status

nRF Sniffer, a windows application from Nordic Semiconductor, together with Wireshark, is used for viewing the Bluetooth Low Energy communication between two devices using BLE. In this example, BLE advertisement packets sent from eStorm-B1 and the interval between two advertisements are sniffed.

The following images are the screen shots that depicts the advertisement interval of 5 seconds being set in eStorm-B1 BLE module via “UART_BLE”, a windows console application and the Wireshark capture done via nRF sniffer application for observing the advertising packets and interval.

UARTBLE Console application

Embien’s UARTBLE-Console application for eStorm-B1

 

Nordic Sniffer application for BLE

nRF BLE Sniffer Application

 

Wireshark capture of BLE Advertisement interval

BLE Advertisement interval – Wireshark Capture

 

BLE Tags and BLE Beacons

 BLE advertisements in general are of two types such as connectable advertisement or non-connectable advertisement. Connectable advertisement type is most common. It is not directed and it is connectable, which means a central device can connect to the peripheral that is advertising and it is not directed towards a particular central device. Non-connectable advertisement is a type used when the peripheral does not wants to accept connections and broadcast only the data in the form of advertisement.

BLE Advertisement is more popular due to its significance of broadcasting data along with the advertisement. The advertisement packets itself has suitable bytes dedicated for custom data which can be used by a developer to broad cast data. The typical application of the non-connectable advertisement is the BLE tags and beacons.

BLE tags are mainly used for asset tracking were the advertisement data broadcasted will help to track each device to which they are connected.

Beacons evolved with the introduction of Apple’s iBeacon, targeted for proximity market such as shopping malls, retail showrooms, etc. Also we have Google’s Eddystone as an alternative for iBeacon for Android platforms. In both these technologies the device will transmit very small bits of data via BLE advertisement.

Application of BLE Beacons

BLE Beacon – Applications

In this blog we have briefly discussed about the BLE communication, BLE advertisement and advertisement interval. In the fore coming series of blogs, we will discuss in detail about the BLE connection parameters such as connection interval, slave latency, etc.

About Embien

Embien Technologies is a leading provider of embedded design services for the Semi-conductor, Industrial, Consumer and Health Care segments. Embien has successfully executed many projects like based on IoT such as healthcare Wearables, Gateways, and Data Analytics etc. Embien also offers a set of wearable design collections complete with electronics, firmware and Cloud that can be used to shorten product development costs and time significantly.

With wide spread proliferation of low cost wireless technologies such as WiFi, BLE etc and smart phones, there is a need to provide such connectivity to systems across application domains. For example, nowadays wellness industry expects the products such as thread mills to communicate with user phones and provide details of the calories spent so far along with the running pattern.  While it might be possible to incorporate the wireless features in newer designs, there are many cases in which the existing systems need to provide these new features with minimal design changes due to reasons such as re-engineering complexity, costs etc.  This calls for Bluetooth to Serial Adapter that can be interfaced to existing systems over UART and enabling wireless connectivity easily with minimal changes.

In this blog, we will discuss in detail about such an application where by Embien’s eStorm-B1 platform is used as a Bluetooth UART module and performing BLE communication to an Android mobile app.

eStorm-B1 Bluetooth UART Module

Embien recently launched “eStorm-B1”, an automotive ready BLE module as a part of its eStorm offerings. The module supports many peripherals and interfaces such that it can be used as a standalone system or can embed in an existing system to enable BLE communication.

Of the available interfaces such as CAN, SPI, I2C etc, this particular demo uses UART as the choice of communication. For such application, eStorm-B1 will act as a slave module which can receive commands from the host processor via UART and do actions accordingly.

The following block diagram depicts the setup of eStorm-B1 as a UART to BLE bridge,

 Bluetooth to Serial adapter

eStorm-B1 – UART to BLE Bridge Setup

The host processor and the module are connected via TTL UART interface. Interrupt signal from eStorm-B1 can be routed to a digital input of the host processor with interrupt detect functionality such that the host processor is made aware of the connection event occurred between the devices. eStorm-B1 can operate in sleep mode where it consumes ultra low power and the module can be switched between active and sleep mode suitably when data transfer is required.

Bluetooth UART module communication

Based on a simple command set, the host processor can speak to the eStorm-B1 module and in turn communicate with another BLE device such as a smart phone, tablet or an IoT gateway.

The following picture illustrates the serial command sequence between the eStorm-B1 BLE module and host processor via UART,

UART to BLE command sequence

Serial Command Sequence

The following video shows the real time demo of eStorm-B1 UART to BLE bridge application typically applicable in many IoT device developments for enabling BLE communication on existing system.

To show case the same, instead of a host MCU, a PC is used and connected to the eStorm-B1 over an USB to UART bridge. PC is connected to eStorm-B1 module via UART interface using an external commercially available UART to USB converter. Tera term, a terminal emulator is used to transfer the data’s from Laptop to eStorm-B1 module via UART. On the other end, a custom Android application installed in Smartphone is used to receive and transmit the data via BLE. UART to BLE Bridge is suitable for various device designs such as wearable device in healthcare, key finder, tire pressure monitoring system in automotives, asset tracking in industries, etc.

Apart from the above mentioned features, the eStorm-B1 also supports rich peripheral options such as timers/PWM, ADCs, GPIO’s which adds more advantage for standalone system developments in various domain applications such as automotive, industrial, healthcare etc.

About Embien: Embien Technologies is a leading provider of embedded design services for the Semi-conductor, Industrial, Consumer and Health Care segments. Embien has successfully executed many projects for IoT product developments such as healthcare/wellness wearable’s, data acquisitions systems, Gateways, and Data Analytics platforms etc. Embien also offers a set of wearable design collections complete with electronics, firmware and Cloud that can be used to shorten product development costs and time significantly.