Resistor-Based Sensors

In this 4th and final installment on resistors in DC circuits we complete our discussion of the most commonly used electronic component, the resistor, with a look at resistor-based sensors.

At the end of the lesson we,ll take a look at some resistor-based sensors in the lab. The video is at the end of this post.

This class of devices varies their resistance in response to external stimuli such as temperature, light, strain, pressure, and moisture, among other things. Almost every item in nature has resistance, even you. For example, a polygraph (lie detector) test includes metal contact sensors that measure resistance between two points on your body to detect stress levels and moisture (perspiration) associated with the fight or flight physiological response.

We’re going to demonstrate this family of sensors by looking at three common and readily available examples; a thermistor, a photoresistor, and a flex/bend sensor.

Thermistors

A thermistor, varies its resistance based on temperature. Thermistors are available in many different resistance levels, sizes, and mounting styles.

Thermistors are available in a variety types, sizes, and mounting options

A thermistor’s resistance either increases with temperature (Positive Temperature Coefficient [PTC]) or decreases with temperature (Negative Temperature Coefficient [NTC]). Thermistor schematic symbols are similar to standard resistor symbols (there are both European and American standards) but add a bent line and a +t or -t to indicate the type, either PTC or NTC.

European and American standard symbols for PTC and NTC type thermistors

In addition to type, thermistors are identified by a resistance value. That value, 10kΩ or 150kΩ for example, is the resistance of the thermistor at approximately room temperature. Each thermistor has an associated table of values that correlates resistance to temperature across the operating range. Below is an example table for a 10kΩ NTC thermistor. Note that for an NTC type device the resistance decreases as temperature increases.

This conversion chart relates resistance to temperature for a 10k NTC thermistor – Note that for an NTC type thermistor resistance decreases as temperature increases

Thermistors are used in circuits just like other types of resistors. You can use them in a voltage divider (like we did with the potentiometer in the last lesson) to set maximum and minimum voltages. Since they are resistors they are subject to Ohm’s and Kirchhoff’s Laws.

Thermistor Circuit Example

In the example circuit below, we can read the voltage at the terminal with a microcontroller’s Analog to Digital Converter (ADC) and then use a lookup table to convert the sensed voltage to a temperature. The microcontroller has a maximum input voltage of 3.3V on its ADC input. Any voltage higher than that destroys the microcontroller. We have a 5V supply so we have to use the thermistor in a voltage divider circuit to limit the maximum voltage at the ADC input.

Let’s use a 10kΩ NTC thermistor and assume the maximum and minimum temperatures are between -20F and 130F. That means the maximum  resistance of the thermistor will be 165,251Ω and the minimum resistance will be 3,049Ω. In this case, we need to limit the maximum voltage which occurs at the maximum resistance. That’s the value we’ll use in our calculations.

We’ll use a voltage divider circuit to limit the maximum voltage seen at the input of the ADC

We know that the maximum voltage across the thermistor needs to be 3.3V. Applying Kirchhoff’s Voltage Law we find that the voltage across R1 = 5V – 3.3V = 1.7V when TR1 is at maximum resistance.

Now let’s calculate the current through TR1. I = V/R = 3.3V/165,251Ω = 0.00001997A. Microcontroller ADCs draw extremely low current. So we can ignore it even at these low current values. Based on that, we assume the current through R1 is the same as the current through TR1. To calculate R1 we use Ohm’s Law. R = V/I = 1.7V/0.00001997A = 85,127Ω, or, approximately 86kΩ. Since 86kΩ is not standard, we’ll use 86.6kΩ which is a standard 1% tolerance resistor value.

Photoresistors

A photoresistor , also called a Light Dependent Resistor (LDR) varies its resistance based on the amount of light striking the sensor.They are available in a variety of shapes, sizes, resistances, wavelength sensitivities, and mounting styles. Every photoresistor has a window or clear port so that light can reach the sensing material which is often Cadmium Sulfide (CdS) based.

The schematic symbol for a photoresistor, both the American and European standard, is shown below. The symbol is the standard resistor symbol with a circle drawn around the device and two arrows that represent light striking the sensor.

Photoresistors come in various sizes and styles – They all need a clear port or window to allow light to strike the sensor

Photoresistors are used in a wide variety of applications. For example, many streetlights, as well as home nightlights, are controlled by a photoresistor. You can use a photoresistor to make a “refrigerator door open alarm” or to alert you that the house lights are on. They are also used in alarm clocks and other consumer electronics where display brightness is automatically adjusted based on ambient light. Photoresistors are useful any time you need to detect the presence or the absence, of light. They can also detect the quantity (level) of light striking the sensor.

Photoresistors exhibit a behavior called photoconductivity. The resistance decreases with increasing light levels. The more light striking the sensor, the lower the resistance.

Two interesting characteristics of photoresistors are wavelength dependency and latency. All photoresistors have a particular wavelength of light (measured in nanometers) to which they are most sensitive. photoresistors that are sensitive to visible light are less sensitive to infrared light and vice versa. All photoresistors exhibit latency (measured in milliseconds). They take time to respond to changes in light levels. An instantaneous change in the light striking the sensor won’t result in an instantaneous change in resistance. The resistance changes gradually until it eventually reaches the appropriate value. You can see some example photoresistor specifications in the table below.

Specifications for an assortment of photoresistors I recently purchased from Amazon Prime

Photoresistor Circuit Example

Let’s look at an example of a photoresistor in a circuit. We’ll use a GL5506 photoresistor. Lab testing shows that the GL5506 resistance varies from 200Ω in bright light to 12kΩ in complete darkness. Here’s the circuit. Later, we,ll look at this circuit in the lab.
A simple dark detector circuit – the LED gets brighter as the ambient light level falls

Let’s analyze this circuit. We need to make a few assumptions. First, we’ll assume bright light which means the resistance of PR1 is 200Ω. We also assume that in bright light, the LED (remember, a diode is not a resistive device, it has definite on and off states) is current starved and is in the off state. No current flows through it. (In reality, some small current does flow through the LED but not enough to turn it on). Here are the results of the calculations using those assumptions.

If we start by assuming bright light, the resistance of PR1 is 200Ω and we assume the LED is current starved

When PR1 is 200Ω, the current is such that the vast majority of the voltage drops across R1. There isn’t enough voltage or current to turn on the LED.

Now let’s see what happens in complete darkness. We assume the resistance of PR1 is 12kΩ. As a result, most of the current flows through the LED and it turns on. We also assume a 3.6V drop across the LED.

Next we assume complete darkness (PR1 = 12kΩ) and that the LED is turned on

In this case the resistance of PR1 is high enough that most of the current goes through the diode and it turns on.

We’ll see in the lab that the measured values are different than our calculations. Our assumption that the diode turns on is only partially correct. The diode never fully turns on because R1 is fairly large so it limits the current too much. The LED ends up in a transitive state between on and off (the knee of the current curve). In future lessons we’ll revisit this circuit using a transistor as a switch so that the diode is either fully on or off. But for now, we’ve limited ourselves to resistor circuits.

Flex/Bend Sensor

A flex bend sensor is a specialized resistor that changes resistance when bent in one direction. The resistance is based on the amount of deflection. They come in a variety of widths, lengths, and resistance values.

These were first made famous (for consumers anyway) in the Nintendo Power Glove. But they’ve been used in engineering and scientific applications for quite a while. Applying flex sensors at multiple locations on an airplane’s wing or a helicopter rotor, for example, allows aeronautical engineers to measure how much the structure flexes in response to aerodynamic forces and stresses.

This flex sensor from Adafruit is 4.5″ long and varies in resistance from 10k when flat to 110k when fully flexed

In addition to the long flex sensor above, Adafruit sells a 3″ version that varies from 25KΩ unflexed to approximately 100kΩ fully flexed. We’ll take a look at that one in the lab video at the end of this tutorial

A flex sensor is used like any other resistor in a circuit to provide an indication of deflection or bend.

Let’s take a look at how these sensors work in the lab (see the video below).

 

That concludes our look at resistors in DC circuits. We’ll continue our “Beginner’s Corner” topics with a look at another important electronic component, capacitors. Look for it in the next few days.

If you’d like to keep up to date on the lessons then please subscribe. If you are enjoying these, please like and share.

Until next time, cheers.

Dominick

Please follow and like us: