LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsWork out what the air actually feels like by combining temperature with humidity, using the official heat index formula. Sweat cools you by evaporating, and humid air slows evaporation down, so 32°C at 80% humidity feels far hotter than 32°C at 30%. The Rothfusz regression captures that with nine terms fitted to real data. It is written in Fahrenheit, so the sketch converts in, computes, and converts back out, which is a useful lesson in itself: use a formula in the units it was designed for rather than trying to re-derive it.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
Every part for this build comes in the Geekobot Titan Kit box, a Geekobot exclusive, together with the parts for all 120 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
ESP32 DevKit V1 (38-pin): the brain of every Titan Kit project, with Wi-Fi and Bluetooth
Male-to-female and female-to-female leads for the modules
DHT11 temperature and humidity sensor
ESP32 expansion board from the kit: every GPIO has its own S, V, G header
Follow the colours: red is power, dark grey is ground, blue is a signal.
titan_kit_041_heat_index_calculator.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>
#define DHTPIN 13
#define DHTTYPE DHT11
Adafruit_SSD1306 display(128, 64, &Wire, -1);
DHT dht(DHTPIN, DHTTYPE);
float toF(float c) { return c * 9.0 / 5.0 + 32.0; }
float toC(float f) { return (f - 32.0) * 5.0 / 9.0; }
float heatIndexC(float tempC, float humidity)
{
float T = toF(tempC);
float R = humidity;
// Simple formula is accurate enough below about 80 F
float simple = 0.5 * (T + 61.0 + ((T - 68.0) * 1.2) + (R * 0.094));
if ((simple + T) / 2 < 80.0)
{
return toC(simple);
}
float hi = -42.379
+ 2.04901523 * T
+ 10.14333127 * R
- 0.22475541 * T * R
- 0.00683783 * T * T
- 0.05481717 * R * R
+ 0.00122874 * T * T * R
+ 0.00085282 * T * R * R
- 0.00000199 * T * T * R * R;
return toC(hi);
}
void setup()
{
Serial.begin(9600);
dht.begin();
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C))
{
Serial.println("OLED not found");
while (true) { }
}
display.setTextColor(SSD1306_WHITE);
}
void loop()
{
float t = dht.readTemperature();
float h = dht.readHumidity();
if (isnan(t) || isnan(h))
{
delay(2000);
return;
}
float hi = heatIndexC(t, h);
float difference = hi - t;
Serial.print("Actual ");
Serial.print(t);
Serial.print("C Feels like ");
Serial.println(hi);
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.print("HEAT INDEX");
display.setCursor(0, 14);
display.print("Actual: ");
display.print(t, 1);
display.print("C ");
display.print(h, 0);
display.print("%");
display.setTextSize(2);
display.setCursor(0, 28);
display.print(hi, 1);
display.print((char)247);
display.print("C");
display.setTextSize(1);
display.setCursor(0, 52);
display.print("Feels ");
if (difference > 0.5)
{
display.print(difference, 1);
display.print("C hotter");
}
else
{
display.print("close to actual");
}
display.display();
delay(2000);
}
Use a micro-USB data cable (some cables only charge), install the CP210x or CH340 driver if no port appears, pick Tools > Board > ESP32 Dev Module and hold the BOOT button on the board until the upload starts.
Check SDA on GPIO21 and SCL on GPIO22, power from 3V3, and that the sketch uses address 0x3C (some boards are 0x3D).
Check that DATA goes to the GPIO in the sketch, and wait two seconds between reads: the DHT11 is slow.
Sweat cools you by evaporating, and humid air slows evaporation down, so 32°C at 80% humidity feels far hotter than 32°C at 30%. The Rothfusz regression captures that with nine terms fitted to real data. It is written in Fahrenheit, so the sketch converts in, computes, and converts back out, which is a useful lesson in itself: use a formula in the units it was designed for rather than trying to re-derive it.
Actual: 30.0C 70% on the top line. A large 35.2°C reading below it. Feels 5.2C hotter at the bottom.
Yes. It is project 41 of 120 in the Geekobot Titan Kit, in level 9 (Environmental science). Every part on the list comes in the kit box, and you can also buy the parts one by one from the list above.
No. Every Titan Kit project is wired on the ESP32 expansion board and the breadboard with jumper wires.
6 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Dupont Jumper Wires (40 pcs), 0.96" OLED Display 128x64, Generic DHT11 Digital Temperature & Humidity Sensor Module and ESP32 38-Pin Expansion Board. 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 30 minutes. The build on this page has 5 steps.
No. This page has the complete, tested code (titan_kit_041_heat_index_calculator.ino).
About ₹850 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Complex maths formulas in code; Why humidity changes perceived temperature; Converting units into and out of a formula; Choosing between a simple and a full model by range.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
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.