LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsMost industrial transmitters send their reading as a current: 4 mA at the bottom of the range and 20 mA at the top. Current does not drop along a long cable, and a broken wire reads 0 mA, which is easy to spot. Put a 220 ohm resistor at the bottom of the loop and the current becomes 0.88 to 4.4 V, which an Arduino reads on an analog pin. A 1k resistor and a 5.1 V zener protect the pin if the loop is ever shorted to the 24 V supply.
Use an enclosed 24 V supply and switch off mains before wiring it.
Transmitters on real plant may be part of a safety system: only connect to a spare loop or one you own.
Tick anything you already have and the total updates.
Reads the loop voltage and drives the LCD
Example 2-wire 4-20 mA transmitter; any loop-powered one works
Ready 4-20 mA to 0-5 V converter board with zero and span pots
DFRobot Gravity 4-20 mA to voltage converter for plug-in wiring
Follow the colours: red is power, dark grey is ground, blue is a signal.
The loop needs 24 V DC from an enclosed supply. The Uno runs from USB or its barrel jack. Join only the 24 V − to Uno GND, at the bottom of the sense resistor.
loop_4_20ma.inoVerify & upload in Electrolark#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const float R_SENSE = 220.0; // measure your resistor and put the real value here
const float VREF = 5.0; // Uno analog reference
const float RANGE_LO = 0.0, RANGE_HI = 10.0; // transmitter range at 4 mA and 20 mA
const char* UNIT = "bar";
void setup() {
lcd.init(); lcd.backlight();
Serial.begin(115200);
}
void loop() {
long sum = 0;
for (int i = 0; i < 32; i++) { sum += analogRead(A0); delay(2); }
float volts = sum / 32.0 * VREF / 1023.0;
float mA = volts / R_SENSE * 1000.0;
lcd.clear();
lcd.setCursor(0, 0);
if (mA < 3.6) { // below 4 mA: open loop or dead transmitter
lcd.print("LOOP FAULT");
} else {
float value = RANGE_LO + (mA - 4.0) / 16.0 * (RANGE_HI - RANGE_LO);
lcd.print(value, 2); lcd.print(" "); lcd.print(UNIT);
}
lcd.setCursor(0, 1);
lcd.print(mA, 2); lcd.print(" mA");
Serial.print(mA, 2); Serial.println(" mA");
delay(500);
}
Measure the loop current with a multimeter in series. 0 mA means a broken wire or reversed transmitter; most 2-wire transmitters need at least 12 V across them.
Measure the 220 ohm resistor and enter its real value in R_SENSE. For better accuracy use a 0.1 % resistor.
Twist the loop wires together and keep them away from motor cables. The 32-sample average in the sketch smooths the rest.
250 ohm gives 1 to 5 V, which leaves no headroom on a 5 V Arduino. 220 ohm tops out at 4.4 V at 20 mA, so a slightly over-range signal still reads.
Yes. Power it as its manual shows and run only its current output through the 220 ohm resistor to ground.
Use a voltage divider (for example 10k over 4.7k) to bring 10 V down below 5 V, and scale in the sketch.
It has zero and span pots and gives 0 to 5 V directly, so the sketch needs no current maths.
10 parts: Uno R3 CH340G ATmega328p Compatible Development Board, OULD CP-100 Pressure Sensor Module | 0-400 Bar | 4-20mA Output | Ceramic Piezoresistive, Enclosed SMPS Power Supply, Resistor Assortment Kit (30 Values), Zener Diode 1W, 1N47xx Series (DO-41), 16×2 LCD with I2C (RG1602A), 4-20mA to 0-5V Converter Board, DFRobot Gravity Analog Current to Voltage Converter (4–20mA), 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 intermediate project and takes about 2 hours. The build on this page has 7 steps.
No. This page has the complete, tested code (loop_4_20ma.ino).
About ₹1,646 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 2-wire 4-20 mA current loop works; Scaling 4-20 mA to engineering units; Protecting an analog input with a series resistor and a zener.
Use an enclosed 24 V supply and switch off mains before wiring it. Transmitters on real plant may be part of a safety system: only connect to a spare loop or one you own.
Ideas that reuse this build: Read RS485 Modbus industrial sensors. 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.