LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA tipping-bucket rain gauge empties a small bucket each time it collects a fixed amount of rain and closes a reed switch: count the tips and you have rainfall in mm. A voltage-output anemometer gives 0-5 V for its wind range. The Nano counts tips on an interrupt, reads wind on A0, and shows today's rain, rain rate and wind speed on an OLED. Both sensors are industrial units built to stay outdoors.
Fix the mast securely and keep away from overhead power lines.
Tick anything you already have and the total updates.
Tipping-bucket rain gauge, pulse output
Wind speed sensor, 0-5 V output
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter for the anemometer; Nano on the same 12 V through VIN.
rain_wind.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
void big(const String& top, const String& value, const String& unit) {
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(1); oled.setCursor(0, 0); oled.print(top);
oled.setTextSize(3); oled.setCursor(0, 20); oled.print(value);
oled.setTextSize(1); oled.print(" "); oled.print(unit);
oled.display();
}
const float MM_PER_TIP = 0.2; // from the gauge label
const float WIND_MAX = 30.0; // m/s at 5 V, from the anemometer label
volatile unsigned long tips = 0, lastTip = 0;
unsigned long hourStart = 0, tipsAtHour = 0;
void onTip() { unsigned long now = millis(); if (now - lastTip > 200) { tips++; lastTip = now; } }
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), onTip, FALLING);
}
void loop() {
noInterrupts(); unsigned long t = tips; interrupts();
if (millis() - hourStart > 3600000UL) { hourStart = millis(); tipsAtHour = t; }
float rain = t * MM_PER_TIP;
float rate = (t - tipsAtHour) * MM_PER_TIP; // mm in the current hour
long sum = 0; for (int i = 0; i < 32; i++) sum += analogRead(A0);
float wind = (sum / 32.0) * 5.0 / 1023.0 / 5.0 * WIND_MAX;
oled.clearDisplay(); oled.setTextColor(WHITE); oled.setTextSize(2);
oled.setCursor(0, 0); oled.print(rain, 1); oled.print(" mm");
oled.setTextSize(1); oled.setCursor(0, 20); oled.print(rate, 1); oled.print(" mm this hour");
oled.setTextSize(2); oled.setCursor(0, 40); oled.print(wind, 1); oled.print(" m/s");
oled.display();
delay(1000);
}
The reed switch bounces; raise the 200 ms debounce or add a 100 nF capacitor across the wires.
The anemometer needs its 12 V supply and a shared ground with the Nano.
Level the gauge and clean the funnel; blocked meshes hold water.
Add a DS3231 RTC and clear the count at 8:30 AM, the IMD rain day.
Yes, swap the Nano for an ESP32 and add a 3.3 V divider on the anemometer signal.
1 mm of rain is 1 litre of water per square metre.
7 parts: Generic Nano CH340 Development Board (Soldered), Renke RS-YL-PL-2-02-EX Tipping Bucket Rain Gauge – Pulse Output, Wind Speed Sensor Voltage Type (0-5V) Anemometer Kit – Waterproof & Industrial, 3M Cable, 0.96" OLED Display 128x64, DC Power Adapter (5.5x2.1mm), 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 3 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (rain_wind.ino).
About ₹8,368 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
How a tipping-bucket gauge measures rainfall; Debouncing reed-switch pulses; Scaling a 0-5 V industrial sensor.
Fix the mast securely and keep away from overhead power lines.
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.