The problem
Septic tanks generate methane as waste decomposes, and the gas accumulates in the sealed headspace — manual inspection without testing the atmosphere has caused asphyxiation accidents. Separately, nobody knows a tank needs desludging until it overflows or backs up. Both problems are sensing problems: continuous gas and level measurement with automatic ventilation when gas crosses a threshold. This project builds that on an ESP32 with an MQ-4 methane sensor, an ultrasonic level sensor and a relay-driven exhaust fan, demonstrated on a sealed model tank with a live safety dashboard showing gas trends and fan state.
How it works
- The MQ-4 sensor in the sealed tank's headspace is read by the ESP32, converted to an indicative ppm value against the calibrated baseline.
- The ultrasonic sensor measures the distance to the sludge surface and converts it to a level percentage of the known tank depth.
- Every 10 seconds the node publishes methane ppm, level percentage, temperature and fan state to the companion dashboard over Wi-Fi.
- When methane reaches 5,000 ppm (10% LEL, a design-target action threshold), the relay starts the exhaust fan and the dashboard banner switches to the ventilation-active state.
- The fan runs until gas falls below the 3,500 ppm reset band, with every start and stop timestamped in the event log.
- The dashboard's desludge estimate divides the remaining capacity by the measured fill rate; the calibration procedure documents baseline setting and fan-trigger verification.
Tech stack:
- ESP32 (monitor node)
- MQ-4 methane gas sensor
- HC-SR04 ultrasonic level sensor
- DS18B20 temperature sensor
- Relay-driven 12 V exhaust fan
- HTML/CSS/JavaScript safety dashboard
- Arduino IDE (C/C++ firmware)
- Sealed demo tank rig
| Parameter | Value |
|---|---|
| Gas sensor | MQ-4, methane indicative range approximately 300–10,000 ppm (design target) |
| Fan trigger | 5,000 ppm = 10% LEL of methane (design target, configurable) |
| Fan reset band | Below 3,500 ppm (design target) |
| Level sensing | 2–400 cm ultrasonic range (HC-SR04 datasheet) |
| Sample interval | Every 10 s (design target) |
| Fan | 12 V DC exhaust fan via relay (design target) |
| Dashboard | Single-file companion web app served over Wi-Fi |
Project features
- [Methane sensing] MQ-4 sensor in the tank headspace tracks methane continuously; readings are shown in ppm on the dashboard with a 6-hour trend chart.
- [Automatic exhaust fan] Crossing 5,000 ppm (10% of methane's lower explosive limit) starts the exhaust fan automatically; it stops when gas falls back below the reset band.
- [Sludge-level measurement] Ultrasonic sensor reports the sludge level as a percentage of tank capacity with a visual tank gauge on the dashboard.
- [Desludge estimate] The dashboard extrapolates the fill trend into an estimated days-to-desludge figure, turning a level reading into a maintenance plan.
- [Safety dashboard] Live gas gauge, level gauge, fan state, 24-hour peak reading and a timestamped event log of every fan start/stop and threshold crossing.
- [Headspace temperature] DS18B20 temperature reading included, since gas sensor response and decomposition rate both vary with temperature.
- [Buyer-run calibration] MQ sensors are indicative devices; the kit includes a calibration procedure so the student sets the clean-air baseline and verifies the fan trigger on their own build.
What is included
- Working ESP32 monitor node (MQ-4, ultrasonic, temperature, relay/fan stage)
- Sealed demo tank rig with sensor and fan mounting
- Companion safety dashboard web app (gas gauge, trend chart, tank gauge, fan state, event log)
- Arduino firmware source with documented threshold constants
- Wiring diagram and rig assembly notes
- Buyer-run gas sensor calibration and fan-trigger verification procedure
- Project report PDF (septic gas hazards, sensor theory, LEL thresholds, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (MQ sensor working, LEL concept, ultrasonic ranging, relay control)
Limitations & prerequisites
- The MQ-4 is an indicative semiconductor sensor, not a certified gas detector — readings are approximate and the buyer calibrates the baseline; it must never be presented as a calibrated safety instrument.
- Demonstrated on a sealed model tank; real septic installations require certified equipment and professional installation, which this student build does not claim to be.
- Ultrasonic level accuracy depends on a calm sludge surface; foam or crust affects readings.
- The 5,000 ppm fan trigger is a design target verified by the buyer's own procedure, not a measured certified trip point.
- MQ sensors need a warm-up period (approximately 24 hours for stable baseline per the procedure) before trustworthy readings.
Frequently Asked Questions
Why is a septic tank dangerous?
Decomposing waste releases methane, which accumulates in the sealed headspace. Methane is explosive between 5% and 15% in air (its LEL–UEL band), and it displaces oxygen — which is why untested manual entry into tanks has caused fatalities.
What does 5,000 ppm mean?
Methane's lower explosive limit is 5% by volume, i.e. 50,000 ppm. The fan trigger at 5,000 ppm is 10% of LEL — a standard early-action fraction used in gas safety practice, set here as a design target.
How accurate is the MQ-4?
It is an indicative sensor: good for trends and threshold alarming after calibration, not a laboratory measurement. The kit's calibration procedure sets the clean-air baseline, and the report states the limits honestly.
What does the dashboard show?
Live methane ppm with a 6-hour trend chart and the fan-trigger line marked, a sludge-level tank gauge, fan state, 24-hour peak reading, days-to-desludge estimate and a timestamped event log.
Is this project suitable for a final-year project?
Yes — for IoT, Embedded Systems and Electronics programs. It combines gas sensing, level measurement, relay actuation and a safety dashboard, with unusually strong, honest viva material on sensors and safety limits. Suitable for B.E./B.Tech final-year projects in IoT, Embedded Systems and Electronics.
Components & software requirements
- ESP32 (monitor node)
- MQ-4 methane gas sensor
- HC-SR04 ultrasonic level sensor
- DS18B20 temperature sensor
- Relay-driven 12 V exhaust fan
- HTML/CSS/JavaScript safety dashboard
- Arduino IDE (C/C++ firmware)
- Sealed demo tank rig
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.