Meteo station – Learning path project 16

Our Learning Path is an itinerary designed to teach all the foundaments and a little more about electronics, coding and robotics.

When you complete all the projects you will be able to develop almost any project you can imagine. In each chapter new concepts are introduced. You will learn by doing in a funny way.

Using the barometric and atmospheric pressure sensor, you can build an amazing meteo station!

Project 16
COMPLETE METEO STATION

Using the barometric and atmospheric pressure sensor, we will build an amazing meteo station

BEFORE TO START

DIFFICULTY LEVEL: Intermediate
DURATION OF THE ACTIVITY: 60 min.

MATERIALS:
4in1 board
Battery holder & wires
Buzzer
Battery holder & wires

1 - Build&Code 4in1 board
1 - Barometric Pressure Sensor
1 - LCD Display

Battery holder, USB cable and wires.

16 - Barometric Pressure Sensor

Atmospheric pressure is the force that the air (atmosphere) exerts on the surface of the earth, which changes with temperature and altitude. The barometric pressure sensor reads the absolute atmospheric (barometric) pressure and the temperature. This way, it indirectly estimates sea level.

Compatible with I2C and SPI protocols it's connected to 4in1 board through 2 analog inputs.

Atmospheric pressure range measure is from 300 to 1100hPa with a tolerance of +-1hPa
Temperature range is from 0ºC to 65ºC

16 - Circuit

Barometric pressure sensor has I2C connection, that's a serial connection like LCD display. 4in1 board is also capable of use serial I2C communication using analog ports 4 and 5 . Let's see it!

Connect wires from 4in1 board to components:
- A5 signal to SCL sensor pin (orange wire)
- A4 to SDA and power sensor pins
- ICSP port to LCD Display

16.1 - Sensor reading program

We show you how to read the analog barometric pressure sensor only with Arduino IDE, since it has a specific library for this sensot that is not yet implemented in MBlock

Arduino Coding
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;          // Se declara una variable perteneciente a la librería

void setup() {
  Serial.begin(9600);

  if (!bme.begin(0x76)) {           // Se verifica la conexión 
    Serial.println("Couldn't find a valid BME280 sensor!");
    while (1);
  }
}

void loop() {

  // CÁLCULO DE LA PRESIÓN 
  delay(1000); 
   
  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");
  

}
16.2 - Show all sensor values on display

The sensor give us pressure, altitude, and humidity. Find here how to obtain all values using the library BME280. Then you can try to add the LCD Display and show values on it.

Arduino Coding
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;          // Se declara una variable perteneciente a la librería

void setup() {
  Serial.begin(9600);

  if (!bme.begin(0x76)) {           // Se verifica la conexión 
    Serial.println("Couldn't find a valid BME280 sensor!");
    while (1);
  }
}

void loop() {

  // CÁLCULO DE LA TEMPERATURA, LA PRESIÓN, LA ALTITUD Y LA HUMEDAD
  delay(1500);
  
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println(" ºC");

  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println(" m");

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println(" %");

  Serial.println();
}
Final project - Meteo Station

Build your meteo station. You can add all ambient sensors you have!! Here cardboard template

Arduino code
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;          // Se declara una variable perteneciente a la librería

void setup() {
  Serial.begin(9600);

  if (!bme.begin(0x76)) {           // Se verifica la conexión 
    Serial.println("Couldn't find a valid BME280 sensor!");
    while (1);
  }
}

void loop() {

  // CÁLCULO DE LA TEMPERATURA, LA PRESIÓN, LA ALTITUD Y LA HUMEDAD
  delay(1500);
  
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println(" ºC");

  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println(" m");

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println(" %");

  Serial.println();
}
previous arrow
next arrow
Slider

The Mega Maker Kit fits perfectly with the Learning Path, you can build all projects with it, but if you have other kits, you can also follow the entire itinerary and finish some projects, or buy the missing components. You can check in our Learning Path page.

0 0

0