class 14 · unit II · optical, electromagnetic, environmental, biological, chemical
The rest of the sensor zoo
Light, radio, heat, gas, heartbeats. Most of these sensors are slow and cheap; a few carry rich signals that need real ML. Every one of them has its own way of fooling you.
A guided tour rather than a board lab. Theory runs to slide 13; the datasheet exercise is one block at the end (slides 14 to 16). Prepare five datasheet excerpts in advance.
last class's exit ticket
Walking or cycling, from the wrist?
rhythm
steps swing the arm about twice a second
rotation
the gyroscope sees the swing; handlebars hold it still
rough road
the hard case: vibration that looks like walking
That last box is today's theme. Every sensor has a situation where it confidently reports the wrong thing.
Two minutes. Ask what extra input would fix the rough-road case (speed from GNSS; a phone in the pocket as a second sensor).
Four triggers from a ₹100 motion sensor. How many were people?
A passive infrared (PIR) sensor does not see people. It sees heat moving across its view. Anything warm that moves, or anything that warms up, can fire it.
If you have a PIR module, wave at it and then hold a warm mug in front of it. The price is approximate. The cat is deliberate: for a burglar alarm it is a false alarm; for a pet feeder it is the whole point.
optical
A PIR sensor splits the room into zones and watches heat move between them.
The plastic dome on a PIR module is a Fresnel lens that creates these zones. Because it responds to change, a person standing perfectly still disappears. That is why PIR is a wake-up trigger, not a presence sensor.
Optical and electromagnetic: six sensors, six ways to be fooled.
ambient light
light level
use: screen brightness, day/night
fooled by: shadows, reflections
PIR
heat moving across zones
use: wake a camera
fooled by: heaters, sunlight, pets
spectral
light at several wavelengths
use: crop health, ripeness
fooled by: needs calibration to lighting
Hall effect
magnetic field
use: door open/closed, motor speed
fooled by: nearby magnets
RF strength
how strong Wi-Fi / BLE signals are
use: room-level presence
fooled by: furniture and people change it
mmWave radar
reflected radio waves: range and motion
use: presence, breathing, falls
fooled by: reflections off walls and metal
Read the red line on each tile aloud. The habit to build: for every sensor, ask "what else would trigger this?" before trusting it.
electromagnetic · five minutes on radar
mmWave radar: send a chirp, listen for the echo.
delay → distance
The echo's delay gives the range. Resolution depends on how wide the sweep is:
ΔR = c ÷ (2 × bandwidth)
4 GHz of sweep → about 3.75 cm.
shift → speed
Motion shifts the echo's frequency (Doppler): radar sees speed directly, down to a chest rising as you breathe.
Common bands for these sensors are around 60 GHz and 77 GHz (FMCW chirps). 3 × 10⁸ ÷ (2 × 4 × 10⁹) = 0.0375 m. If mmWave radar is your own research area, a minute of your real data here is the most memorable part of the class.
range, 0 to 6 m ↑
← moving away · velocity · moving closer →
try it live
What the radar's model actually sees: a range–Doppler map.
No image of a face, works in the dark and through thin plastic or fabric: a strong option for homes, hospitals and bathrooms. And it is an image, so Class 7's CNNs apply.
Simulated maps. The bright vertical line in the middle is everything that is not moving (walls, furniture): zero velocity. Ask which scene a fall detector would care about, and which scene could fool it (the fan).
Radiation, briefly: the same chain, different particles.
Geiger–Müller tube
counts ionising radiation
each particle is a click; the model sees counts per minute
solid-state detectors
radiation and X-rays
medical devices, security scanning
UV sensor
sun exposure
wearables, weather stations
The point is not the physics. It is that Class 10's chain still holds: transducer, conditioning, ADC, bytes. Once you can read one datasheet, you can read these.
Two minutes only; it is in the prescribed list but rarely in student projects.
chemical · try it live
One cheap gas sensor reacts to almost everything. Three can tell smells apart.
smell
Illustrative responses, not measured. Metal-oxide (MOX) sensors change resistance in the presence of many gases: that cross-sensitivity is a weakness for one sensor and a feature for several, because a classifier can learn the pattern. This is "combining features and sensors" from Unit III.
Environmental sensors change over minutes, days and months.
temperature and humidity
The board heats its own sensor. Mount it away from the chip, or the S3 measures itself (Class 10's internal sensor).
what ML has to cope with
A model trained in week 1 sees a different baseline in month 6. Recalibrate, or learn relative change rather than raw values.
Class 6's data drift, physically. Particulate (PM2.5) sensors also read high in humid air; NDIR CO₂ sensors are more stable but use more power. Exact warm-up times are in each datasheet.
biological
Two ways to see a heartbeat.
ECG · electrical, needs skin contact
Sharp, detailed: rhythm problems are visible. Needs two contact points (a finger on the watch, chest electrodes).
PPG · light reflected from blood, wrist
Always on, no effort. But motion swamps it, and accuracy has been reported to vary with skin tone.
This is Class 3's watch cascade in sensor terms: cheap, always-on PPG screens; careful ECG confirms. And Class 9's fairness point made concrete: a model inherits its sensor's biases.
Synthetic waveforms. The skin-tone finding has been reported in several studies of optical pulse sensors and pulse oximeters; present it as a documented concern, not a precise number.
The slow sensors, and what each needs from you.
sensor
measures
watch out for
temperature + humidity
air conditions
self-heating from the board; slow response
MOX gas
changes in many gases at once
warm-up, drift, cross-sensitivity
NDIR CO₂
carbon dioxide specifically
more power and size
particulate (PM2.5)
dust and smoke particles
humidity inflates readings
pH, conductivity probes
water chemistry
regular calibration in known solutions
Many of these sample once every few seconds or minutes. The ML is often simple; the hard part is trusting the numbers over months.
Link back to BLERP's E and R: a soil or water sensor on a farm runs for months on a battery with no network. Slow sensors suit duty cycling (Class 10).
our running example
A PIR sensor as the doorbell's first stage.
Class 5's cascade, with a sensor as the first stage instead of a model. The PIR's false alarms cost a little battery; the camera model filters them out.
End of theory. Hand out the datasheet excerpts and move to the exercise block.
exercise · teams of four · one excerpt per team
Read a datasheet you have never seen.
20:00
1
MOX gas sensor
2
PIR module
3
time-of-flight distance
4
PPG heart-rate sensor
5
load-cell amplifier
Two pages each. Fifteen minutes to fill the worksheet; then one team presents in two minutes, and the class hunts for the trap they missed.
Assign by team number modulo 5. Prepare the excerpts in advance from manufacturers' public datasheets: the features page plus the electrical characteristics table is usually enough. Pick parts students could plausibly buy.
Five traps on almost every datasheet.
1 · "typical" is not a promise
Design for the min and max columns. Typical is what an average part does on a good day.
2 · absolute maximum ≠ operating
Absolute maximum ratings are where the part gets damaged. Use the recommended operating conditions.
3 · read the test conditions
"At 25 °C, 3.3 V, after 48 h burn-in." Your device is not in that lab.
4 · units hide meaning
LSB per g, dBFS, %RH, ppm, kΩ in clean air. Convert before you compare two parts.
5 · the graph says more than the table
Response versus temperature, humidity, time. The drift lives in the curves.
Leave this up for the first five minutes of the exercise. Each team should find at least one of these five in their excerpt.
exercise · fill these six boxes as a team
Five numbers, and one trap.
physical quantity
what does it actually respond to?
range and resolution
with units, and under what conditions
rate or response time
how fast can it report a change?
power
active and sleep current, and warm-up time
interface
analog, I2C, SPI, UART, a single digital pin?
the trap
one thing that could fool it, from the datasheet itself
The first five boxes are Class 10's five datasheet numbers. The sixth is today's theme.
exit ticket · on paper, before you leave
A hospital wants to know if a patient gets out of bed at night, without cameras. Name two sensors from today, and one way each could give a false alarm.
That closes the sensors. Next class: what actually runs the maths. Processors, memory, and timing a multiply-add on the S3.
Good pairs: mmWave radar (fooled by a moving curtain or fan), a load cell or pressure mat under the bed (fooled by the patient shifting, or a visitor sitting), PIR (fooled by a nurse walking past). Best answers combine two.