LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA pitot tube has two openings: one faces the wind and feels total pressure, the other is on the side and feels still pressure. The difference is the dynamic pressure, and air speed follows from v = sqrt(2 x pressure / air density). An MPXV7002DP differential sensor turns that difference into a voltage centred on 2.5 V, which a Nano reads on an analog pin. The same code also works for duct airflow checks.
Keep fingers away from fan blades when testing in front of a fan.
Do not blow into the sensor ports with your mouth.
Tick anything you already have and the total updates.
MPXV7002DP airspeed sensor with a pitot tube set
MPX10DP 0-10 kPa sensor for higher pressures
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB power is fine. Keep the sensor tubes short and unkinked.
pitot_airspeed.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const float RHO = 1.20; // air density in kg/m3 near sea level
float zeroV;
float avgVolts(int n) {
long s = 0;
for (int i = 0; i < n; i++) { s += analogRead(A0); delay(2); }
return (s / (float)n) * 5.0 / 1023.0;
}
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
zeroV = avgVolts(200); // zero pressure reading, sensor must be in still air
}
void loop() {
// MPXV7002DP: Vout = 5 V x (0.2 x P[kPa] + 0.5), so P[Pa] = (V/5 - 0.5) / 0.2 x 1000
float v = avgVolts(20);
float pa = (v - zeroV) / 5.0 / 0.2 * 1000.0;
float speed = pa > 0 ? sqrt(2.0 * pa / RHO) : 0; // m/s
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(3); oled.setCursor(0, 4); oled.print(speed, 1);
oled.setTextSize(1); oled.print(" m/s");
oled.setCursor(0, 44); oled.print(speed * 3.6, 0); oled.print(" km/h ");
oled.print(pa, 0); oled.print(" Pa");
oled.display();
delay(200);
}
Re-zero in still air, away from fans. The sketch zeros once at start-up.
The tubes are probably swapped. Reverse them.
Below about 3 m/s the pressure is only a few pascals and the sensor is noisy; this is the sensor's limit.
The MPXV7002DP covers about plus or minus 2 kPa, enough for air speeds up to about 60 m/s.
Yes, thin air reads low. Change RHO for high places.
Yes: put the pitot in the middle of the duct, then multiply speed by the duct's cross-section area.
6 parts: Generic Nano CH340 Development Board (Soldered), MPXV7002DP Airspeed Sensor & Pitot Tube Set for APM, 0.96" OLED Display 128x64, MPX10DP Differential Pressure Sensor, 0-10 kPa, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 2 hours. The build on this page has 5 steps.
No. This page has the complete, tested code (pitot_airspeed.ino).
About ₹3,379 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
What dynamic pressure is; Zeroing an analog pressure sensor; Converting pressure to speed.
Keep fingers away from fan blades when testing in front of a fan. Do not blow into the sensor ports with your mouth.
Ideas that reuse this build: Wi-Fi fridge thermometer. They are listed under Take it further on this page.
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
See the smoke level live on a crisp screen and get a loud warning when it spikes.
An infrared eye that spots an open flame and raises the alarm.
Walk into the room and it sounds the alarm: the classic first security build.
Learning project. Check every circuit and the datasheet of each part before you power it up.