Scherz & Monk, Chapter 6

Sensors: Making the World Readable

A microcontroller only understands numbers. The world speaks in degrees, centimeters, grams, and gauss. A sensor is the translator — a transducer that turns a physical property into a voltage, and a clever little circuit that turns that voltage into a number your code can act on.

Prerequisites: Ohm's law & the voltage divider + R, C and RC timing (Ch 2) + natural log / exp + the ADC idea (12-bit, 0–1023)
17
Chapters
4+
Simulations
0
Assumed Knowledge

Chapter 0: The Robot That Can't See or Feel

You have built a small robot. It rolls forward on two motors, and it is supposed to do two simple things: stop before it slams into a wall, and shut down if its motor driver chip overheats. Both feel trivial — until you sit down to write the code.

Inside the robot is a microcontroller. Its world is brutally narrow. It cannot perceive a wall. It cannot feel heat. The only thing it can do is read its analog-to-digital converter (ADC) — a peripheral that measures a voltage on a pin and hands your program back an integer. On a 12-bit-ish hobby ADC that integer runs from 0 to 1023: 0 means "the pin is at 0 V," 1023 means "the pin is at the reference voltage (say 5 V)," and everything in between is linearly spaced.

So the robot's entire sensory universe is: "give me a number between 0 and 1023." The wall is at 1.7 meters. The chip is at 85 °C. Neither of those is a number between 0 and 1023. The whole job of this chapter is to build the bridge:

Physical world
temperature, distance, force, light, magnetic field — the actual stimulus
Transducer
a component whose resistance, voltage, or timing changes with the stimulus
Conditioning circuit
usually a voltage divider or bridge that turns that change into a clean 0–5 V signal
ADC count
the integer 0–1023 your code actually receives
Calibrated value
your software maps the count back to "1.7 m" or "85 °C"

Read that chain in both directions. Going down, physics produces a number. Going up, your code reverses the physics to recover a real measurement. Every sensor in this chapter — thermistor, RTD, thermocouple, TMP36, ultrasonic ranger, strain gauge, Hall-effect chip — is just a different way of filling in the first two boxes. The bottom three boxes barely change.

The one pattern to remember. Most analog sensors are a variable passive element — a resistor (or capacitor, or inductor) whose value tracks the stimulus — dropped into a voltage divider. A changing resistance becomes a changing voltage, and a changing voltage is exactly what an ADC eats. If you understand the divider, you understand 70% of sensing. The rest is choosing a good variable element and undoing its nonlinearity in software.
From Physics to ADC Count

A thermistor's resistance falls as it heats. Drop it in a 5 V divider and the node voltage rises with temperature; the ADC turns that voltage into a count. Slide the temperature and watch the whole chain move at once.

Temperature 25 °C
Your robot's ADC returns the integer 512 (out of 1023, reference 5 V). What voltage is on the pin, roughly?

Chapter 1: Sensors as Transducers

A transducer is any device that converts energy from one form to another. A loudspeaker is a transducer (electrical → sound). A sensor is a transducer pointed the other way: it converts a non-electrical quantity into an electrical one we can measure. The art is in the second half — signal conditioning — which takes the often tiny, noisy, nonlinear, or awkwardly-scaled raw output and shapes it into a voltage the ADC can use.

Sensors fall into two big families. Resistive sensors change their resistance with the stimulus: thermistors (temperature), photoresistors (light), strain gauges (force), potentiometers (position). They produce no voltage on their own — you must excite them with a known current or voltage. Self-generating sensors produce a voltage directly: thermocouples (Seebeck voltage from a temperature gradient), photodiodes (photocurrent), piezoelectric elements (charge from pressure). These need no excitation but often need amplification.

The Voltage Divider Is the Workhorse

For a resistive sensor with resistance R, the standard conditioning circuit is a divider with a fixed resistor R₁ (often chosen equal to the sensor's nominal value R₀). If R₁ sits on top (connected to Vin) and the sensor R sits on the bottom (to ground), the node between them reads:

Vout = Vin · R / (R₁ + R)

If instead the sensor is on top and the fixed resistor on the bottom, swap which resistance appears in the numerator. The choice flips the sign of the response — whether Vout rises or falls with the stimulus — which matters a lot when you wire it up. Either way, a changing R produces a changing Vout between 0 and Vin.

Why R₁ = R₀ is a good default. A divider is most sensitive — its output changes the most per unit change in R — when the fixed resistor is comparable to the sensor's resistance in the range you care about. Setting R₁ equal to the sensor's mid-range value R₀ centers the output near Vin/2, giving you the most headroom in both directions and the steepest local slope. It is not magic, just a sweet spot.

Worked example: where does a divider sit?

Take Vin = 5 V, fixed R₁ = 4.7 kΩ on top, sensor R on the bottom. If the sensor happens to equal 4.7 kΩ:

Vout = 5 · 4700 / (4700 + 4700) = 5 · 0.5 = 2.50 V

Now suppose the stimulus pushes the sensor up to 15.95 kΩ (a real number we will derive in the thermistor tab):

Vout = 5 · 15950 / (4700 + 15950) = 5 · 0.7724 = 3.86 V

Wait — that is the sensor-on-bottom wiring, so a bigger sensor resistance gives a bigger Vout. With the sensor on top instead, the same 15.95 kΩ gives Vout = 5·4700/20650 = 1.14 V. Same components, opposite slope. You must know which resistor is on top before you can convert a count back to a measurement.

Divider Sensitivity Explorer

Sweep the sensor resistance R from 100 Ω to 100 kΩ. The curve shows Vout for the sensor-on-bottom divider; the dot marks your current R. Notice the slope is steepest — the divider most sensitive — where R is near the fixed resistor R₁.

Fixed R₁ 4.7 kΩ
Sensor R 4.7 kΩ
An NTC thermistor (resistance falls as temperature rises) is wired as the top resistor of a divider, with a fixed resistor to ground. Temperature rises. What does Vout do?

Chapter 2: Precision, Accuracy, Resolution & Calibration

Before trusting any sensor reading, you must separate four words that everyday speech jumbles together. They are not synonyms, and confusing them produces robots that act with false confidence.

Accuracy — how close a reading is to the true value. A scale that reports 85.7 kg for a 92.1 kg person is inaccurate; it has a systematic offset of −6.4 kg.

Precision (repeatability) — how close repeated readings are to each other. If that same scale reads 85.7 kg every single time, it is highly precise — just precisely wrong.

Resolution — the smallest change the system can distinguish. A 10-bit ADC over 5 V has 1024 steps, so one step (one LSB) is 5 V/1024 ≈ 4.9 mV. Finer voltage changes than that are invisible.

Calibration — the act of correcting accuracy by comparing against a known reference and storing the correction. Precision you cannot fix in software; accuracy you usually can.

A precise-but-inaccurate sensor is actually the good case, because a fixed offset is calibratable: measure the error once against a trusted reference and subtract it forever after. An imprecise sensor — one that scatters randomly — cannot be rescued so easily; you can only average many readings to beat down the noise.

Resolution in real units

Resolution at the ADC is voltage, but what you care about is resolution in degrees or centimeters. Suppose a temperature sensor produces 10 mV/°C and feeds a 10-bit, 5 V ADC. One ADC count is 4.9 mV, which corresponds to:

ΔT = 4.9 mV / (10 mV/°C) = 0.49 °C per count

So even a perfect sensor cannot resolve finer than about half a degree on this ADC — not because the sensor is bad, but because the digitizer quantizes. Want finer? Amplify the signal before the ADC, or use more ADC bits.

Lookup tables and interpolation

Many sensors are nonlinear, so converting count → value with a formula is expensive on a small microcontroller. The classic trick is a lookup table: precompute the real value for a handful of counts, store them in flash, and linearly interpolate between entries. If count 300 means 20 °C and count 360 means 30 °C, then a reading of 330 maps to:

T = 20 + (330−300)/(360−300) · (30−20) = 20 + 0.5·10 = 25 °C

Cheap, fast, and accurate enough as long as the table is dense where the curve bends sharply.

The fix that isn't. Adding more ADC bits raises resolution but does nothing for accuracy if the sensor itself has a 2 °C error or your reference voltage drifts. Resolution is how finely you can read; accuracy is whether the reading is true. A 16-bit ADC on a sloppy reference just gives you very precise nonsense.
Accuracy vs Precision Target

A dartboard view. Bias shifts the whole cluster away from the bullseye (accuracy); spread scatters the darts (precision). Try high-bias/low-spread to see a "precisely wrong" sensor — the one you can calibrate.

Bias (inaccuracy) 60
Spread (imprecision) 15
A bathroom scale reads 85.7 kg every time you step on it, but you actually weigh 92.1 kg. How do you describe it?

Chapter 3: Thermistors — Cheap, Sensitive, Wildly Nonlinear

A thermistor is a resistor engineered so its resistance changes strongly with temperature. The common kind is NTC (negative temperature coefficient): resistance falls as it heats. (PTC types rise, and are used more as resettable fuses than as thermometers.) Thermistors are pennies cheap and extremely sensitive — a 4.7 kΩ NTC can swing from ~16 kΩ at the freezing point of water down to a few hundred ohms when hot. That sensitivity is their gift; their nonlinearity is the price.

The Beta equation

The resistance does not change linearly with temperature — it changes exponentially. A workable two-point model is the Beta (β) equation, where all temperatures are in kelvin (K = °C + 273.15):

R = R₀ · exp[ β · (1/T − 1/T₀) ]

Here R₀ is the resistance at a reference temperature T₀ (usually 4.7 kΩ at 25 °C = 298 K), and β is a material constant (a typical value is 3977 K). For lab-grade accuracy the three-term Steinhart–Hart equation  1/T = A + B·ln(R) + C·(ln R)³  fits the curve better, but Beta captures the essential exponential shape with a single number.

Worked example: the thermistor divider at 0 °C

Vin = 5 V, fixed R₁ = 4.7 kΩ on top, NTC thermistor (R₀ = 4.7 kΩ, T₀ = 298 K, β = 3977) on the bottom. We want Vout at the freezing point, T = 0 °C = 273 K.

First the exponent:

1/273 − 1/298 = 0.003663 − 0.003356 = 0.0003073
β · 0.0003073 = 3977 · 0.0003073 = 1.222

Now the resistance:

R = 4700 · e1.222 = 4700 · 3.394 = 15 950 Ω ≈ 16 kΩ

Finally the divider (sensor on bottom):

Vout = 5 · 4700 / (4700 + 15950) = 5 · 0.2276 = 1.14 V

And the sanity check at 25 °C: the exponent is β·0 = 0, so R = R₀ = 4.7 kΩ exactly, and Vout = 5·0.5 = 2.50 V. Freezing reads 1.14 V, room temperature reads 2.50 V — and the curve between them bends, which is exactly what the showcase below lets you feel.

Nonlinearity is the whole personality of a thermistor. Between 0 °C and 25 °C the resistance changed by ~11 kΩ; between 100 °C and 125 °C it changes by only a few hundred ohms. The same 25 °C step moves the voltage a lot near the cold end and almost nothing near the hot end. That is why you either fit the Beta/Steinhart curve in software or carry a dense lookup table — a single linear scale factor would be wrong almost everywhere.
SHOWCASE — Thermistor Divider vs Temperature

The full chain, live. Left pane: the R(T) curve from the Beta equation, with your operating point marked. Right pane: the resulting Vout and the ADC count (10-bit, 0–1023). Slide temperature from −40 to +125 °C; change β and the fixed resistor to see how the designer trades sensitivity for range.

Temperature 0 °C
Beta (β) 3977
Fixed R₁ 4.7 kΩ
Using the worked numbers (R₀=4.7 kΩ, β=3977, sensor on bottom of a 5 V / 4.7 kΩ divider), Vout at 0 °C is about 1.14 V. At 25 °C it is 2.50 V. Why is the voltage lower at the colder temperature?

Chapter 4: RTDs, Thermocouples & the Seebeck Effect

The thermistor was cheap and sensitive but bent like a pretzel. When you need accuracy and linearity — in a lab, an oven controller, an industrial process — you reach for two other temperature sensors that trade money for honesty.

RTDs: pure metal, nearly straight

A resistance temperature detector (RTD) exploits the fact that the resistance of a pure metal rises almost linearly with temperature. The gold standard is platinum: a Pt100 has 100 Ω at 0 °C. To first order:

R = R₀(1 + αT)

with R₀ = 100 Ω and temperature coefficient α ≈ 0.003925 /°C for platinum. The resistance change is tiny — that is the cost of linearity — but it is beautifully predictable.

Worked example: Pt100 at 100 °C

R = 100 · (1 + 0.003925 · 100) = 100 · (1 + 0.3925) = 100 · 1.3925 = 139.25 Ω

Compare the two technologies over the same 0–100 °C span. The platinum RTD crept from 100 Ω to 139.25 Ω — a clean, straight 39% rise. The thermistor from the last tab swung from roughly 16 kΩ down to a few hundred ohms over a similar range — a factor of fifty, but along a savagely curved path. That single comparison is the engineering tradeoff in numbers: the RTD is linear and accurate but barely moves (you need a sensitive front end), while the thermistor moves enormously but nonlinearly.

Thermocouples: voltage from a temperature difference

A thermocouple is two wires of dissimilar metals joined at one end. The junction generates a small voltage that depends on the temperature difference between the joined (hot) end and the open (cold) ends — the Seebeck effect:

V = S · ΔT

where S is the Seebeck coefficient of the metal pair. A Type-K (chromel–alumel) couple has S ≈ 41 µV/°C and works from −200 °C all the way to about +1350 °C. That enormous range is why thermocouples own furnaces and kilns where thermistors and RTDs would simply melt.

Worked example: Type-K voltage and cold-junction compensation

A Type-K couple with its hot junction in a 1000 °C furnace and its terminals at 25 °C sees ΔT = 975 °C:

V ≈ 41 µV/°C · 975 °C ≈ 40 mV

But notice the catch baked into V = S·ΔT: the voltage measures a difference, not the hot temperature itself. If you assumed the cold end was at 0 °C but it was really at 25 °C, your reading is off by 25 °C. So every thermocouple system needs cold-junction compensation: a second, ordinary sensor (often a TMP36 or thermistor) measures the terminal-block temperature, and firmware adds it back. The thermocouple gives you the difference; the cold-junction sensor supplies the reference.

Three thermometers, three philosophies. Thermistor: cheap, hypersensitive, nonlinear, modest range — great for hobby and consumer gear. RTD: expensive, linear, accurate, narrow swing — the lab and industrial choice. Thermocouple: rugged, self-powered, enormous range, but tiny output that needs amplification and cold-junction compensation — the only option above a few hundred degrees. You are not picking a "best" sensor; you are picking which problem you would rather have.
Sensor Transfer-Curve Comparator

Output versus temperature for three sensors on one axis. Toggle each on or off. Watch the thermistor curve bend while the RTD and TMP36 stay arrow-straight — linearity made visible. (Each curve is normalized so all three fit one frame.)

You must measure the inside of a 1300 °C kiln. Which sensor is the right choice?

Chapter 5: IC Temperature Sensors — Buying Your Way Out of the Math

Thermistors, RTDs, and thermocouples all dump the curve-fitting, excitation, and compensation onto you. An integrated-circuit (IC) temperature sensor bakes all of that into silicon. You pay a few extra cents, and in return you get an output that is already linear, already in convenient units, and sometimes already digital. This is the "plug-and-play" corner of the cost/effort tradeoff.

The TMP36: a linear analog stick of butter

The TMP36 outputs a voltage that rises a flat 10 mV for every degree Celsius, with a 500 mV offset so it can report below-zero temperatures on a single supply:

Vout = 0.010 · T + 0.500   →   T(°C) = 100 · Vout − 50

No Beta, no kelvin, no exponentials. Just read the pin and do one multiply and one subtract. It works from −40 to +125 °C with about ±2 °C accuracy — not lab grade, but more than enough to know your motor driver is overheating.

Worked example: TMP36 in both directions

Your ADC reports a pin voltage of 0.750 V. Convert to temperature:

T = 100 · 0.750 − 50 = 75 − 50 = 25 °C

The reverse check: at 0 °C the TMP36 outputs 0.010·0 + 0.500 = 0.500 V. And a reading of 0.900 V means T = 100·0.9 − 50 = 40 °C. Compare the cognitive load to the thermistor: there we needed logs, an exponent, a divider, and a lookup table; here we needed a line.

The DS18B20: skip the ADC entirely

The DS18B20 goes one step further and outputs a digital number over the 1-Wire bus — a single data line that can carry many sensors, each with a unique 64-bit address. It does its own analog-to-digital conversion internally, so your microcontroller never touches an analog voltage at all. Range is −55 to +125 °C with ±0.5 °C accuracy and up to 12-bit resolution, and the conversion-and-units problem disappears: you ask for the temperature and you receive degrees.

The real axis is effort, not just dollars. Going thermistor → TMP36 → DS18B20, the part costs creep up a little, but what really changes is how much work lives in your code. The thermistor makes you own the physics. The TMP36 hands you a clean line. The DS18B20 hands you a finished number on a digital bus. For a one-off robot, the engineer-hours you save are worth far more than the price difference — which is exactly why IC sensors dominate hobby and product designs.
TMP36 Transfer Function (linear, both directions)

Drag temperature and read the output voltage off the straight line; the inverse formula T = 100·Vout − 50 is shown live. Compare the dead-straight TMP36 line to the thermistor's curve back in tab 3.

Temperature 25 °C
A TMP36 outputs 0.900 V. What temperature is it reading?

Chapter 6: Distance & Proximity

Back to the robot's first job: stop before the wall. Temperature was a resistance problem; distance is usually a timing problem. The dominant trick is time-of-flight: emit a pulse, measure how long the echo takes to come back, and multiply by the wave's speed.

Ultrasonic ranging

An ultrasonic ranger (the ubiquitous HC-SR04) chirps a ~40 kHz burst of sound, then times the echo. Sound travels at roughly 340 m/s in room-temperature air. The pulse goes out to the wall and back, so the measured time covers twice the distance:

d = (v · t) / 2

Worked example: the wall at 1.7 m

The echo returns 10 ms (0.010 s) after the chirp. With v = 340 m/s:

round-trip distance = v · t = 340 · 0.010 = 3.4 m
d = 3.4 / 2 = 1.7 m

There it is — the "wall is 1.7 m away" from the opening problem, recovered from a 10 ms time interval. One subtlety: the speed of sound depends on temperature, rising from ~331 m/s at 0 °C to ~346 m/s at 25 °C. A precise ranger therefore reads a thermometer too and corrects v — sensors leaning on sensors.

Two other proximity tricks

IR optical (reflectance): an infrared LED shines forward and a photodiode or position-sensitive detector reads the reflection. Sharp's GP2Y0A modules triangulate the reflected spot's angle, giving a (nonlinear) voltage versus distance. Cheap and fast, but fooled by dark, glossy, or angled surfaces.

Capacitive RC sensing: a conductive plate forms a capacitor with its surroundings; a nearby hand or object changes that capacitance, which changes the time constant τ = RC of a charge/discharge circuit. Measure the timing shift and you have proximity with no moving parts and no contact — this is how touchscreens and many touch buttons work.

Why divide by two, every time. The single most common bug in time-of-flight code is forgetting that the pulse makes a round trip. The sensor times out-and-back, so the raw distance is double the real distance to the target. Halve it. Skip the halving and your robot thinks every wall is twice as far as it is — and stops too late.

Ultrasonic Time-of-Flight

Slide the wall closer or farther and watch the echo pulse race out and back. The timeline shows the measured round-trip time; the readout divides by two to give the true distance. Change air temperature to nudge the speed of sound.

Distance to wall 1.70 m
Air temperature 25 °C
An ultrasonic ranger reports an echo 8 ms after its chirp, with sound at 340 m/s. How far is the object?

Chapter 7: Force, Motion & Magnetism

The last family of sensors measures mechanical and magnetic quantities — force, acceleration, magnetic field. Their conditioning circuits introduce one new idea beyond the simple divider: the Wheatstone bridge, the trick for reading a tiny resistance change with high precision.

Strain gauges and the Wheatstone bridge

A strain gauge is a thin foil resistor bonded to a surface. When the surface stretches (tension) the foil's wire lengthens and thins, raising its resistance; under compression it shortens and its resistance falls. The change is minuscule — fractions of a percent — far too small to read accurately from a plain divider, where it would be lost in the offset voltage.

The fix is the Wheatstone bridge: two voltage dividers fed from the same supply, with the output taken as the difference between their midpoints:

Vout = Vin · [ R₃/(R₃+R₄) − R₂/(R₁+R₂) ]

When the bridge is balanced — R₁/R₂ = R₄/R₃ — the two midpoints sit at the same voltage and Vout = 0. Now the genius: you set the bridge to balance with the gauge unstrained, so the big constant offset cancels itself out, and the meter reads only the change. A 0.1% resistance shift that was invisible in a divider becomes a clean, amplifiable signal around zero.

Worked example: a bridge nudged off balance

Vin = 5 V, all four arms start at 350 Ω (a common gauge value), so the bridge is balanced and Vout = 0. Tension raises the gauge arm R₃ by 0.5 Ω to 350.5 Ω:

Vout = 5 · [ 350.5/(350.5+350) − 350/(350+350) ]
= 5 · [ 0.50036 − 0.50000 ] = 5 · 0.000357 ≈ 1.8 mV

A 0.14% resistance change produced 1.8 mV out of a 5 V supply — small, but sitting on zero rather than buried under 2.5 V, so an amplifier can blow it up cleanly. That is the entire reason load cells (bathroom scales, kitchen scales, industrial weighing) use bridges.

MEMS accelerometers

A MEMS accelerometer (like the MMA8452Q) is a microscopic spring-mass system etched into silicon. Acceleration deflects a tiny proof mass; the deflection changes the capacitance between interleaved comb fingers; on-chip electronics read that capacitance and report acceleration, usually over I²C. It is the same spring-mass-capacitor idea as before, just shrunk to micrometers.

Hall-effect sensors

The Hall effect: pass a current I through a thin conductive slab sitting in a magnetic field B perpendicular to it, and the field pushes the moving charges sideways, building a measurable voltage across the slab:

VH = − I · B / (n · e · d)

where n is charge-carrier density, e the electron charge, and d the slab thickness. The output is proportional to B, so a Hall sensor reads magnetic field strength directly — no contact, no moving parts. Switch-mode Hall chips snap their output high once B crosses a threshold (perfect for counting gear teeth or sensing a door magnet); linear-mode chips output a voltage proportional to B (for current sensing and position).

Bridges generalize the divider. A single divider gives you an absolute voltage that you must compare to some expected value. A bridge gives you a difference that is already referenced to zero at the rest condition — so it rejects the parts you do not care about (supply drift, temperature drift if arms are matched, the large baseline resistance) and keeps only the change you do. Anytime you must read a tiny variation riding on a large constant, think bridge, not divider.
Wheatstone Bridge & Strain Gauge

Drag the strain slider through tension and compression. The needle swings off zero as the gauge arm leaves its rest value; at balance it parks dead center.

Strain (gauge ΔR) 0.0
Hall Sensor Sweep

Move the bar magnet toward the current-carrying slab. The Hall voltage VH grows with field strength. Flip between linear (proportional) and switch (threshold) modes.

Magnet distance 60
Why is a Wheatstone bridge better than a single voltage divider for reading a strain gauge?

Chapter 8: Connections & Summary

Every sensor in this chapter solved the same opening problem — turn a physical quantity into a number a microcontroller can act on — and almost all of them did it with one of two circuits: a voltage divider (variable element, absolute reading) or a Wheatstone bridge (matched divider pair, differential reading). The physics in the front box changed; the bridge to the ADC barely did.

The equation cheat-sheet

ConceptEquationWorked anchor
Voltage dividerVout = Vin·R/(R₁+R)R=R₁ → Vout = Vin/2
ADC mappingcount = 1023·Vout/Vref2.5 V on 5 V ref → 512
Thermistor (Beta)R = R₀·eβ(1/T−1/T₀)0 °C → 16 kΩ → Vout 1.14 V
Steinhart–Hart1/T = A + B·lnR + C·(lnR)³lab-grade thermistor fit
Platinum RTDR = R₀(1+αT)100 °C → 139.25 Ω
Thermocouple (Seebeck)V = S·ΔTType-K, 41 µV/°C
TMP36T = 100·Vout − 500.75 V → 25 °C
Ultrasonic ToFd = v·t/2340·0.010/2 = 1.7 m
Hall effectVH = −I·B/(n·e·d)VH ∝ B
Wheatstone bridgeVout=Vin[R₃/(R₃+R₄)−R₂/(R₁+R₂)]balanced when R₁/R₂=R₄/R₃

Choosing a sensor — the decision in one breath

You want…PickBecause
Cheap, sensitive temp, hobbyNTC thermistorpennies, huge swing — pay with nonlinearity
Linear, accurate temp, labPt100 RTDstraight line, but tiny ΔR needs care
Very high temperatureType-K thermocouple−200 to +1350 °C; needs cold-junction comp
Easy, plug-and-play tempTMP36 / DS18B20linear/digital out, almost no code
Distance to a wallUltrasonic / IRtime-of-flight or reflectance, no contact
Tiny force / weightStrain gauge + bridgedifferential reading on zero, amplifiable
Magnetic field / positionHall-effect ICcontactless, switch or linear
The thread through the whole book. A sensor is only the front half of a control loop. It tells the microcontroller what the world is doing; the micro then decides; then an actuator (Chapter 15, motors) changes the world; and the sensor reads the result. Sensing, deciding, acting, repeat. This chapter built the "what is the world doing?" half — transduce the physics, condition it into a voltage, digitize it, and calibrate it back into honest units.

Where these ideas go next

"The world speaks in degrees and centimeters; the microcontroller listens only in counts. A sensor is the interpreter standing between them."

You can now trace any measurement from physics to ADC count and back to real units. The robot can finally see the wall and feel the heat.

The Seebeck effect — the basis of a thermocouple — requires what?
← Ch 5: Optoelectronics Ch 7: Hands-On →