Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Weather Station with BMP180 Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Weather Station with BMP180 Sensor

Circuit Documentation

Summary

This circuit is designed to interface an Arduino UNO with a BMP180 sensor. The BMP180 sensor is used to measure atmospheric pressure and temperature. The sensor communicates with the Arduino via the I2C protocol, utilizing the SCL and SDA pins for data transmission. The sensor is powered by the 3.3V output from the Arduino, and both devices share a common ground.


Component List

Arduino UNO

BMP180


Wiring Details

Arduino UNO


BMP180


Documented Code

/*
  Arduino Sketch to interface with BMP180 sensor and display temperature
  and pressure readings to the serial console. The BMP180 is connected
  via I2C to the Arduino UNO. The sensor's SCL and SDA pins are connected
  to the corresponding SCL and SDA pins on the Arduino. The sensor is
  powered by the 3.3V and GND pins of the Arduino.
*/

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>

// Create an instance of the sensor
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

void setup() {
  // Initialize serial communication at 9600 baud rate
  Serial.begin(9600);
  // Initialize the I2C communication
  Wire.begin();

  // Initialize the BMP180 sensor
  if (!bmp.begin()) {
    // If sensor initialization fails, print an error message
    Serial.print("Could not find a valid BMP180 sensor, check wiring!");
    while (1);
  }
}

void loop() {
  // Create a sensor event
  sensors_event_t event;
  bmp.getEvent(&event);

  // Check if the event is valid
  if (event.pressure) {
    // Display the pressure value
    Serial.print("Pressure: ");
    Serial.print(event.pressure);
    Serial.println(" hPa");

    // Get temperature value
    float temperature;
    bmp.getTemperature(&temperature);
    // Display the temperature value
    Serial.print("Temperature: ");
    Serial.print(temperature);
    Serial.println(" C");
  } else {
    // If no valid event, print an error message
    Serial.println("Sensor error!");
  }

  // Wait for 2 seconds before the next reading
  delay(2000);
}

This documentation provides a comprehensive overview of the circuit, detailing the components used, their wiring, and the code necessary for operation.