বায়ুচাপ দেখে উচ্চতা মাপার যন্ত্র — ওঠার সময় বিপ বাজেBarometric Altimeter with BMP280
প্রতি ১০০ মিটার ওঠায় বায়ুচাপ প্রায় ১২ hPa কমে — তাই চাপ থেকেই উচ্চতা বের হয়ে আসে। যত উপরে ওঠা, বিপ তত দ্রুত — পাহাড়ে নিচে তাকিয়ে দেখার দরকারই পড়ে না।
Air pressure drops roughly 12 hPa every 100 m of climb, so height falls straight out of the barometer formula. The beeper gets faster the higher you go — hikers hear their altitude without looking down.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno R3 Arduino Uno
- 1 × Weather sensor BME280 আবহাওয়া সেন্সর BME280
- 1 × LCD 16x2 with I2C LCD ১৬x২ (I2C)
- 1 × Buzzer (5 V) Buzzer (বাঁশি, 5 V)
- 1 × Resistor 330Ω Resistor
- 1 × LED (blue) LED বাতি
- 13 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| Weather sensor BME280 VCC | → | Arduino Uno R3 5V |
| Weather sensor BME280 GND | → | Arduino Uno R3 GND |
| Weather sensor BME280 SDA | → | Arduino Uno R3 A4 |
| Weather sensor BME280 SCL | → | Arduino Uno R3 A5 |
| LCD 16x2 with I2C VCC | → | Arduino Uno R3 5V |
| LCD 16x2 with I2C GND | → | Arduino Uno R3 GND |
| LCD 16x2 with I2C SDA | → | Arduino Uno R3 A4 |
| LCD 16x2 with I2C SCL | → | Arduino Uno R3 A5 |
| Buzzer (5 V) + | → | Arduino Uno R3 D8 |
| Buzzer (5 V) - | → | Arduino Uno R3 GND.3 |
| Arduino Uno R3 D13 | → | Resistor a |
| Resistor b | → | LED A |
| LED K | → | Arduino Uno R3 GND.3 |
Code (Arduino C++)
#include <Wire.h>
#include <Adafruit_BME280.h>
#include <LiquidCrystal_I2C.h>
// Barometric altimeter: air pressure drops about 12 hPa every 100 m you climb,
// so height falls straight out of the barometer formula. The beeper gets
// faster the higher you go — hikers hear their altitude without looking down
// at a screen. Slide the "pressure" control on the BME280 as if you climbed.
Adafruit_BME280 bme;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
if (!bme.begin(0x76)) { Serial.println("BME280 not found"); while (1) delay(10); }
lcd.init();
lcd.backlight();
pinMode(8, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
float press = bme.readPressure() / 100.0; // hPa
float alt = 44330.0 * (1.0 - pow(press / 1013.25, 0.1903));
int zone = alt > 1000 ? 2 : (alt > 300 ? 1 : 0); // 0 quiet, 1 slow, 2 fast
bool beep = (zone == 2) || (zone == 1 && millis() % 1000 < 300);
digitalWrite(8, beep ? HIGH : LOW);
digitalWrite(13, zone > 0 ? HIGH : LOW);
lcd.setCursor(0, 0); lcd.print("Alt: "); lcd.print(alt, 0); lcd.print(" m ");
lcd.setCursor(0, 1); lcd.print(press, 1); lcd.print(" hPa");
Serial.print("Altitude: "); Serial.print(alt, 0);
Serial.print(" m | Beeper: "); Serial.println(zone == 2 ? "fast" : (zone == 1 ? "slow" : "none"));
delay(300);
}
আরো project · More projects
- সোনার হ্যাপটিক বেল্ট — বাধা কাছে হলে কম্পন বাড়েSonic haptic belt (vibration grows near obstacles)
- কনট্যাক্টছাড়া স্যানিটাইজার — VL53L0X লেজার চোখ দিয়েContactless sanitizer dispenser (VL53L0X laser eye)
- পানির ট্যাংক অটো-ফিল — পাম্প নিজে নিজে বন্ধ হয়Water tank auto-fill (pump cuts off by itself)
- টিল্ট ট্যাম্পার অ্যালার্ম — নাড়ালেই বাজতে থাকে, রিসেট দিলে থামেTilt tamper alarm (money box screams until reset)