LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA draw-wire (string pot) sensor has a steel wire wound on a spring drum that turns a precision potentiometer. Pull the wire out and the resistance changes in proportion to the length, here 0 to 500 mm over 5 kilohms. Wired as a voltage divider, it gives the Nano a voltage that maps straight to distance. Fix the body, clip the wire to a moving part, and the OLED shows position and the largest travel seen.
Never let the wire snap back freely; it can cut skin.
Tick anything you already have and the total updates.
WPS-S-R-500 0-500 mm draw-wire sensor, 5k output
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB to the Nano.
draw_wire.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire);
int RAW0 = 10, RAW1 = 1010; // raw readings at 0 mm and at CAL_MM
const float CAL_MM = 500.0;
float maxMm = 0;
void setup() { oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); }
void loop() {
long sum = 0;
for (int i = 0; i < 16; i++) sum += analogRead(A0);
float raw = sum / 16.0;
float mm = (raw - RAW0) * CAL_MM / (RAW1 - RAW0);
if (mm > maxMm) maxMm = mm;
oled.clearDisplay(); oled.setTextColor(SSD1306_WHITE);
oled.setTextSize(3); oled.setCursor(0, 0); oled.print(mm, 0);
oled.setTextSize(1); oled.print(" mm");
oled.setCursor(0, 44); oled.print("Max "); oled.print(maxMm, 0); oled.print(" mm");
oled.display();
delay(100);
}
Swap the two end wires.
Increase averaging and keep the wire away from motor cables.
The wire is pulled at an angle; keep it straight out of the body.
About 1 mm with the Nano's 10-bit ADC; use an ADS1115 for finer steps.
No, always return it gently; a free snap-back can damage it.
It is rated IP65, so splashes are fine.
5 parts: SOP WPS-S-R-500 0-500mm Rope Displacement Sensor, 5K Resistance Output, IP65, 1m Cable, Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Digital Multimeter. 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 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (draw_wire.ino).
About ₹8,140 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
How a string potentiometer measures distance; Two-point calibration; Reading a pot as a voltage divider.
Never let the wire snap back freely; it can cut skin.
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.