LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe DHT11 measures temperature and humidity and sends both over a single data wire. Decoding that signal by hand is fiddly, so we use a library: two lines set it up and dht.readTemperature() returns degrees Celsius as a decimal number. This is your first project that uses a library, and the first that works with float values.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 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.
The brain of every Spark Kit project
DHT11 temperature and humidity module
Female-to-female or male-to-female leads for the modules
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
spark_kit_13_temperature_checker.inoVerify & upload in Electrolark// Spark Kit 13: temperature checker
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float t = dht.readTemperature(); // degrees C
if (isnan(t)) {
Serial.println("DHT11 not found: check the wiring");
} else {
Serial.print("Temperature: ");
Serial.print(t, 1);
Serial.println(" C");
}
delay(2000); // the DHT11 needs about 2 s between reads
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
Check DATA is on D2 and that VCC and GND are not swapped. Wait 2 seconds after power-up.
Install "DHT sensor library" by Adafruit and "Adafruit Unified Sensor" from the Library Manager.
About plus or minus 2 degrees C, in whole-degree steps, which is fine for a room. A DHT22 is more precise.
Yes: use dht.readTemperature(true).
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
5 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, Generic DHT11 Digital Temperature & Humidity Sensor Module, Dupont Jumper Wires (40 pcs) and Arduino Sensor Shield V5 Expansion Board. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 30 minutes. The build on this page has 4 steps.
No. This page has the complete, tested code (spark_kit_13_temperature_checker.ino).
About ₹436 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Installing and using a library; Reading a digital sensor; Working with float values.
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.