Implementing Sensor Modules

By European Editors

Contributed By Digi-Key's European Editors

The Internet of Things (IoT) promises to enable many new applications and services for consumers and businesses. While as consumers we are slowly starting to see the IoT enter our homes, many experts believe the sectors that will benefit the most are those in manufacturing, where the phrase Industrial Internet of Things (IIoT) has become popular. Like any IoT-based application, it will come down to the army of often remote sensors and actuators to bring the IIoT to life. The IIoT will yield data visibility of manufacturing and process operations on a scale never previously possible. In addition, it will show the efficiency and performance of equipment used for manufacturing, where implementing a predictive maintenance regime is a perfect match. While the sensors used for such applications might be simple, small, passive and/or semiconductor components, the industrial environment in which they need to function is subject to extremes of temperature, vibration and moisture. The need to quickly deploy sensors and edge node devices that can operate in these conditions has many IoT developers adopting a module-based approach to integrating sensors into their designs. 

There are several reasons for using a module considering the challenges associated with using a discrete approach. For example, measuring temperature can be achieved by a negative temperature coefficient (NTC) thermistor connected in series with a resistor to produce a junction voltage that varies with ambient temperature. The resulting junction voltage could then be read by an analog to digital converter (ADC) of the host microcontroller, and a formula used to calculate the temperature. However, the temperature/resistance characteristic of NTC thermistors is not linear, requiring a best fit linearization across the operating temperature range. There is also the matter of temperature compensation and drift characteristics that need to be applied. This additional processing performed by the host microcontroller demands more MCU resources, and requires each end sensor device be calibrated during manufacture. Another major consideration is the packaging used to encapsulate the NTC resistor to ensure that the necessary components are protected from environmental factors.

Image of Sensirion SHT35 temperature and humidity sensor

Figure 1: SHT35 temperature and humidity sensor.

In contrast is a temperature module, an example being the SHT35 digital temperature and humidity sensor from Sensirion (Figure 1). This surface mount low-power device measures just 2.5 x 2.5 x 0.9 mm, operates on a supply voltage between 2.4 and 5.5 VDC, draws just 800 µA during measurement, and as low as 0.2 µA during sleep. Enclosed within this miniature package is a capacitive sensor for measuring humidity and a band-gap sensor for the temperature. The sensor can measure from -40 to +125°C, and from 0 to +100% relative humidity. Providing a fully calibrated digital output, the sensor elements are connected to signal processing circuitry and a 14-bit ADC that has a temperature accuracy of +/- 0.3°C, and +/- 2% relative humidity.

Diagram of Sensirion SHT35 communication to host microcontroller

Figure 2: SHT35 communication to host microcontroller.

Communication to a host microcontroller is illustrated in Figure 2. This is achieved via an I2C serial interface with the minimal addition of pull-up resistors and a decoupling capacitor. Measuring temperature and humidity takes place using commands as indicated in Figure 3. Once the sensor data has been read, it is transmitted as two bytes plus a single byte CRC checksum (grey blocks).

Image of Sensirion SHT3x single shot mode measurement commands

Figure 3: SHT3x single shot mode measurement commands.

To aid prototyping a sensor design using the SHT3x series, a breakout-style evaluation board is available. Manufactured by Adafruit, the board allows quick and easy connection of the sensor to an Arduino or compatible platform. A detailed guide to interfacing to the SHT3x together with Arduino Sketch code examples can be found here.

Another example of a digital temperature and humidity sensor is the Bosch BME280. This is a fully-enclosed LGA packaged device with a metal lid that also contains an absolute barometric air pressure sensor. With its low power consumption profile and extremely compact dimensions, the BME280 is suited for use in a wide range of battery-powered portable applications, from industrial automation controls through to personal fitness monitors. Figure 4 illustrates the functional block diagram of the BME280.

Functional block diagram of Bosch BME280 sensor

Figure 4: Functional block diagram of Bosch BME280 combined humidity, pressure and temperature sensor.

The sensor analog and digital blocks can be supplied from a DC supply in the range of 1.7 to 3.6 V, and a separate digital interface supply in the range of 1.2 to 3.6 V depending on the application requirements. Both SPI and I2C interfaces are supported, and the sensor can operate in three different power modes. The host MCU can trigger measurements, or the sensor can provide them automatically at a predetermined rate. Power consumption is as low as 0.1 µA in sleep, 0.2 µA in standby, and up to a maximum of 714 µA during pressure measurement. The three sensor operating modes are those of sleep, forced and normal. During the default startup mode of sleep, there is no ADC operation and all registers are accessible.

Diagram of Bosch BME280 sensor mode transition

Figure 5: BME280 sensor mode transition diagram.

The forced mode is invoked through an SPI or I2C request from the host microcontroller and results in one measurement being made. The results are stored and the sensor returns to sleep. In normal mode there is a continuous cycle of measurements being made, results are stored, and the sensor returns to sleep.

The data sheet on the BME280 gives a detailed explanation of the operating modes, serial communication and how to access the measurement result registers. This document also provides some recommended sensor setup profiles for different application use cases, ranging from weather monitoring to gaming. These provide an optimal balance of power saving, sampling rate, noise filtering and data output rate for a variety of different applications.

Engineers wishing to prototype a design based around the BME280 are recommended to try the Adafruit BME280 sensor breakout board, shown in Figure 6.

Image of Adafruit BME280 combined sensor breakout board

Figure 6: Adafruit BME280 combined sensor breakout board.

Adafruit provides a detailed guide to working with the sensor, downloadable here. The guide includes interfacing to an Arduino UNO or compatible single board computer in addition to providing links to an Arduino BME280 library available from Adafruit’s GitHub repository. Figure 7 shows a code snippet from the BME280 test sketch provided with the library. This highlights the assignment of the SPI pin connections to the Arduino at the top of the image, and how simple using the library makes reading values at the bottom of the image.

Code snippet from Adafruit BME280 test sketch

Figure 7: Code snippet from Adafruit BME280 test sketch.

Differential pressure sensors are another type commonly found in many industrial applications such as gas boilers, fuel cells and HVAC systems. An example is the Sensirion SDP8xx family, designed to measure the pressure of air or non-aggressive gases in high volume applications. The SDP810 sensor is a digital differential pressure sensor that can measure a pressure range of +/- 500 Pa with an accuracy of 0.1 Pa. Communication with a host MCU is via an I2C interface. A functional block diagram and image of the sensor is shown in Figure 8.

Block diagram and image of Sensirion SDP810

Figure 8: Sensirion SDP810 block diagram and image.

Differential pressure sensors can be used to measure the rate of flow of a gas, as illustrated in Figure 9. In this example, the bypass flow is used to calculate the flow through the main passage or pipe. The measurement can be reported as a volume flow (l/min) or a mass flow (standard cubic centimeters per minute). This later case is typically used in heating applications where the reference point is at a certain temperature and pressure.

Diagram of Sensirion flow measurement with differential pressure sensor

Figure 9: Flow measurement with differential pressure sensor.

Like the BME280 sensor, the SDP810 can operate in either a triggered or continuous run mode. A simple protocol is used to structure the command sequences over the I2C bus. A version of the SDP810 sensor, the SDP816, is also available that provides an analog output. The analog output can be configured to be a linear relationship to the differential pressure, or as a square root conversion.


This article has covered just a small selection of sensor modules designed for a wide variety of industrial applications. Rather than dealing with the challenges presented by a discrete approach, designing in a digital sensor module can save the development team a considerable amount of time and effort.

Digi-Key Electronics logo

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.