LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe JY901S combines an accelerometer, gyroscope and magnetometer with its own processor that outputs finished roll, pitch and yaw angles. It sends 11-byte packets over serial, each starting with 0x55 and a type byte; type 0x53 carries the angles. The Nano reads the packets with SoftwareSerial, checks each checksum, and sounds a buzzer when roll or pitch passes the limit.
This is an aid; always load and move trolleys and ladders safely.
Tick anything you already have and the total updates.
WitMotion JY901S 9-axis angle sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
A power bank fixed to the trolley.
tilt_alarm.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
#include <SoftwareSerial.h>
SoftwareSerial imu(10, 11);
const float LIMIT = 15.0, OFF_R = 0, OFF_P = 0;
uint8_t pkt[11];
float roll = 0, pitch = 0;
void setup() {
imu.begin(9600);
pinMode(5, OUTPUT);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
}
void loop() {
while (imu.available() >= 11) {
if (imu.read() != 0x55) continue;
pkt[0] = 0x55; imu.readBytes(pkt + 1, 10);
uint8_t sum = 0; for (int i = 0; i < 10; i++) sum += pkt[i];
if (sum != pkt[10] || pkt[1] != 0x53) continue;
roll = (int16_t)(pkt[3] << 8 | pkt[2]) / 32768.0 * 180.0 - OFF_R;
pitch = (int16_t)(pkt[5] << 8 | pkt[4]) / 32768.0 * 180.0 - OFF_P;
}
bool tip = fabs(roll) > LIMIT || fabs(pitch) > LIMIT;
digitalWrite(5, tip);
oled.clearDisplay(); oled.setTextSize(2);
oled.setCursor(0, 0); oled.print("R "); oled.print(roll, 1);
oled.setCursor(0, 22); oled.print("P "); oled.print(pitch, 1);
oled.setTextSize(1); oled.setCursor(0, 50); oled.print(tip ? "TOO STEEP" : "OK");
oled.display();
delay(100);
}
No valid packets; TX/RX swapped or a different baud rate is set in the sensor.
Calibrate it once with WitMotion's PC software, kept still and flat.
The magnetometer is disturbed by metal; roll and pitch are not affected.
The JY901S fuses gyro and accelerometer itself, which is steadier on a moving trolley.
Yes, with WitMotion's software; 10 Hz is plenty here.
No, put it in a small sealed box.
6 parts: WTMotion JY901S 9-Axis IMU Sensor ±0.5° Angle Accuracy 200Hz – Serial/I2C Interface, Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, Buzzer Module 3.3–5V, 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 (tilt_alarm.ino).
About ₹3,457 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Using an AHRS that outputs angles; Parsing fixed-length serial packets; Setting safe-angle alarms.
This is an aid; always load and move trolleys and ladders safely.
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.