Sensor Mounting Design
Sensor Mounting Design
Overview
Section titled “Overview”Move a sensor and its reading becomes wrong — in humidity, gas, ranging and presence projects this is close to inevitable. Mounting design answers four questions: which way it faces, what it can see, how air moves, and how it gets replaced. By the end you will be able to:
- Set orientation and no-shadow zones from the sensing principle
- Compute field-of-view coverage from aperture, lens and distance so you avoid “visible but inaccurate”
- Design vent paths and membranes to balance ingress protection against response time
- Make the sensor a calibratable, replaceable part instead of a dead corner soldered to the main board
Prerequisites
Section titled “Prerequisites”- Completed Chapter 23 Sections 1–3 and Chapter 25 Section 10 (presence detection)
- The sensor family is known (humidity / gas / ultrasonic / ToF / PIR / mmWave / thermal)
- You have comparison test conditions (same environment, a controllable heat or gas source)
Key Concepts
Section titled “Key Concepts”Orientation: principles first
Section titled “Orientation: principles first”| Sensor | Preferred orientation | Reason |
|---|---|---|
| Humidity/temperature (SHT3x, DHT class) | Side-facing or downward, ventilated all round | Avoids dust settling and drops landing directly; upward openings get dripped on |
| Gas (MQ series) | Height set by gas density versus air | Heavier-than-air targets (LPG, propane) need low mounting; lighter ones (natural gas, hydrogen) need high; smoke rises with warm air so mount it near the ceiling |
| PIR | Sidelong and slightly downward, away from heat sources and air jets | The Fresnel lens sectors define sensitivity; facing a heat source causes false alarms |
| mmWave presence | Eye-level or slightly down, never aimed at partitions | It passes non-metals, so orientation decides the chance of sensing the next room |
| Ultrasonic ranging | Perpendicular to the target face, unobstructed aperture | Neither the transmit nor receive transducer may be covered by a membrane or rib |
| ToF / IR ranging | Towards the target, out of direct sunlight | Strong light lifts the noise floor; the window must transmit near-infrared |
| Thermal array (8×8 etc.) | Aimed at the region of interest, window must pass long-wave IR | Ordinary glass and plastics absorb long-wave (Chapter 25 Section 11) |
The gas-height rule is the most commonly botched item on site. Write it into the drawing and the manual (low or high, with the reason) — never leave it to verbal training.
Field-of-view geometry: calculate, then measure
Section titled “Field-of-view geometry: calculate, then measure”Every optical-class sensor deserves a coverage drawing:
- With field angle θ (half angle α = θ/2) at distance d, spot diameter is roughly
2 · d · tan(α). Use it to check whether the target fills the field, and whether nearby structure intrudes at the edge - Edge effects: aperture edges, stiffening ribs and light pipes entering the field create stray reflections and ghost echoes. Keep aperture edges at least one spot radius away from the optical axis
- Anything in front of the sensor changes the result: dust mesh, cosmetic trim, sealing membranes. Quantify by A/B measurement rather than assumption
- Ultrasonic and PIR do not follow straight-ray optics — the first relies on reflection and beam cone, the second on lens sectors. Build the coverage map by measurement (step an occluder or reflector across the target plane at fixed intervals and record where triggering starts and stops)
Vent cavities and response time
Section titled “Vent cavities and response time”A sensor inside a sealed pocket reads the pocket, not the room. Consequences:
- Response time stretches markedly (gas and humidity worst)
- Internal self-heating lifts temperature and humidity readings (LDO, MCU, heated gas sensors are sources)
- Day-night swings condense inside, and the humidity value gets “stuck” (same mechanism as Chapter 25 Section 10)
Options in ascending protection order:
- Plain aperture (poor against dust)
- Labyrinth vent (lengthens the water and dust path while still exchanging air)
- Breathable waterproof membrane (solves IP and breathing at once, but adds attenuation for ultrasonic and some optics — measure it)
- Potting / full seal with the sensor led out externally (best protection, at the cost of an off-board probe)
Order of decision: fix the IP rating first, then pick the vent architecture, then measure response time. If response is too slow, increase vent area or move to an external probe — do not quietly downgrade the protection claim.
Thermal and mechanical isolation
Section titled “Thermal and mechanical isolation”- Keep humidity and gas probes away from heat sources (LDO, DC-DC, MCU, heaters) by whatever distance your measured thermal map justifies — scan with an IR thermometer
- Add insulating ribs or an air gap so the shell wall does not conduct heat to the probe
- In vibrating installations (fans, pumps, compressors) isolate the probe with compliant mounts or its own bracket, protecting solder joints and diaphragms
- Route probe cabling away from power wiring; use shielded or twisted pairs where switching noise can couple into I2C or analogue lines
Calibratable and replaceable: the second job of a mount
Section titled “Calibratable and replaceable: the second job of a mount”Gas and humidity sensors drift; they are consumables. The mount must respect that:
| Design choice | Benefit | Cost |
|---|---|---|
| Probe on its own small board with a board-to-board connector | Swappable alone, calibration independent of main board, tolerates batch mixing | Connector cost plus one more failure point |
| Soldered directly to the main board | Cheapest, mechanically simple | Drift means board-level rework; no field replacement |
| Probe led out through a cable gland | Best protection, flexible positioning | Cable and gland become new failure points; costlier |
Selection criterion: will the field need calibration or replacement? Yes → sub-board or led-out probe. No (and lifetime matches the product) → solder it. Do not write “replaceable” on the drawing while the mechanics make opening impossible.
Alignment and proofing: use locating sleeves or asymmetric shapes so the probe can only sit one way; with gland entries, confirm the washer seats on a flat surface.
Verification
Section titled “Verification”| Check | Expected result | Verified |
|---|---|---|
| Coverage mapping (PIR / mmWave / optical) | Measured trigger boundary matches the drawing’s sectors | |
| Occlusion sensitivity | Effect of mesh, trim or membrane quantified with before/after data retained | |
| Response time comparison | Rise and fall times recorded for bare board, enclosed, and with membrane | |
| Self-heating interference | Under full load, temperature at the probe is inside the allowed band (IR measured) | |
| Gas position test | Lighter or igniter released at the correct height triggers as designed | |
| Condensation cycle | After thermal cycling no condensation inside, or the vent/membrane works | |
| Replacement drill | Probe swapped following the manual, without removing the main board or special tools | |
| Ultrasonic with membrane | If an acoustic membrane is used, range error stays within tolerance |
Troubleshooting
Section titled “Troubleshooting”Issue 1: humidity reads high and never comes down
Section titled “Issue 1: humidity reads high and never comes down”Cause: condensation in the cavity or a contaminated probe; the sensor may also sit against a cold wall.
Solutions:
- Check orientation and vent path — no upward apertures, no contact with cold surfaces
- Add a labyrinth or breathable membrane to equalise pressure and vapour
- Recover in mild dry air; if it recurs, relocate the probe
Issue 2: temperature reads above ambient
Section titled “Issue 2: temperature reads above ambient”Cause: internal self-heating plus a sealed structure.
Solutions:
- Find the hot spots with an IR thermometer and re-place the probe
- Add venting or insulating ribs; keep the probe away from LDO and DC-DC
- If the design must stay sealed, move to a led-out probe and accept the cost and sealing consequences
Issue 3: gas alarms fire constantly or never
Section titled “Issue 3: gas alarms fire constantly or never”Cause: mounting height mismatched to gas density; airflow sweeps the target away from the sensor; warm-up and threshold logic unhandled (Chapter 25 Section 6).
Solutions:
- Re-check height against gas density (LPG low, natural gas high) and state it in the installation notes
- Avoid strong drafts and door-gap airflow paths
- Verify the warm-up quiet period and the N-consecutive-exceedance rule
Issue 4: ranging gets worse after enclosing
Section titled “Issue 4: ranging gets worse after enclosing”Cause: ultrasonic transducers covered by membrane or ribs; wrong ToF window material (ordinary glass blocks long-wave but passes near-infrared, depending on the device); stray reflections at aperture edges.
Solutions:
- Remove one obstruction at a time and A/B compare (bare / windowed / membranes)
- Choose window material and thickness for the device’s wavelength band, measuring the transmission effect
- Chamfer aperture edges and keep them off the optical axis to cut stray echoes
Best Practices
Section titled “Best Practices”- Do: fill one mounting-constraint sheet per sensor: orientation, aperture size, airflow need, keep-out, replacement method, verification method and result
- Do: verify coverage and response by measurement; use geometry for sizing, never as the pass criterion
- Do: design drifting consumables (gas, humidity) as replaceable parts, with the calibration procedure in the manual
- Do: resolve protection-versus-airflow conflicts with labyrinths or membranes, not by sealing everything shut
- Don’t: face humidity apertures upward or press the probe against a cold wall
- Don’t: ignore gas density when choosing mounting height
- Don’t: solder the probe into boards that require field calibration
Summary
Section titled “Summary”Key points of this section:
- Orientation follows the principle: humidity avoids drips and dust, gas follows density, PIR follows lens sectors, optics follow field angle, thermal follows wavelength
- Compute then measure the field: geometry sizes the aperture, but acceptance is a measured boundary with occlusion A/B data
- A sealed cavity changes the reading: slower response, self-heating bias, condensation sticking — solved by vent architecture or an external probe
- Probes are consumables: calibratability and serviceability are the mount’s second duty, chosen by a stated criterion
- The mounting-constraint sheet is a deliverable, turning sensors from soldered dots into engineered components
Next section: dust and water protection — IP ratings, sealing structures, and the condensation-versus-breathing trade-off.
We provide ESP32 ODM design-to-manufacturing services. From prototype to production — the team behind this tutorial can build it with you.
💡 Mention tutorial.imagrove.com in your Alibaba chat with us — get 10% off your custom project quote.
First published attutorial.imagrove.com/enclosure-design/04-sensor-mounting-design/Please credit Imagrove and link back to this page when quoting or republishing.
Questions or issues with this tutorial?
Sign in with GitHub to leave a comment. If a step fails for you, tell us — we verify it and update the tutorial.
© Imagrove · ESP32 IoT Tutorial