With deployment of IoT is spreading across various domains and applications, the requirements of the underlying communication mechanism varies. There is no one-size-fill-all solution as the needs are different in case of throughput, range, power consumption etc. There are many wireless communication technologies, such as Short-range wireless, Cellular, LPWAN etc.

LPWAN stands for Low Power Wide Area Network, designed for sending small data packages over long distances. While short range technologies like Bluetooth, Wi-Fi, Zigbee are cheap, it is limited by distance, cellular technologies like 3G, 4G and 5G have more transmission rate and range but are more costly and high power consuming. LPWAN has overcome the cons of existing wireless technology by compromising on the data rate and featuring the long-range data transmission, low power consumption and being economical. Some of the technologies that comes under LPWAN includes Narrowband IoT (NB-IoT), Sigfox, LoRa and others.

Heterogeneous Wireless communication Technologies
Heterogeneous Wireless communication Technologies

Of these LPWAN, LoRa has a significant market share and finds application across use cases.

Following are key features of LoRa Technology,

  • It has very wide coverage range about 5 km in urban areas and 15 km in suburban areas
  • Battery lifetime up to 15 years
  • One LoRa gateway takes care of thousands of nodes.
  • Easy to deploy and low cost.
  • Enhanced the secure data transmission by embedded end-to-end AES128 encryption

In this blog, we will cover the underlying technology behind LoRa and its network topology.

LoRa Technology

LoRa is a long range, low power, inexpensive technology for Internet of Things (IoT) developed by a company called Cycleo, France in 2009, later acquired by Semtech in 2012. The LoRa radio and modulation part is patented and its source is closed. Semtech has licensed its LoRa intellectual property to other chip manufacturers. The LoRa Alliance, an open, non-profit association has been formed to promote the adoption of this technology and has grown to more than 500 members since its inception in March 2015.

The most important aspect of the LoRa is that it uses license-free sub-gigahertz radio frequency ISM bands in the deployed region such as 868 MHz in Europe and 915MHz in North America. Thus, there is no need for a separate licensing for using LoRa in any country.

Usually in digital communication, there are three types of basic modulation techniques such as

Amplitude Shift Keying, Frequency Shift Keying and Phase Shift Keying, in which either amplitude or frequency or phase of the carrier varies according to the digital signal changes. The short coming with these approaches is that since the bandwidth is quiet limited the signal is quiet prone to interference and could be easily jammed. To over come this, spread spectrum techniques are being used where by the signal is modulated such that it is spread across the entire bandwidth. There are many spread spectrum techniques such as DSSS, FHSS, THSS, CSS etc.

Upchirp and Downchirp Pulse
Upchirp and Downchirp Pulse

Chirp Spread Spectrum

LoRa is a proprietary spread spectrum modulation scheme that is based on Chirp Spread Spectrum modulation (CSS). Chirp Spread Spectrum is a spread spectrum technique that uses wideband linear frequency modulated chirp pulses to encode information. A chirp is a sinusoidal signal whose frequency increases(up chirp) or decreases(down chirp) over time across the entire bandwidth. This signal is used as the carrier and is modulated according to the data to be transmitted.

LoRa uses three bandwidths: 125kHz, 250kHz and 500kHz. The chirp uses the entire bandwidth and the spreading factors are – in short – the duration of the chirp. LoRa operates with spread factors from 7 to 12. This delivers orthogonal transmissions at different data rates. Moreover it provides processing gain and hence transmitter output power can be reduced with same RF link budget and will increase battery life.

LoRa WAN

While LoRa is the underlying physical part, LoRaWAN is the network on which that LoRa operates. It is a media access control (MAC) in the data link layer that is maintained by the LoRa Alliance. LoRaWAN defines a set of rules and software that ensures data arrives with an acknowledgement and does not have duplicate packets. It is a network architecture that is deployed in a star topology and so the communication between the end node and gateway is bidirectional.

LoRaWAN defines role of end points and gateway. End points or End nodes are the remote nodes typically housing the sensors/actuators. Gateways or Concentrators forms the heart of the star topology, to which the end points communicate to.

LoraWAN Architecture
LoraWAN Architecture

Lora WAN Network Architecture

When an end node transmits data to the gateway, it is called an uplink. When the gateway transmits data to the end node, it is called a downlink. The gateways forward this packet to the network server. The network server collects the messages from all gateways and filters out the duplicate data and determines the gateway that has the best reception. The network server forwards the packet to the correct application server where the end user can process the sensor data. Optionally the application server can send a response back to the end node. When a response is sent, the network server receives the response and determines which gateway to use to broadcast the response back to the end node.

The LoRaWAN protocol defines the Adaptive Data Rate (ADR) scheme to control the uplink transmission parameters of LoRa devices. Whether the ADR functionality will be used is requested by the end nodes by setting the ADR flag in the uplink message. If the ADR flag is set, the network server can control the end node’s transmission parameters. ADR should only be used in stable Radio Frequency (RF) situations where end nodes do not move. Mobile end nodes which are stationary for longer times can enable ADR during those times.

This blog introduced the basics behind LoRa technology including the underlying communication techniques and network topology. In the next blog, we will cover the communication model in more detail including the classes, bands and also the typical configuration available in a gateway.

About Embien: Embien Technologies is a proven enabler in adoption of IoT. We have been working with different communication technologies such as ZigBee, BLE, SigFox, LoRa, NB-IoT and have designed gateways to inter-operate between them. Our services include end device development, gateways design, cloud application development and analytics.

In the past, electronic devices in vehicles are connected via point to point wiring systems. Automotive manufacturers started using more and more electronics in vehicle, which resulted in bulky wire harnesses that were heavier and expensive too. Then they introduced a specialized internal communication network called vehicle bus that interconnects electronic devices inside a vehicle. Vehicle bus reduced the wiring cost, weight and complexity.

At present there are several types of network types and protocols used in vehicles by various manufacturers. Most common vehicle bus protocols includes,

  1. CAN
  2. LIN
  3. FlexRay
  4. MOST
  5. DC-BUS
  6. IEBUS
  7. J1850
  8. ISO 9141-1/-2
  9. D2B – Domestic Digital Bus
  10. VAN

Among the various bus protocols, CAN emerged as the standard in-vehicle network and it became the international standard known as ISO 11898. Bosch originally developed the Controlled Area Network (CAN) and it has been adopted by the automotive industry. Several higher level protocols have been standardized on CAN such as CANopen and DeviceNet which are commonly used for industrial communications. CAN is also adopted specifically for classes of vehicles such as J1939 for commercial vehicles and ISO11783 for agricultural vehicles.

In this blog, we will describe in detail about the CAN protocol as an in-vehicle network.

CAN Bus – Basics

CAN bus is an inexpensive, robust vehicle bus standard designed for multiple CAN device communications with one another without a host computer. CAN is also called as multi-master serial bus and the CAN devices on bus are referred to as nodes. Two or more nodes are required on the CAN network to communicate. All nodes are connected to each other via a two wire bus (CAN H and CAN L) and the wires are 120ohms nominal twisted pairs. Termination resistor commonly 120 ohms is must in each node in order to suppress the reflections as well as return the bus to its recessive or idle state.

Following is the block diagram of the CAN bus architecture,

CAN bus architecture
Architecture of CAN bus

Each node in the CAN bus requires the following

  1. Transceiver – It converts the data from the CAN controller to CAN bus levels and also converts the data from CAN bus levels to suitable level that the CAN controller uses.
  2. CAN controller – They are often an integral part of the microcontroller that handles framing, CRC etc.
  3. Microcontroller – It decides what the received messages mean and what messages it wants to transmit.

The transceiver drives or detects the dominant and recessive bits by the voltage difference between the CAN H and CAN L lines. The nominal dominant differential voltage is between 1.5V to 3V and recessive differential voltage is always 0V. CAN transceiver actively drives to the logical 0 (dominant bits) voltage level and the logical 1 (recessive bits) are passively returned to 0V by the termination resistor.  The idle state will always be in the recessive level (logical 1).

Individually, CAN H will always be driven towards supply voltage (VCC) and the CAN L towards 0V when transmitting a dominant (0). But in practical case, supply voltage (VCC) or 0V cannot be reached due to transceiver’s internal diode drop. CAN H/L will not be driven when transmitting a recessive (1) where the voltage will be maintained at VCC/2.

The following figure depicts the block diagram and real time capture of the CAN signals.

Voltage level of CAN bus lines
CAN Bus – Voltage Levels
Capture of CAN bus signals using DSO
Real time capture of CAN bus signals

CAN Physical Layers – Types

CAN has different physical layers which classifies the certain aspects of the CAN network such as signaling scheme, cable impedance, maximum data rates, electrical levels, etc. Following are the most commonly used physical layers,

1. High Speed CAN

High speed CAN is implemented with two wires and allows communication at data rate up to 1Mbits/s. It is also named as ISO 11898-2. Antilock brake system, engine control modules, emission systems uses high speed CAN.

2. CAN FD

CAN with Flexible Data rate is the next generation of high speed CAN communication with improved standards for higher data rates. CAN FD overcome the bandwidth limitation problems by allowing data rates higher than 1Mbits/s while also increasing the support of payloads up to 64 bytes in a single message.

3. Low speed/fault-tolerant CAN

Low speed/fault tolerant CAN networks are also implemented with two wires and can communicate at a data rate of up to 125Kbits/s with fault tolerant capabilities. They are also named as ISO 11898-3 and found in devices where wires that have to pass through the doors of the vehicle which have light stress that is inherent to opening and closing a door.

4. Single wire CAN

Single wire CAN interface have lower data rate up to 33.3Kbits/s and also named as SAE-J2411. The devices that do not require high performance like seat and mirror adjuster use Single wire CAN interface.

Transceivers are available for each type of CAN physical layer and it is one of the important criteria while choosing the transceiver. Many semiconductor manufacturers provide CAN transceivers including NXP semiconductors, Texas instruments, STMicroelectronics, Maxim Integrated, Infineon Technologies and Linear Technology.

Apart from generic CAN transceivers, there are special purpose transceivers such as galvanically isolated transceivers that are used for providing the isolated interface between a CAN protocol controller and the CAN bus. For galvanic isolated design, there is a need for isolated power supply and hence the design becomes more complex and costlier.

Transceivers with option for direct interface with the microcontroller are also available which reduces the requirement of external buffer ICs for voltage compatibility.

CAN Terminologies

Following are some CAN bus terminologies that are useful to understand how CAN bus communication works. 

1. CAN Frame and fields descriptions

Devices in CAN network send data in packets called frames. Following image depicts frame format,

CAN Protocol frame format
Frame Format of CAN protocol

SoF – Start of Frame bit – indicates the beginning of a message with a dominant (logic 0) bit

Arbitration ID – identifies the message and indicates the message’s priority. Frames come in two formats — standard, which use an 11-bit arbitration ID, and extended, which uses a 29-bit arbitration ID

IDE – Identifier Extension bit – This bit allows differentiation between standard and extended frames

RTR – Remote Transmission Request bit – This bit is used to differentiate a remote frame from a data frame. A logic 0 (dominant bit) indicates a data frame. A logic 1 (recessive bit) indicates a remote frame

DLC – Data length code – It indicates the number of bytes the data field contains

Data Field – contains 0 to 8 bytes of data and up to 64 bytes of data for CAN-FD (Flexible Data rate)

CRC – Cyclic Redundancy Check – The CRC field is used for error detection. It contains 15-bit cyclic redundancy check code and a recessive delimiter bit.

ACK – Acknowledgement slot – any CAN controller that correctly receives the message sends an ACK bit at the end of the message. The transmitting node checks for the presence of the ACK bit on the bus and reattempts transmission if no acknowledge is detected

2. Bus Arbitration

Arbitration is the process in which two or more CAN controller agrees on who is to use the bus. It is of very important for the really available bandwidth for data transmission and this is the base for CAN bus communication. Arbitration process is performed over the arbitration ID.

3. Bit stuffing

Bit stuffing is a practice used to guarantee enough edges in the NRZ (Non-Return to Zero) bit stream to maintain synchronization. After five identical and consecutive bit levels have been transmitted, the transmitter will automatically inject (stuff) a bit of the opposite polarity into the bit stream. Receivers of the message will automatically delete (destuff) such bits. If any node detects six consecutive bits of the same level, a stuff error will be flagged.

How CAN Communication works?

As mentioned early, CAN is a Peer-to-Peer network in which there is no master that controls the transmission between nodes. When any CAN node is ready to transmit data, it should undergo a process called message arbitration. In this process, CAN node will check to see if the bus is idle and starts the transmission once it is idle. This will also trigger other CAN nodes in the bus and hence results in two or more nodes starting a message at a same time which results in a conflict. The conflict is resolved in the following methods,

  1. The transmitting node monitors the bus while they are sending data
  2. If any node detects a dominant level (logical 0) while sending a recessive level itself, it will fail in the arbitration process and quits immediately will start acting as a receiver.
  3. This arbitration process is performed while sending the arbitration ID field of the CAN frame and at the end, only one transmitter is left on the bus i.e. the node with the highest priority (lowest arbitration ID) will pass the arbitration.
  4. Then the node which has won the arbitration will continue message transmission as if nothing had happened.
  5. Other receiving node can decide if a message is relevant or if it should be filtered using a combination of hardware and software filters.
  6. This process is continuous and other nodes will transmit their messages when the bus has become available.
Bit Wise Arbitration process
CAN protocol – Bit Wise Arbitration

With this blog, we have covered all the basics of CAN communication including the physical layers, Data link as well as arbitration mechanisms. In the upcoming blog, we will explain more on software perspective about configuring a CAN controller for operation and handling message flow.

About Embien

Embien Technologies is a leading provider of product engineering services for the Automotive, Semi-conductor, Industrial, Consumer and Health Care segments. Embien has successfully executed many projects like Android based Auto infotainment system, GUI for TFT based instrument clusters, vehicle tracking devices, etc. Embien also offers a set of solutions such automotive grade BLE module (eStorm-B1), CAN to BLE gateway, CAN to RS232/RS485 gateway, LIN to BLE gateway, Sparklet GUI library that can be used to shorten automotive product development costs and time significantly.

As a continuation of our previous discussion about selection criteria of BLE SoC for building BLE based IoT devices, we will discuss in detail about the most important considerations for BLE RF layout design and antenna selection from various types available. The communication range of a wireless device with a current limited power source depends mainly on the RF layout, antenna design, and enclosure. Increased operating distance can be achieved with the type of antenna chosen together with carefully designed RF layout with few matching components to ensure most of the power from the BLE SoC reaches the antenna. The more power an antenna can transmit from the SoC, the larger the distance it can cover.

RF layout

RF layout involves routing the transmission lines from BLE SoC to antenna with few matching components in between. RF transmission lines acts as a medium that carry RF power from a BLE SoC to antenna, hence they need to be routed with many constraints to get maximum RF power delivery to antenna. There are several types of transmission lines, the two most popular types are:

  1. Microstrip Line
  2. Coplanar wave guide (CPWG)

Both of these are PCB traces differing in how they are constructed for maintaining the 50-ohm characteristic impedance. There are online calculators available which help us to calculate the impedance of the transmission based on our parameter input.

Microstrip Line – This type of transmission line has a signal trace on top of a substrate with a ground plane beneath the substrate. A microstrip line is simple to construct, simulate, and fabricate. The characteristic impedance of a Microstrip line depends on the following factors,

  1. Substrate height (H)
  2. Dielectric constant of the substrate (εr)
  3. Width of the trace (W)
  4. Thickness of the RF trace (T)

Transmission Line type

MicroStrip Line

CPWG – This is similar to the microstrip, but it has a copper pouring on either side of the RF trace with a gap between them. It provides better isolation for RF traces and a better EMI performance and makes it easier to support the grounding of matching components on an RF trace. The characteristic impedance of a CPWG depends on the following factors:

  1. Substrate height (H)
  2. Dielectric constant of the substrate (εr)
  3. Width of the trace (W)
  4. The gap between the trace and the adjacent ground fill (G)
  5. Thickness of the RF trace (T)

Transmission Line type

Coplanar Wave Guide

Nowadays the SoC manufacturers provide reference designs from which we get the guidelines for routing the RF transmission lines and the values (typically capacitance and inductance values) of the matching components. The designer in addition to the routing guidelines must also note the recommended PCB stackups for desired performances, since the impedance of the RF lines will change depending on the PCB layers stackups. In most of the cases, the PCB fabricator may not match the exact stackup as recommended and at these conditions there will be a need for slight changes in the RF trace width, gaps or thickness to ensure the correct impedance value.

Antenna Types

Antenna is a critical part of any wireless devices that transmits and receives electromagnetic radiation in free space. Antenna is nothing but a conductor exposed in space. When the length of a conductor is a certain multiple or ratio of the wavelength of the signal (λ) it behaves like an antenna and radiates the electrical energy into free space in the form of electromagnetic radiation of that frequency to free space. BLE device range requirement, costs and form factor are the main factors to be considered for choosing the antenna. For BLE applications (2.4GHz), most common types of PCB antennas are as follows,

  1. Wire antenna
  2. PCB Trace Antenna
  3. Chip antenna
  • Wire antenna: It is a piece of wire rise from PCB plane and protrudes to free space over a ground plane. Wire antenna produces best performance and RF range due to its dimension and better exposure. They can be in different forms such as straight wire, helix, loop, etc. A through-hole pad is sufficient to solder the wire antenna, thus saving the board dimension and hence low PCB cost.

Type of Wire antenna

Wire Antenna – Straight and Helix Type

  • PCB antenna: This is a copper trace drawn on the PCB. These antennas are inexpensive and easy to design, because they are a part of the PCB and provide good performance. Meandered trace, inverted F-trace is the most popular PCB antenna’s used in many designs. Meandered trace antenna is recommended for applications that require a minimum PCB area and Inverted F antenna is better compared to meandered antenna for radiation, but it requires space higher than meandered antenna. Main drawback of PCB antenna is that, it may require two or more revision to get expected range performance. This can be avoided by using the antenna design application notes and stack up recommended by the chip vendors carefully.

Types of PCB Antennas

PCB Antenna Types

  • Chip antenna: For applications where the PCB size is to be extremely small, chip antenna is a good choice. They are commercially off the shelf antennas that occupy very small PCB area and offers reasonable performance. But the disadvantage of chip antenna is the increased BoM and assembly cost since they are external components that need to be purchased and assembled. Also the chip antennas are very sensitive to RF ground clearance and the manufacturers RF ground clearance recommendations must be followed strictly.

Types of BLE Antenna

Chip Antenna

There are some applications which need antenna’s to be placed on or outside the enclosure for better reach. In such conditions, there are options for providing antenna connectors on board and extending the connection to the external antenna or other mating connector through shielded wire.

Types of external antenna connection

Antenna Connectors

  • U.FL connector: There are miniaturized RF connectors for high frequency signals. The male connectors are generally surface mounted and soldered directly to the PCB. The female connectors are crimped at one end of the shielded wire and the other end may be a PCB antenna or a mating connector such as SMA, MMCX, etc.

Type of antenna connector

U.FL Connectors

  • MMCX connector: These are Micro-Miniature Coaxial connector. They have a lock-snap mechanism which allows 360 degree rotation. It is comparatively better than U.FL in terms of insertion and removal lifetime and has over 10 times that of U.FL connectors. They are also available in surface mount package.

Type of MMCX connectors and cables

MMCX Connector

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.