Be an Intelligent Designer—Use Smart Sensors

We’re far beyond passive devices that measure one physical quantity. Modern engineers have access to microcontrollers with integrated sensors and built-in AI.

One of the earliest known sensors for automated control was a coiled bimetallic strip attached to a mercury switch, which provided a binary output (too cold/not too cold) to turn a furnace on or off. Measuring temperature became more sophisticated with the invention of the thermistor, followed by the semiconductor-based temperature sensor. When it became possible to make sensors from silicon, the next logical step was to integrate the signal-conditioning circuit, analog-to-digital converter, and digital communication interface onto the same chip.

But why stop there? Add a microcontroller and RF circuitry and you have a smart sensor that’s capable of data processing, decision-making, and wireless communication. Not enough? Throw in a DSP and you can perform data compression, edge computing—even machine learning and AI.

There’s still a place for the basic thermistor and its analog counterparts, but digital options allow features that seemed unconscionable just a few decades ago. If you need to measure and analyze something, there’s probably a smart sensor that’ll do the math… and then some! 

Discrete (analog) vs integrated (digital) sensors

Design engineers can choose between discrete sensors and integrated “all-in-one” packages. The former requires a custom signal conditioning circuit that either feeds a microcontroller’s analog input or drives an analog control circuit. For most applications, an off-the-shelf integrated package is usually preferable, offering a lower parts count, pre-tested hardware and software, and a much faster time to market. Smart sensors are also more reliable, easier to integrate and can compensate for certain non-linear characteristics through software. The integrated package also results in lower power consumption and its communication interface allows for remote sensing.

On the other hand, a highly specialized application may require custom hardware and software, so a discrete sensor might be the better choice. Discrete analog sensors are also preferable for very simple applications where a microcontroller would be overkill, and for situations that require very fast response times that can only be achieved with custom hardware.

Sensors and applications

Go to your favorite supplier of electronic components, search for sensors, and you could see nearly 20,000 devices in the catalog. Common examples include inertial, magnetic, environmental, flexible and occupancy sensors.

Inertial sensors measure linear velocity, angular velocity and acceleration. Some are used as vibration sensors to assess the health of a machine, especially in industrial settings. An inertial measurement unit (IMU) combines an accelerometer and a gyroscope, which is useful in navigation systems. IMUs are also employed in tablets and cell phones to determine the device’s orientation in 3D space. Magnetic sensors are found in navigation systems, linear encoders and motors to monitor the rotor position.

Environmental sensors measure sound, pressure, temperature, humidity and certain gases. A MEMS microphone is used in applications where traditional mics aren’t practical, thanks to their small size, high signal-to-noise ratio, and low cost. Ultrasonic MEMS mics can detect air or gas leaks by their sounds and humidity sensors can pinpoint water leaks. Pressure sensors are used to gauge liquid levels in an enclosed tank, monitor tire pressure, detect leaks and measure airflow. A chemical sensor can become an “electronic olfactory” to monitor air quality and detect hazardous materials.

Flexible sensors are used in wearable devices to monitor a person’s vital signs and activity levels, as well as on buildings and bridges to measure strain and stress levels, which facilitates predictive maintenance. In both cases, an RF interface provides remote sensing capabilities.

An occupancy sensor, such as passive IR, ultrasonic and camera, can detect an individual or count the number of people in a room, providing information for a building automation system to control lighting, heating, security, etc. With a data analysis algorithm, it can distinguish between humans and animals, which is useful in security systems.

Start making sense: Data analysis

Sensors produce data that must be interpreted. In many cases, some form of filtering is required. For a simple analog-based design, this could be a passive or active filter. In a digital application, a smart sensor with a built-in DSP could fit the bill. A machine learning or AI system may necessitate a neural network based on an Intelligent Sensor Processing Unit (ISPU), which can perform statistical techniques such as smoothing, linear regression analysis and clustering. A data set will first undergo smoothing to eliminate random noise and compensate for output drift. Regression analysis and clustering will then recognize patterns and find anomalies in the data, both of which can help to make predictions about future system behavior.

Manufacturers of smart sensors often provide libraries of algorithms that address common uses. If you can’t find a pre-written algorithm, you may be able to customize an existing one to fit your needs, or you could glean enough information from a similar algorithm to enable you to write your own. Signal processing algorithms can be relatively simple, as in a digital filtering routine, or they can be quite complex, often involving machine learning, pattern recognition and AI.

Sensor fusion: Seeing the big picture

Scientific researchers will often run multiple experiments, each with different processes and measurements, and combine the results in order to extract meaningful data using a process known as triangulation. When looking at data from multiple perspectives, if they all point to the same conclusion, then one can have confidence in the validity of the outcome. The same is true for sensors.

For example, a vehicle may combine lidar, radar, ultrasonic and stereoscopic cameras to determine the distance to an object under any condition. Engineers use a process called sensor fusion to combine measurements in order to make appropriate decisions. Sensor fusion looks at each output, weighs it according to pre-defined criteria, and merges the weighted outputs to reach a conclusion.

In this example, each sensor calculates the distance based on its own reading. But lidar, radar, ultrasonic, and vision sensors each have limitations based on ambient conditions, so not all of the data is equally valid in every situation. At night, a vehicle may rely less on vision and more on the other quantities, so lidar, radar and ultrasonic are weighted more heavily in the final output. On a rainy day, lidar may be less accurate, so its weight would be decreased. On the industrial side, a sensor fusion algorithm combines the data from environmental and inertial sensors to provide insight into the overall health and performance of a machine, which can contribute to predictive maintenance and digital twins.

Again, manufacturers may provide “tweakable” sensor fusion algorithms that you can tailor to your requirements, and many offer consulting services where their application engineers can assist with designs. You can also find libraries for computer vision, robotics and other sensor fusion applications. Many of these are freely available in online forums and include support from community members, while others can be purchased or licensed. Finally, you can create custom sensor fusion algorithms using a mathematical modeling and simulation package.

Edge vs cloud computing

In general, one should compute at the edge as much as possible in order to minimize bandwidth usage, increase data security and reduce latency. Cloud-based computing with large data centers and deep learning networks may be necessary for digital twins and some predictive maintenance, but only after the data has been pre-processed at the edge.

Smart sensors, with their ever-increasing inventory of ML and AI features, allow more data to be crunched on-site rather than in the cloud.

Design considerations for sensors

Engineers have several choices to make when designing with sensors. The first, obviously, is to determine which physical quantity you’re trying to measure. After that:

  1. Determine the full-scale range of measurements.
  2. Decide whether a basic analog sensor with custom hardware is appropriate, or a digital solution with multiple sensors and built-in signal conditioning is preferable. Packaged solutions that include hardware and software may be more costly upfront but offer a quicker time-to-market if a turnkey solution is what you need.
  3. Specify the range of operating temperatures. If there’s a possibility of exceeding that range, how much of a safety factor is needed to prevent damage to the sensor?
  4. How much EMI shielding is needed?
  5. What resolution do you need?
  6. What sensitivity or gain is necessary?
  7. What power source is used, and how much of the power budget can be expended on this sensor and its associated hardware? Remember that microcontrollers with integrated sensor packages tend to use less power than discrete sensors and related circuitry. Unused sensors can be turned off to conserve power.

Most electronic design and simulation packages include models for a variety of discrete and integrated sensors, and they often feature PCB layout capabilities that can reduce EMI. Manufacturers also offer prototyping kits that include development boards and complete software development environments.

Sensor evolution

Going from single-celled organisms to intelligent beings took natural selection nearly four billion years, but the resulting engineers only needed a few centuries to get from basic sensors to sensorem sapiens, so to speak. Today’s smart sensors can improve manufacturing processes, enhance transportation safety, increase energy efficiency and more.

If it needs to be measured and analyzed, there’s probably a sensor—or an embedded system—that does the job.