Skip to main content

Subsection 6.1.1 The Sensor Signal Chain

A physical quantity becomes a number your program can use by passing through a chain of stages. A sensor converts the physical quantity (temperature, light, force) into a voltage. That voltage is usually small and noisy, so an analog front end may amplify and filter it. The ADC then measures the conditioned voltage and reports an integer, and the microcontroller, our STM32C031C6, computes with that integer.
How much of this chain is inside the sensor varies, and it changes what your code has to do. Some sensors are just the bare transducer: they hand you a small, raw voltage, and everything after it is yours to build. Others include the analog front end, so what reaches your pin is already amplified and filtered. And some include the converter as well: they run the whole chain internally and hand you a digital result, which the microcontroller collects over a communication protocol rather than by converting anything itself. We’ll see that third kind, and the communication protocols they use, later in the course. This chapter is about the case where the converting is yours to do.
Figure 6.1.1. The sensor signal chain. A sensor converts a physical quantity into a voltage; an analog front end conditions that voltage by amplifying and filtering it; the ADC digitizes the result into an integer; the microcontroller processes the integer. Every measurement you make in this course travels this path, and each stage can limit the quality of the final number.
The ADC is at the boundary between the continuous world and the discrete one: the voltage going in can take any value at all, while the number coming out is one of a fixed set of integers. In Subsection 6.1.2 we’ll work out exactly what that costs us.