Build B-06

Mine Worker Safety Node

A worker who is struck by a vehicle or caught in an accident needs to be detected even when nobody sees it happen.

Status
TESTING
Year
2026
Domain
Embedded systems / Wearables / Sensing
Stack
ESP32 DevKit V1 / Arduino / Web Serial / MQTT / Raspberry Pi

Artifact

ESP32 DevKit V1 pin map for the body sensor nodeSeven sensors on the right-hand header: flame on GPIO2, MQ-7 on GPIO5, DHT11 on GPIO18, shock on GPIO19, knock on GPIO21, heart rate on GPIO22 and PIR on GPIO23. All on 3V3. Header positions are schematic.ESP32DEVKIT V13V3 SUPPLY36393435323325262714121323GPIO23 · HC-SR501 PIR22GPIO22 · Heart-rate sensor1321GPIO21 · Knock sensor19GPIO19 · Shock sensor18GPIO18 · DHT115GPIO5 · MQ-7 carbon monoxide171642GPIO2 · Flame sensor15
Pin assignments
GPIOSensorSignalFirst sketch
2Flame sensorDigital outputGPIO4
5MQ-7 carbon monoxideSensor outputnot yet wired
18DHT11Temperature and humidity datasame
19Shock sensorDigital outputGPIO16
21Knock sensorDigital outputGPIO17
22Heart-rate sensorPulse edges, best-effort BPMsame
23HC-SR501 PIRMotion outputnot yet wired

The fixed pin map of the ESP32 body sensor node. All sensors run on 3V3. Drawn from the final pin assignment; a photograph of the wearable is still to come.

Signal chain

  1. 01 · InputThe worker and the air around themFlame, temperature and humidity, shock, knock, pulse, carbon monoxide and movement.
  2. 02 · SensingSeven sensors on a wearableFlame (digital), DHT11, shock, knock, heart-rate pulse, MQ-7 and an HC-SR501 PIR, built into a uniform with a chest-mounted housing.
  3. 03 · ProcessingESP32 firmwareReads every sensor and calculates a best-effort BPM from pulse edges on GPIO22.
  4. 04 · ProcessingGateway Raspberry PiPlanned. The ESP32 sends over Wi-Fi and MQTT; the Pi normalises each worker’s readings and runs an anomaly model.
  5. 05 · OutputAlert and live dashboardA browser dashboard over Web Serial is the single real-time window today.

System architecture

Not documented yet.

Implementation

The node is an ESP32 DevKit V1 worn on the body as part of a mine worker safety system. It started as a single Arduino sketch printing flame, shock, knock, temperature, humidity and a pulse count to the serial port every five seconds, and grew into a wearable with seven sensors and a browser dashboard.

The hard problem has not been reading sensors. It has been deciding what counts as an accident. A shock sensor that fires on every step is useless, and one that only fires on a violent collision misses a fall. Three firmware versions have landed on either side of the right sensitivity, which is why this page says Testing and not Stable.

The architecture is deliberately split. The ESP32 stays close to the sensors and does as little as possible; a separate gateway Raspberry Pi (not the camera Pi of the vision link) will do the heavier work of normalising each worker’s baseline and spotting anomalies.

Measurements

No measurements recorded yet.

Source: No calibrated measurements have been recorded yet. Sensitivity has been judged by testing on the hardware.

Failures and iterations

  1. First sketch

    Flame, shock and knock sat on GPIO4, 16 and 17.

    Moved to GPIO2, 19 and 21 in the final pin map, which is now fixed.

  2. v2

    The Web Serial dashboard worked, but shock and knock were far too sensitive.

    Alerts re-targeted at a worker being hit by a vehicle or in an accident, not every bump.

  3. v3

    On real hardware it still flagged impacts constantly and escalated them to severe.

  4. v3.2

    Impact detection became too insensitive.

    The target is now a medium level between v3 and v3.2.

  5. v3.3

    The PIR sensor false-triggered and the CO sensor seemed stuck warming up.

    Sensor polarity is to be established by testing rather than assuming HIGH or LOW means detected.

Result

A working wearable that reads all seven sensors and streams them to a live dashboard, with impact detection not yet trustworthy.

Current status

TESTING

Impact detection is still being tuned on real hardware.

Next step

Settle impact sensitivity, move the transport to Wi-Fi and MQTT with the gateway Pi, then try a model running on the ESP32's own inputs to cut end-to-end lag. LoRa later.

Credits

Hari
Hardware, firmware, dashboard

Links

Firmware and dashboard are on the board and the bench, not in a public repository yet.

guest@hari: ~esc to close