Barometric pressure using Arduino

Πως μετράμε την βαρομετρική πίεση με arduino

Barometric low! barometric high!.. today we are gonna see it all (well.. almost all) and we are gonna learn how to use cheap materials to get those measures coming

Two terminologies that we daily listen at the weather forecast.! Barometric pressure is something that is affected by the weather and in this article / video we are going to see how can we measure barometric pressure from our own home. With the help of Arduino of course.

Because we like to present you a subject at its whole and not just epidermic, We are going to write adn talk about in the video and a few words about atmospheric pressure!

Atmospheric pressure

Atmospheric pressure or barometric pressure is the pressure that the atmosphere applies by its weight to the surface of the earth as it is defined by the atmospheric circulation.

On the surface of the earth the atmospheric pressure equals by average with the weight of a 11meter high water column or 760mm mercury column.

Source: Wiki


Torricelli experiment

In order for Torricelli to prove that there is an atmospheric pressure he used a pot with mercury and a testing tube. He filler the testing tube with mercury and by holding the mercury inside the tube he flipped it inside th pot by holding the tube straight up. He observed that the mercury began to fall until it stopped to a point over the surface.

The outcome of the expirement was that the level was always at 760 mmm over the free surface in the pot. The mercury in the pot has pressure applied from the atmosphere that equalizes the pressure from the tube in the pot.

That was the way to prove that we have atmospheric pressure. We measure it with mm Hg or torr.

Mercury is very toxic. DO NOT touch or come in contact (skin, eyes, mouth, blood). Even old traditional thermometers are been removed from market giving their place to new electronic type without mercury. The only mercury you can put in your ears is Freddie’s mercury music in the form of audio waves 🙂

GY-BM E/P 280 sensor

We are goind to use the GY-BM 280 sensor which has two editions. Ε (measures humidity) and P. Unfortunatelly when i first bought the sensor i did not knew about their differences, but (as expected) i picked the one without humidity measure. With that, i can only show you the barometric pressure and not humidity.

The connection is straight forward, all we need is 4 pin connection. Two of them will be connected to GND and 3.3-5vDC and the other two are analog outputs that are connected to specific analog outputs. We can use any edition but in the video we are using Arduino nano.

Αισθητήρας μέτρησης ατμοσφαιρικής πίεσης, θερμοκρασίας, υψομέτρου και υγρασίας
Barometric sensor GY-BME/P280

Besides the barometric pressure, the sensor can measure temperature and alititude. The E edition can also measure humidity.

Το chipset του μετρητή BM280

There is a small hole on the sensor as you look at the photo on the bottom right. You must keep this tiny hole open because this is where the sensor gets the input from the environment.

Arduino nano

For the sensor connection with the arduino we need two wires. We need the pins SCL and SDA. If you look at the photo below these pins correspond to pin A4 and Α5

The circuit

We used Fritzing, to design the circuit.

Το κύκλωμα με arduino nano
ArduinoSensor
GNDGND (black)
VCC 3.3VVCC (red)
A5SCL (yellow)
A4SDA (green)

We also need a library to get the sensor working. You can download the library by clicking the link below

Code

Let’s use the library example.

include "Seeed_BME280.h"
include <wire.h>
BME280 bme280;
void setup()
{
Serial.begin(9600);
if(!bme280.init())
{
Serial.println("Device error!");
}
}
void loop()
{
float pressure;
//get and print temperatures
Serial.print("Temp: ");
Serial.print(bme280.getTemperature());
Serial.println("C");
Serial.print("Pressure: ");
Serial.print(pressure = bme280.getPressure());
Serial.println("Pa");
Serial.print("Altitude: ");
Serial.print(bme280.calcAltitude(pressure));
Serial.println("m");
Serial.print("Humidity: ");
Serial.print(bme280.getHumidity());
Serial.println("%");
delay(2000);
}

Every two seconds there is a measure that we print on the Serial communication port

Units

The measure unit for barometric pressure is Hpa (hectopascal)

ΒΜ280 gives us the measure in Pa(pascal) for the conversion you will divide (pa/10000 = hPa) and you will have a common measure value.


These kind of sensors can be used to make a weather station.

  • Temperature
  • Humidity
  • Rain
  • Wind
  • Barometric pressure
December 2, 2019

0 responses on "Barometric pressure using Arduino"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Σχεδιασμός © GetCert. Με επιφύλαξη παντός δικαιώματος.