Introduction Electronic Sensors
Introduction Electronic Sensors
Analog vs Digital
There are many ways to categorize sensors. One of the most basic ways is analog
versus digital. The difference between analog and digital sensors relates to how
the sensor outputs the measured data. It rarely has anything to do with the
sensing mechanism itself (motor encoders being a notable exception).
For example, many sensors provide a voltage that varies proportionately with the
quantity being measured. This voltage is an analog signal that varies continuously
between two voltage thresholds.
Figure 1 - An Analog-to-Digital Converter (ADC) takes an analog input and outputs a digital
signal.
When that analog voltage is fed into an analog-to-digital converter (ADC) it will be
converted into a digital signal. If this ADC is built into the sensor itself then that
sensor is digital.
If this ADC is instead located somewhere outside the sensor (typically inside the
system microcontroller or an ADC chip) then the sensor is analog.
Digital sensors are usually preferable if their price and specifications are
acceptable. This is because digital sensors are less susceptible to electrical
interference and they have a lower design risk.
Sound
One of the most prevalent types of sensors are sound sensors, better known as
microphones. A microphone converts the air pressure variations of a sound wave
into an electrical signal.
The primary advantage of thermistors is they are cheap and easy to use. The
critical disadvantage of thermistors is they are very non-linear. This non-linearity
limits the temperature range in which they can accurately be used.
Humidity
Humidity sensors measure relative humidity. They are coupled together with a
temperature sensor, because to measure relative humidity you must know the
temperature.
Relative humidity is a percentage that refers to how much water the air is holding
compared to the maximum amount the air can hold. It is a measurement of the
evaporating power of the air.
The higher the temperature the more water air can hold. This means that
temperature has a direct impact on the measurement of relative humidity.
Barometric pressure
Barometric pressure sensors are widely available. Since barometric pressure
decreases as you go up in altitude, they are commonly used to measure altitude.
On the other hand, since pressure increases as you go deeper under water,
barometric sensors can also be used for measuring water depth. Finally,
barometric pressure sensors are used for weather forecasting devices.
Force / Weight
The most common device for measuring force or weight is called a strain gauge.
A strain gauge is basically a piece of metal that bends a small amount when a
force is applied to it. This bending changes the resistance of the metal which can
then be measured and converted into a weight.
Electrical current
Current sensors are typically an internal sensor used to measure current
somewhere else on the same PCB. Of course there are exceptions, like a multi-
meter used to measure current.
The standard method of measuring current is to use a small, sense resistor. The
current you wish to measure passes through this resistor and creates a voltage
drop across the resistor which can be measured. This voltage drop can then be
used to calculate the current through the resistor using Ohm’s Law.
Gases
There are electronic sensors available that can measure numerous different
gases. Some of the most common gas sensors are for detecting carbon
monoxide, carbon dioxide, and oxygen. But you can also find sensors for
detecting everything from hydrogen to hydrocarbons.
Accelerometer
Accelerometers measure proper acceleration, which is acceleration in relation to
free fall. For example, an accelerometer in free fall will actually measure zero
acceleration, whereas a stationary accelerometer will measure 9.8 m/s2 due to
the Earth’s gravity (defined as 1-g).
One of Albert Einstein’s great discoveries was that acceleration and gravity are
equivalent (hence the name equivalence principle).
Most accelerometers measure acceleration along three axes and can determine
orientation in reference to the vertical direction of gravity.
Like accelerometers, gyroscopes are usually tri-axial and measure angular velocity
along three axes. Gyroscopes are many times combined together with a 3-axis
accelerometer to form what is known as a 6-axis Inertial Measurement Unit
(IMU).
Initially, IMU’s were used primarily in unmanned aircraft and satellites. Now they
are used extensively in consumer electronic products like smart phones, fitness
trackers, drones, and any device that needs to detect how it moves through
space.
Magnetometer
A magnetometer is essentially an electronic compass that measures lateral
orientation. As its name implies, a magnetometer measures the strength and
direction of any magnetic field, but it is mainly used to measure the Earth’s
magnetic field just like a compass.
Both inductive and capacitive sensors have very limited sensing distances up to
about 60 mm.
Ultrasonic
Ultrasonic sensors work using sound waves with a frequency significantly above
the range of human hearing. The most common applications for ultrasonic
sensors are object detection and distance measurement. When used to detect
objects under water, or to measure water depth, an ultrasonic sensor is referred
to as sonar.
Unlike the passive sensors described previously, an ultrasonic sensor is really a bi-
directional transducer that includes both a sensor (microphone) and an actuator
(speaker).
Ultrasonic sensors contain an ultrasonic speaker that sends out ultrasonic sound
waves. These waves propagate from the speaker until they hit an object. They
then bounce back toward the sensor.
The actual sensor then detects these returned audio waves. By measuring the
total travel time of those audio waves it’s relatively easy to calculate the distance
from that object since sound waves travel at a known speed. This is called
echolocation and is the same process used by bats and dolphins.
Consumer grade ultrasonic sensors can typically detect objects at distances
anywhere from a couple centimeters up to 10 meters.
The HC-SR04 is a very common ultrasonic module commonly used by makers, but
also appropriate for higher volume production. It is a simple, low-cost module
that includes both the ultrasonic sensor (microphone) and actuator (speaker). It
has a range from 2 cm up to 4 m.
Light Sensors
Light sensors are an extremely broad sensor classification that covers a huge
number of applications. One of the simplest applications of a light sensor is to
detect ambient light levels. For example, outdoor lights that turn on automatically
at dusk use a light sensor.
A PIR sensor measures the infrared light radiating from warm objects in its field of
view. Any object above absolute zero (-273° C) emits infrared radiation which can
be detected by an infrared sensor.
PIR sensors are most commonly used to detect the motion of people, animals or
objects. Motion-activated outdoor lighting and burglar alarm systems use PIR
sensors.
Most PIR sensors are coupled with a special type of optical lens called a Fresnel
lens. This lens breaks the sensors field of view into segments so the sensor can
detect small increments of motion.
Many of the really cool capabilities of light sensors shine (no pun intended) when
coupled with a light emitter (actuator).
The simplest application is for detecting when an object passes between the
transmitter and the sensor thus breaking the light beam. Typically, infrared light
is used which isn’t visible to the human eye. This is how most garage door
openers detect if something is in the way of the door closing.
Light transmitter/sensor combos are also used as optical encoders to measure the
position and speed of a motor. A pattern of openings allows light to shine
through when the motor is at specific positions. Light sensors on the other side
detect the light passing through these holes allowing the system to determine the
rotational position of the motor.
Time-of-Flight / LiDAR
In the past, if you wanted to measure the distance to a nearby object, ultrasonic
sensors were your only option. You will recall that ultrasonic sensors measure
distance by timing the sound waves reflected off the detected object.
Measuring relatively short distances with light is much more complex, due to the
difference between the speed of light and the speed of sound. Sound travels
around 750 miles per hour, whereas light travels almost a million times faster at
an incredible 186,000 miles per second!
But special light sensors called Time-of-Flight sensors are now available that can
accurately measure distance by timing the flight time of the light beam.
Semiconductors didn’t became fast enough to make this possible until the 2000’s.
ST Microelectronics offers two very impressive, low-cost ToF sensors. The ST
VL53L0X claims to be the world’s smallest ToF sensor measuring just slightly over
2 mm x 4 mm x 1 mm. Their longer range VL53L1X model is a fraction of a
millimeter larger on each dimension but increases the operating range from 2
meters to 4 meters.
LiDAR is an acronym for light detection and ranging, or a combination of the
words light and radar. LiDAR uses ToF sensors to map out a 2D or 3D area. For
example, if you mount a ToF sensor on a rotating motor you can accurately map
out a 360 degree area of nearby objects. Even more complex systems can
perform this scanning in 3 dimensions, serving as a 3D scanner.
Many sensors may claim to be LiDAR but in reality they use lower cost LED light
emitters, whereas true LiDAR solutions use lasers to generate the narrow beam
required for accurate 2D/3D mapping applications.
Gesture sensors
Another use of light sensors is for detecting human gestures. Advanced video
game systems use lasers, specialized cameras, and fast processors to detect
complex gestures like hitting a baseball.
Figure 6 - Video games and virtual reality applications use advanced gesture recognition.
Such advanced gesture sensors are not appropriate for more simple gesture
detection applications. For simple gesture sensors that can be easily integrated
with a microcontroller, it is best to instead use less costly infrared LED emitters.
A simple gesture sensor may have two IR emitters with a sensor in the middle.
This type of sensor can detect when and in what direction an object passes by.
This allows implementation of simple gestures like a hand swipe.
The ST VL53L0X time-of-flight sensor that I mentioned above can also be used for
simple gesture detection.
Conclusion
This article has given you a general overview of most types of sensors commonly
used in consumer electronic products (and some industrial applications).
Now that you know what type of sensors are realistically available you can learn
more about the specific ones needed for your project. Here’s a nice tutorial series
for learning more specific, technical details about the most frequently used
sensors.
Are you ready to discover the smarter way to develop a new electronic hardware
product? If so then check out the Predictable Hardware Report.