The ease with which resistance can be measured, coupled with the large number of simple, low-cost devices whose resistance changes with other physical properties, accounts for the wide range of resistive sensing applications. These include measuring temperature, pressure, humidity, position, displacement, etc. using electro-mechanical devices like potentiometers or other transducers such as thermistors and piezo-resistive strain gauges.
Increasingly such applications are an integral part of more sophisticated electronic systems where the sensor may be just one of many inputs that a microcontroller (MCU) needs to monitor. Here it is important to recognize that the system should be focused on performing its main task or function and not distracted by the measurement process, until that input is required or necessary. This is particularly important for systems that spend a lot of time in stand-by or low-power modes and typically includes most battery-powered equipment but, in these energy-conscious times, the benefit of low power consumption is a valued feature in more and more product designs.
By considering several sensing applications, this article will look at how different types of resistive sensors operate and the measurement processes involved. In particular, the article will consider measurement methods pertinent to microcontroller-based systems where dedicated on-chip peripheral circuits allow sensors to be monitored autonomously, without waking the processor from a sleep mode.
Resistive sensing applications
Position or movement
One of the simplest resistive sensors is the potentiometer, which can be configured as either a linear or rotary device to measure position or movement. The traditional potentiometer is an electromechanical device that uses a wiper to contact a resistive track, with the resistance being measured between the wiper and one end of the track. In most cases, the resistance will vary in direct proportion to the wiper position, assuming that the track has a uniform cross-section. Hence:
Resistance = resistivity x length / cross-sectional area
Here, ‘resistivity’ is dependent on the track material and ‘length’ is the distance between the wiper and the end of the track, which may be along an arc for a rotary potentiometer. Tracks can also be configured with a taper to deliberately introduce a non-linear relationship between resistance and wiper position e.g. a logarithmic potentiometer is commonly used for volume control in audio applications. Other forms of potentiometer use more complex constructions and may serve more specialized purposes e.g. a multi-turn potentiometer can be made with a helical resistive element and, when operated by a reel of wire, becomes a string potentiometer (see figure 1) capable of measuring much larger distances than a simple slider potentiometer.
Figure 1. A string potentiometer
A widely used device for the electrical measurement of temperature is the thermistor, a word created from the descriptive term ‘thermal resistor’. The thermistor is a two terminal device whose resistance normally varies linearly with temperature over its specified operating range:
ΔR = k ΔT
Here k is the temperature coefficient of the thermistor material, which can be either positive (PTC) i.e. resistance increases with increasing temperature, or negative (NTC). Thermistors are generally made from ceramics or polymers but devices called resistive temperature detectors (RTD) using pure metals, such as platinum, operate in a similar manner but over a much wider temperature range. A disadvantage of RTDs is that accurate measurements require the use of a four-wire circuit. Some thermistors, normally PTC types, are deliberately designed to be non-linear such that their resistance rises suddenly at a certain temperature. These devices act as switches and fuses but can also be used as threshold sensors in a MCU-based temperature sensing applications e.g. reacting to critical oil or coolant temperatures in automotive engine management systems.
Strain gauges provide an inexpensive but sensitive and reliable means of measuring pressure. Strictly, a strain gauge measures force as a consequence of the deformation of a conducting element, resulting in a change in its resistance. However as force = pressure x area, then pressure applied to a diaphragm, for example, can readily be translated to a force bearing on a strain gauge. Metal foils strain gauges are simple devices formed from a long, thin conductive metal strip attached to an insulating flexible backing material. By arranging the conductor as a zigzagged series of parallel tracks, as shown in figure 2, the gauge is made more sensitive to force applied in one direction. The force stretches the track causing it to become longer and thinner, with both these effects resulting in an increase in the tracks electrical resistance.
Figure 2. A metal foil strain gauge
Another type of strain gauge, which also results in a change in resistance, is the piezo-resistor. Piezo-resistivity is a property of semiconductor materials, such as germanium, polycrystalline silicon and selectively doped single-crystal silicon, where its resistivity changes when mechanical stress is applied. This effect is much greater than the simple change in geometry achieved with a metal foil strain gauge, resulting in a much more sensitive device that has been extensively exploited in recent years using MEMS (micro-electromechanical systems) technology e.g. as used in GPS aircraft navigation equipment to precisely measure altitude.
As its name suggests, a photo-resistor, alternatively known as a light dependent resistor (LDR), is a device whose resistance changes with exposure to light. In the past, photo-resistors were used in applications ranging from camera light meters to controlling streetlights – today most designs are likely to use photodiodes or phototransistors. Like photo-resistors, when configured with a reverse biased p-n junction, these devices operate in a photoconductive mode i.e. their resistance decreases with increasing light intensity. Photodiodes with zero bias behave as photovoltaic (PV) devices, generating an output voltage in response to light exposure. PV solar cells are effectively just large area photodiodes.
Many applications for light sensors only require threshold detection, rather than an absolute measure of light intensity. So while a phototransistor is not truly a resistive sensor, its use to control the current flowing through a separate resistor, as shown in figure 3, falls within the remit of this discussion, particularly when we consider below the resistance measurement methods relevant to connecting sensors to microcontrollers.
Figure 3. Light sensor setup
Other resistive sensing applications
This article does not attempt to provide an exhaustive review of every type of resistive sensor or the many diverse applications. Sensors not specifically covered here range from highly specialized devices, such as anisotropic magneto-resistive (AMR) sensors used for measuring the earth’s magnetic field, through to those found in more everyday situations e.g. the resistive touchscreen interfaces found in many retail point of sale terminals. But, regardless of the technology or application the following measurement methods are applicable to all types of resistive sensors.
Resistance measurement methods and MCU interface
As an analog component, a resistive sensor is most readily measured by placing it in an electric circuit such as a voltage divider or a Wheatstone bridge. These circuits are shown in figure 4. In the potential divider circuit (left) the measured voltage VMEAS is used to calculate the sensor resistance RX (knowing VREF and R1). The Wheatstone bridge method requires R2 to be adjusted, in a precise and calibrated manner, until the voltage across the galvanometer Vg is ‘nulled’ (i.e. zero) at which point RX = R2.
Figure 4. Potential divider and Wheatstone bridge circuits for measuring resistance
The potential divider method is generally accurate enough for the majority of resistive sensing applications discussed above. This is fortunate as this circuit configuration readily lends itself to solutions that require the sensor to be connected to a microcontroller.
MCU connection with separate excitation and measurement pins
The two-pin connection shown in figure 5 directly implements a potential divider circuit, with a known-value, fixed resistor R1 in series with the resistive sensor device RX. The MCU supplies an excitation voltage VREF to the top of the divider chain and then samples the voltage VMEAS across the sensor. This excitation voltage is only applied for long enough to ensure a stable reading can be obtained. Some MCUs include on-chip ADCs but, for low-power sensing applications, an analog comparator and a simple DAC, either operating as a successive approximation ADC or simply providing threshold detection, may be a better option.
Figure 5. Two-pin resistive sensor measurement
Single-pin MCU sensor connection
Microcontroller interfaces are often highly configurable, allowing the possibility of using just a single pin to provide both the excitation voltage and measure the sensor output. Clearly these have to be sequential activities, which is why a capacitor is placed in parallel with the sensor, as shown in figure 6, to hold the excitation voltage while the pin switches from excitation to measurement mode. During the measurement phase the capacitor discharges through the sensor at a rate that is dependent on its resistance. This single-pin solution is particularly suited to go/no-go applications where a sensor is simply being used to monitor a threshold condition as illustrated in figure 7.
Figure 6. Single-pin resistive sensor measurement
Figure 7. Active and inactive sensor discharge curves
The Energy Micro solution for resistive sensing
Energy Micro’s EFM32 series of microcontrollers is highly optimized for ultra low power sensing applications. Its Low Energy Sensor Interface (LESENSE) operates with a low frequency clock, monitoring up to 16 sensors with an average current consumption of just 1.2?A, while leaving the MCU in a deep sleep mode. The device’s Peripheral Reflex System (PRS) then allows these low-energy peripherals to be configured using sequencer and decoder circuits to detect and evaluate a combination of sensor states and event patterns before waking the MCU. Figure 8 shows a light sensor application as one illustration of how designers can really take advantage of the EFM32 MCU’s features to maximize system performance while keeping energy consumption to the absolute minimum.
Figure 8. Light-sensing with the Energy Micro EFM32 MCU
This white paper was written by Anders Guldahl, Application Engineer at Energy Micro
P.O. Box 4633 Nydalen, N-0405 Oslo, Norway
Telephone: +47 23 00 98 00
Fax: +47 23 00 98 01