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

Arduino UNO WiFi Weather Station with Adafruit MPL115A2 Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO WiFi Weather Station with Adafruit MPL115A2 Sensor

Circuit Documentation

Summary

This circuit involves an Arduino UNO R4 WiFi microcontroller interfaced with an Adafruit MPL115A2 I2C Barometric Pressure and Temperature Sensor. The sensor measures atmospheric pressure and temperature, and the data is processed and displayed using the Arduino.

Component List

Adafruit MPL115A2 I2C Barometric Pressure, Temperature Sensor

Arduino UNO R4 WiFi

Wiring Details

Adafruit MPL115A2 I2C Barometric Pressure, Temperature Sensor

Arduino UNO R4 WiFi

Code Documentation

Arduino Code

#include <Adafruit_MPL115A2.h>
#include <Wire.h>

Adafruit_MPL115A2 mpl115a2; // Create an instance of the sensor

void setup() {
  Serial.begin(9600);
  mpl115a2.begin(); // Initialize the sensor
}

void loop() {
  float pressure = mpl115a2.getPressure(); // Get pressure in kPa
  float temperature = mpl115a2.getTemperature(); // Get temperature in degrees Celsius

  // Print the results to the serial monitor
  Serial.print("Pressure (kPa): ");
  Serial.print(pressure);
  Serial.print(" Temperature (C): ");
  Serial.println(temperature);

  delay(1000); // Wait for a second before reading again
}

This code initializes the Adafruit MPL115A2 sensor and reads the pressure and temperature values in a loop, printing the results to the serial monitor every second.