Design engineers are looking at new, low-cost, small and innovative sensing designs for their systems. Sensing applications typically require several analog and digital blocks, such as excitation circuits, an analog front end consisting of signal-conditioning and filtering circuitry, analog-to-digital conversion, digital signal processing and communication blocks. Figure 1 illustrates the basic building blocks of a sensing interface. 

Figure 1. Block diagram of a sensor interface

An integrated approach of analog and digital blocks into a single chip not only improves the performance but also enables a cost-effective solution. Such types of interfaces are known as smart sensor interfaces. Smart sensor interfaces are typically tailor made to fit an application. They often lack flexibility and functionality over a wide range of sensing applications. An ideal solution in such scenarios is to integrate sensing elements into a MCU, where the sensor and the software are customizable to suit different sensing applications.

Some sensors can exhibit variations in sensitivity due to temperature. These variations should be compensated by using internal software or hardware techniques. The basic requirement of an internally compensating sensor is a constant current source for excitation. A constant current source can act as an excitation source for the sensor, as well as for the compensation of sensor output for any temperature variations. Thus, the sensing interface should be capable of allowing multi-channel excitation by the constant current source, as shown in Figure 2. 

Figure 2. Block diagram of a low-cost smart sensor interface.

Some sensing applications, such as capacitive sensing, don’t require signal-conditioning circuitry and the sensor interface should be able to directly read the sensor outputs to the analog-to-digital converter (ADC). Above all, the sensor interface should be flexible to accommodate different sensors and signal-conditioning circuitry, if required.

A smart sensor interface integrated in to a microcontroller (MCU) helps the designers to develop in an integrated approach. These MCUs are designed for a wide range of sensing applications. All important functions, such as analog-to-digital conversion, communication, and an excitation source are integrated into a single chip. A multi-channel multiplexer and the ability to directly measure sensor outputs provide a flexible and integrated solution for sensing applications. The excitation source consists of a programmable constant current source that works in tandem with an ADC. A multi-channel multiplexer for sensor interfaces provides the flexibility for mapping the sensor output to ADC. The current source and the ADC use the same multiplexer for exciting the sensor and measuring its output. Figure 3 shows how the current source, ADC and multi-channel multiplexer provide a generic sensing interface. 

Figure 3. A generic sensing interface.

This type of sensing interface also provides low-cost and flexible sensing solutions. Some of the sensing applications are capacitive, humidity, temperature, pressure, liquid level, proximity, inductive and time measurement. This article will review some of the low-cost sensing solutions with this interface using a PIC microcontroller. One of the most widely used sensing applications is temperature sensing, since it can be used for calibrating other sensors over temperature. Figure 4 shows temperature sensing using a diode with a resolution of 1o°C temperature measurement.

1. Temperature Sensing

The forward voltage (VF) of a P-N junction, such as a diode, is an extension of the equation for the junction’s thermal voltage: where k is the Boltzmann constant (1.38 x 10-23 J K-1), T is the absolute junction temperature in Kelvin, q is the Electron charge (1.6 x 10-19°C), IF is the forward current applied to the diode, and is the diode’s characteristic saturation current (see Figure 4). 

Figure 4. Temperature sensing using a junction diode.

To implement this theory, all that is needed is to connect a regular junction diode to one of the MCU’s ADC pins (see Figure 1). The PIC microcontroller has a programmable constant current source called capacitance and time measurement Unit (CTMU). The analog-to-digital channel multiplexer is shared by the CTMU and the ADC. To perform a measurement, the multiplexer is configured to select the pin connected to the diode. The CTMU current source is then turned on, and an analog-to-digital conversion is performed on the channel. As shown in the equivalent circuit diagram, the diode is driven by the CTMU at IF. The resulting VF across the diode is measured by the ADC.

2. Capacitive Sensing

Capacitive sensors are useful in a wide range of sensing applications, such as those for liquid level, pressure and proximity. Capacitive sensors require an excitation source and a detection circuit for converting change in capacitance to voltage. In most capacitive sensing applications, it is more useful to know the relative change in capacitance than the absolute capacitance. For example, a touch-pad sensing design based upon a change in capacitance is shown in Figure 5.

Figure 5. Capacitive sensing using a capacitive touch pad.

The CTMU is used in capacitive touch applications by applying the constant current source of the CTMU to the capacitive touch pad. It is possible to sense a relative shift in capacitance by observing a change in voltage using the following equation:

V = (I x T)/C

• I is the constant current source of the CTMU
• T is a fixed period that the CTMU charges the capacitive touch circuit
• C is the capacitance of the touch circuit
• V is the voltage read by the A/D converter after the capacitive touch circuit is finished charging

Since the CTMU current source is constant (I), the voltage present on the capacitive touch sensor (V) relies on two variables - the amount of time the touch circuit is charged (T) and the capacitive size of the touch circuit (C). If the amount of time the touch circuit is charged is held constant, then changes in the capacitance of the touch circuit will ultimately affect the voltage that the circuit charges to in the fixed period. The ADC is used to read the voltage that the touch circuit is charged to with the CTMU. When the capacitance of a human finger is added to the touch sensor pad, the capacitance increases and the result is a lowering of the voltage seen by the ADC (since I and T are held constant).

3. Time-of-Flight Applications

For time measurement applications a cost effective approach is to have a time to amplitude converter (TAC). TAC is based on charging of a capacitor from a constant current source. The amount of charge accumulated in the capacitor is proportional to the time taken. Thus, finding out the voltage across the capacitor gives us the time. Then, an ADC in conjunction with a TAC can convert the analog signal to digital, paving the way for post processing of the digital result. Figure 6 shows the CTMU being controlled by external start and stop pulses.

Figure 6. Time measurement with external start and stop pulses.

This article presents emerging trends in low-cost smart-sensor applications. The smart-sensor interface blocks provide a flexible method to build a complete sensing solution. These configurable blocks allow more flexibility and functionality over wide range of sensing applications. This type of approach results in an ideal solution where the sensor and the software are customizable to suit different smart-sensing applications.