LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA load cell is a metal bar that bends a tiny amount under weight, and an HX711 amplifies that change into a number the ESP32 can read. This project reads the HX711, subtracts the empty-scale reading (tare) at start-up, and multiplies by a calibration factor you find with a known weight. The OLED shows grams. Mount the load cell between two flat plates so the weight bends it properly.
Do not load the cell above its rating.
Tick anything you already have and the total updates.
5 kg load cell with HX711 module
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB power bank. A stable supply gives steadier readings.
scale.inoVerify & upload in Electrolark#include <HX711.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
const int DT = 16, SCK_PIN = 17;
float SCALE_FACTOR = 1.0; // raw counts per gram: find it with a known weight
HX711 scale;
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
void setup() {
Serial.begin(115200);
Wire.begin(21, 22);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setTextColor(WHITE);
scale.begin(DT, SCK_PIN);
delay(500);
scale.set_scale(SCALE_FACTOR);
scale.tare(20); // empty plate = zero
}
void loop() {
float g = scale.get_units(5);
Serial.printf("raw avg %.0f grams %.1f\n", g * SCALE_FACTOR, g);
oled.clearDisplay();
oled.setTextSize(3); oled.setCursor(0, 18);
oled.print(g < 0.5 && g > -0.5 ? 0.0 : g, 0);
oled.setTextSize(2); oled.print(" g");
oled.display();
delay(200);
}
Let the HX711 warm up for a minute and keep the load cell away from drafts and a moving cable.
Swap the two signal wires from the load cell (white and green) or use a negative SCALE_FACTOR.
Check the DT and SCK pins and that the load cell wires are on the right HX711 terminals.
About 1 to 2 grams after calibration with a good mount.
Use a higher-rated load cell; the code is the same.
It sets the empty plate to zero so you read only the ingredients.
5 parts: ESP32-WROOM-32 38-Pin Development Board, Generic 5kg Load Cell Kit with HX711AD Module, Shell & 4P DuPont Wire, 0.96" OLED Display 128x64, Solderless Breadboard and Dupont Jumper Wires (40 pcs). 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 6 steps.
No. This page has the complete, tested code (scale.ino).
About ₹1,094 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Reading an HX711 load cell amplifier; Taring and calibrating with a known weight; Showing values on an OLED.
Do not load the cell above its rating.
Ideas that reuse this build: Wi-Fi kitchen scale. 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.