LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA PTC heater limits its own surface temperature, which makes it a forgiving heater for small boxes. An Arduino Nano reads a 100k NTC thermistor and switches the heater with a relay, with one degree of hysteresis so the relay does not chatter. A 55 °C bimetal thermostat in series with the heater cuts the power if the code or the relay ever fails, so the box can never run away.
Keep the PTC heater on metal and away from foam, cloth and plastic.
Always fit the bimetal cut-out in series with the heater.
Do not leave a new build running unattended until it has been tested for several hours.
Tick anything you already have and the total updates.
12 V 30 W PTC heater with an aluminium shell
100k 3950 glass NTC thermistor
KSD9700 55 °C normally closed thermostat: hardware safety cut-out
KSD302 130 °C cut-out for hotter builds such as a filament dryer
Silent MOSFET switch instead of the relay; check its current rating covers the heater
RTD amplifier for higher accuracy with a PT100 probe
Waterproof PT100 probe to use with the MAX31865
Plug-in analog temperature module, simpler than a bare thermistor
Non-contact infrared sensor to check the heater surface
Sealed Bluetooth logger to record the box temperature over days
Follow the colours: red is power, dark grey is ground, blue is a signal.
Use a 12 V supply rated at least 3 A for the heater (sold separately) and a step-down or the USB port for the Nano. Join the grounds only if you power the Nano from the same supply.
warm_box.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const int NTC = A0, RELAY = 7;
const float SET_C = 40.0, BAND = 0.5; // on below 39.5, off above 40.5
const float R_FIXED = 100000.0, R25 = 100000.0, BETA = 3950.0;
bool heating = false;
float readC() {
float a = 0;
for (int i = 0; i < 16; i++) a += analogRead(NTC);
a /= 16.0;
float r = R_FIXED * a / (1023.0 - a); // NTC is on the 5 V side
float k = 1.0 / (1.0 / 298.15 + log(r / R25) / BETA);
return k - 273.15;
}
void setup() {
pinMode(RELAY, OUTPUT); digitalWrite(RELAY, LOW);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
float t = readC();
if (isnan(t) || t < -20 || t > 90) heating = false; // sensor fault: heater off
else if (t < SET_C - BAND) heating = true;
else if (t > SET_C + BAND) heating = false;
digitalWrite(RELAY, heating ? HIGH : LOW); // many modules are active LOW: swap if needed
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(3); oled.setCursor(0, 8); oled.print(t, 1); oled.print("C");
oled.setTextSize(1); oled.setCursor(0, 48);
oled.print("Set "); oled.print(SET_C, 0); oled.print("C heater "); oled.print(heating ? "ON" : "off");
oled.display();
delay(1000);
}
The sketch above runs here on a simulated Arduino Nano. Move the sliders for the sensors and buttons it reads, and watch the Serial monitor, display and outputs change.
The thermistor or the 100k resistor is open or shorted. The code switches the heater off in that case.
Increase BAND or move the thermistor further from the heater.
Insulate the lid, or use a second PTC heater. A 30 W heater suits a box of about 20 litres.
A relay contact can weld shut and code can crash. The cut-out is a mechanical backup that needs no software.
Not with this design. Mains heaters need a qualified electrician and a closed, earthed enclosure.
Yes, with SET_C at 45 to 55 °C, the KSD302 cut-out and a small fan to move the air.
16 parts: Nano CH340 Development Board (Soldered), Generic PTC Heating Element – 12V 30W, 120°C Surface Temp, Aluminum Shell, Generic Glass-sealed 100K Ohm NTC 3950 Thermistors 1%, Generic KSD9700/BK05-BB1D Metallic Shell Temperature Control Switch – 55C NC, 5A 250V, 5V Relay Module with Optocoupler, Resistor Assortment Kit (30 Values), 0.96" OLED Display 128x64, KSD302 Ceramic Normally Closed NC Temperature Control Switch Thermostat 130°C – 250V 10A, DFRobot Gravity MOSFET Power Controller Module – PH2.0-3P Interface, MAX31865 PT100/PT1000 RTD Temperature Detector Module, plus 6 more. 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 3 hours. The build on this page has 6 steps.
Yes. The Run it panel under the code runs this exact sketch on a simulated board. Move the sliders or press the buttons for the sensors it reads, and the Serial monitor, display and outputs react as they will on the real build. It is a simulation, so real readings depend on your parts and wiring.
About ₹13,580 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Reading an NTC thermistor with the beta equation; On-off control with hysteresis; Why a hardware cut-out sits in series with every heater.
Ideas that reuse this build: Printer enclosure and filament drying. 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.
A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.