LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsMould grows when the relative humidity stays above about 65-70% for days. The CHT8305 is a tiny I2C temperature and humidity sensor on a small module. The sketch reads it directly: it points at register 0, waits for the conversion, then reads four bytes, two for temperature and two for humidity. If the humidity stays high for an hour, it beeps once an hour until you open the door or add a desiccant.
Tick anything you already have and the total updates.
CHT8305 mini temperature and humidity module
Follow the colours: red is power, dark grey is ground, blue is a signal.
A USB power bank or phone charger.
damp_alarm.inoVerify & upload in Electrolark#include <Wire.h>
const uint8_t CHT = 0x40;
const float LIMIT = 70.0;
float avg = 50;
bool readCht(float &t, float &rh) {
Wire.beginTransmission(CHT); Wire.write(0x00); if (Wire.endTransmission() != 0) return false;
delay(25); // conversion time
if (Wire.requestFrom(CHT, (uint8_t)4) != 4) return false;
uint16_t rt = Wire.read() << 8 | Wire.read();
uint16_t rr = Wire.read() << 8 | Wire.read();
t = rt * 165.0 / 65535.0 - 40.0;
rh = rr * 100.0 / 65535.0;
return true;
}
void setup() { Wire.begin(); Serial.begin(9600); pinMode(5, OUTPUT); pinMode(6, OUTPUT); }
void loop() {
float t, rh;
if (readCht(t, rh)) {
avg = avg * 0.98 + rh * 0.02; // slow average over about an hour
Serial.print(t, 1); Serial.print(" C "); Serial.print(rh, 0); Serial.print(" % avg "); Serial.println(avg, 0);
}
bool damp = avg > LIMIT;
digitalWrite(6, damp);
static unsigned long lastBeep = 0;
if (damp && millis() - lastBeep > 3600000UL) { tone(5, 2000, 300); lastBeep = millis(); }
delay(60000);
}
No reply from the sensor; check SDA/SCL and the 3.3 V supply.
Water or condensation on the sensor; dry it and keep it off cold walls.
Your room is humid all season; raise LIMIT or use the LED only.
Opening the door or breathing near it gives short spikes; mould needs days of damp air.
Days, since it reads once a minute; some power banks switch off at low current, so check yours.
About 2-3% RH, enough for a damp warning.
7 parts: CHT8305 MINI Digital Temperature & Humidity Sensor Module, Generic Nano CH340 Development Board (Soldered), Buzzer Module 3.3–5V, 5mm LED by Colour (Pack of 10), Resistor Assortment Kit (30 Values), 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.
No. This page has the complete, tested code (damp_alarm.ino).
About ₹556 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Reading a sensor over I2C without a library; Converting raw counts to degrees and %RH; Alarming on a trend, not a single reading.
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.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.