Skip to main content

ЁЯМб️ Interfacing BMP180 Pressure & Temperature Sensor with Raspberry Pi 3

ЁЯФ╣ Overview

The BMP180 is a sensor that measures atmospheric pressure and temperature. It is commonly used in weather stations, altitude measurement, and IoT projects. In this tutorial, we will interface the BMP180 sensor with Raspberry Pi 3 and display the readings.


ЁЯЫа️ Components Required

✔️ Raspberry Pi 3
✔️ BMP180 Sensor
✔️ Breadboard & Jumper Wires


ЁЯФМ Circuit Diagram

The BMP180 communicates with the Raspberry Pi using the I2C protocol.

ЁЯФЧ BMP180 to Raspberry Pi Connections   

BMP180 PinConnection
VCC3.3V (Raspberry Pi)
GNDGND
SDAGPIO 2 (I2C SDA)
SCLGPIO 3 (I2C SCL)

ЁЯУЬ Python Code to Read BMP180 Sensor

Save the following Python script as bmp180_sensor.py and run it on Raspberry Pi.

python
import smbus import time # BMP180 Default Address BMP180_ADDR = 0x77 # Open I2C bus bus = smbus.SMBus(1) def read_temperature(): bus.write_byte_data(BMP180_ADDR, 0xF4, 0x2E) time.sleep(0.005) temp_msb = bus.read_byte_data(BMP180_ADDR, 0xF6) temp_lsb = bus.read_byte_data(BMP180_ADDR, 0xF7) temp = ((temp_msb << 8) + temp_lsb) / 340.0 + 36.53 return round(temp, 2) try: while True: temperature = read_temperature() print("Temperature:", temperature, "°C") time.sleep(2) except KeyboardInterrupt: print("\nProgram stopped.")

ЁЯТб How It Works

  1. The BMP180 sensor uses the I2C protocol to communicate with the Raspberry Pi.
  2. The Python script sends commands to the sensor and reads the temperature values.
  3. The sensor returns the temperature data, which is displayed on the screen.

ЁЯОп Applications

✅ Weather stations
✅ Altitude measurement
✅ IoT-based climate monitoring


ЁЯУЭ рдорд░ाрдаीрдд рд╕рдордЬाрд╡рдгी (Marathi Explanation)

ЁЯФ╣ рдкрд░िрдЪрдп

BMP180 рд╕ेрди्рд╕рд░ рд╣ा рд╣рд╡ाрдоाрдиाрдЪा рджाрдм (Pressure) рдЖрдгि рддाрдкрдоाрди (Temperature) рдоोрдЬрдг्рдпाрд╕ाрдаी рд╡ाрдкрд░рд▓ा рдЬाрддो. рдпाрдЪा рдЙрдкрдпोрдЧ рд╣рд╡ाрдоाрди рдХेंрдж्рд░े, IoT рдк्рд░рдХрд▓्рдк рдЖрдгि рдЙंрдЪी рдоोрдЬрдг्рдпाрд╕ाрдаी рдХेрд▓ा рдЬाрддो.


ЁЯЫа️ рдЖрд╡рд╢्рдпрдХ рдШрдЯрдХ

✔️ рд░ाрд╕्рдкрдмेрд░ी рдкाрдп рей
✔️ BMP180 рд╕ेрди्рд╕рд░
✔️ рдм्рд░ेрдбрдмोрд░्рдб рдЖрдгि рдЬрдо्рдкрд░ рд╡ाрдпрд░


ЁЯФМ рд╕рд░्рдХिрдЯ рдХрдиेрдХ्рд╢рди

BMP180 рд╕ेрди्рд╕рд░ I2C рдк्рд░ोрдЯोрдХॉрд▓ рд╡ाрдкрд░рддो.

BMP180 рдкिрдирд░ाрд╕्рдкрдмेрд░ी рдкाрдп рдХрдиेрдХ्рд╢рди
VCC3.3V
GNDGND
SDAGPIO 2 (I2C SDA)
SCLGPIO 3 (I2C SCL)

ЁЯУЬ рдкाрдпрдеॉрди рдХोрдб

рд╣ा рдХोрдб bmp180_sensor.py рдиाрд╡ाрдиे рд╕ेрд╡्рд╣ рдХрд░ा рдЖрдгि рдЪाрд▓рд╡ा.

python
import smbus import time BMP180_ADDR = 0x77 bus = smbus.SMBus(1) def read_temperature(): bus.write_byte_data(BMP180_ADDR, 0xF4, 0x2E) time.sleep(0.005) temp_msb = bus.read_byte_data(BMP180_ADDR, 0xF6) temp_lsb = bus.read_byte_data(BMP180_ADDR, 0xF7) temp = ((temp_msb << 8) + temp_lsb) / 340.0 + 36.53 return round(temp, 2) try: while True: temperature = read_temperature() print("рддाрдкрдоाрди:", temperature, "°C") time.sleep(2) except KeyboardInterrupt: print("\nрдк्рд░ोрдЧ्рд░ॅрдо рдеांрдмрд▓ा.")

ЁЯТб рд╣े рдХрд╕े рдХाрд░्рдп рдХрд░рддे?

  1. BMP180 рд╕ेрди्рд╕рд░ I2C рдк्рд░ोрдЯोрдХॉрд▓ рд╡ाрдкрд░ूрди рд░ाрд╕्рдкрдмेрд░ी рдкाрдпрд╢ी рд╕ंрд╡ाрдж рд╕ाрдзрддो.
  2. рдкाрдпрдеॉрди рдХोрдб рд╕ेрди्рд╕рд░рд▓ा рдХрдоांрдб рдкाрдард╡рддो рдЖрдгि рддाрдкрдоाрди рд╡ाрдЪрддो.
  3. рд╕ेрди्рд╕рд░ рдбेрдЯा рд╕्рдХ्рд░ीрдирд╡рд░ рдк्рд░рджрд░्рд╢िрдд рдХрд░рддो.

ЁЯОп рдЙрдкрдпोрдЧ

✅ рд╣рд╡ाрдоाрди рдХेंрдж्рд░े
✅ рдЙंрдЪी рдоोрдЬрдгी (Altitude Measurement)
✅ IoT-рдЖрдзाрд░िрдд рддाрдкрдоाрди рдиिрд░ीрдХ्рд╖рдг


Comments

Popular posts from this blog

TOUCH PLATE BASED DOOR BELL

Title:  Touch plate based door bell  Circuit:  Components: IC 555 Resistors: 1 M, 100k, 330 ohms Transistor: BC547  PN2222A Capacitor: 10n 1 Copper plate : as touch plate. A 6v battery An LED / Ic UM66 Description: This is the simple circuit for touch plate based security system. In this project what basically done is, circuit detects stray voltages produced by mains voltage and electrostatic built  up in the room.If sufficient static voltage is detected by the plate then chip will charge up. Transistor BC 547 or PN2222A is used basically to increase the sensitivity.In place of led just connect IC um 66(melody IC). Applications: In homes, of course. This can be specially used in places like hospitals, when patients need to call doctor by himself.

Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️

Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️ Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️ A load cell is a transducer that converts force (weight) into an electrical signal. The HX711 is a precision 24-bit analog-to-digital converter (ADC) designed for weigh scales. Today we’ll connect a load cell to Raspberry Pi 3 using the HX711 module. ЁЯзк ЁЯФз Components Required Component Quantity Raspberry Pi 3 1 Load Cell 1 HX711 Module 1 Jumper Wires 6 Breadboard (optional) 1 ЁЯФМ Pin Connections HX711 Pin Raspberry Pi Pin Pin Number VCC 5V Pin 2 GND Ground Pin 6 DT GPIO 5 Pin 29 SCK GPIO 6 Pin 31 Figure: Load Cell connected to Raspberry Pi 3 via HX711 ЁЯТ╗ Python Code from hx711 import HX711 import RPi.GPIO as GPIO import time hx = HX711(dout_pin=5, pd_sck_pin=6) hx.set_reading_format("MSB", "MSB") hx.set_reference_unit(1) hx.reset()...

Interfacing Sound Sensor with Raspberry Pi 3

ЁЯФ╣ Overview The KY-037 is a high-sensitivity sound detection sensor that can detect noise levels in the environment. It provides both analog and digital outputs. In this tutorial, we’ll interface the digital output of KY-037 with Raspberry Pi 3 Model B+ (without using an ADC like MCP3008) and detect sound events.