Arduino Project: Weather Station with a BME280 sensor and an LCD screen with Arduino Mega

Arduino Project: Weather Station with a BME280 sensor and an LCD screen with Arduino Mega


Dear friends welcome to another Arduino project
video! Today we are going to build a simple weather
station using a BME280 sensor and an LCD shield. Let’s get started! Hello guys, I am Nick and welcome to educ8s.tv
a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266
and other popular boards. Today we are going to take a first look at
the new BME280 sensor, a new very interesting sensor. We are going to build a simple but very accurate
weather station project. I have built a similar project 2 years ago,
using different sensors. Now that we have a new sensor available which
makes things easier, it’s time to update the project. As you can see, on the LCD display we can
see the temperature, the humidity and the barometric pressure. The readings are updated every two seconds. This is a very easy project to build so it
is ideal for beginners! Let’s build it! The parts needed in order to build this project
are the following: • An Arduino Mega
• A BME280 sensor • An LCD shield for Arduino
• Some wires The cost of the project is around $18. You can find links for all the needed parts
in the description of the video. Let’s connect the parts. At first let’s take a quick look at the
new BME280 sensor. The sensor is very small, and it can measure
temperature, humidity and barometric pressure! Great! The cost of the sensor is about 5$. So far, in our weather station projects we
were using the BMP180 sensor which can measure temperature and pressure but not humidity. There is also the BMP280 sensor which does
not offer humidity measurements, so be careful when ordering the sensor, we need the BME280
sensor. The board I have bought uses the I2C interface,
so we only need to connect the 4 wires to make it work. Let’s connect the sensor to Arduino. We are using the Arduino Mega today but you
can use the Arduino Uno as well if you solder some header pins to your LCD shield. The Arduino Mega make things easier for beginners. So, we connect the LCD shield to the Arduino
Mega like this. Then we connect the Vin pin of the sensor
to the Arduino Mega 5V output here. Next we connect the GND pin of the sensor
to the Arduino Mega GND. The next step is to connect the SCL pin of
the sensor to the SCL pin of the Arduino Mega, and the SDA pin of the sensor to the SDA pin
of the Arduino Mega. That’s it, if we load the code and power
up the project we can see that after 2 seconds the readings from the sensor are displayed
on the screen. Our project is ready! You can now build your own enclosure for it,
and you have a very accurate weather station! Let’s now take a look at the code of the
project. The code of the project uses 3 libraries. We need to download 2 of them, since the 3rd
one is already installed with the Arduino IDE. We need to download the Adafruit BME280 library
and the Adafruit Sensor library. Let’s see how to install the BME280 library. We visit the library website and we download
it by clicking here. We unzip it in our Arduino ->Libraries folder
and we rename it like this. We follow the same procedure with the Sensor
Library as well. You can find links for all the libraries in
the description of the video below. Now that we have installed the libraries we
need to define the altitude for our location in meters in order to get accurate barometric
pressure readings. As you can see, the code is very simple. At first we initialize the sensor and the
display. Then in the loop function the read the sensor
every 2 seconds. After reading the sensor we print the values
on the display. In this version of the code we display the
temperature in degrees Celsius but I have also prepared a version of the code with the
temperature measured in degrees Fahrenheit. You can find both versions of the code of
the project in a link in the description below. That’s today’s project. An Arduino Weather Station project with the
new BME280 sensor. The new BME280 sensor is very easy to use
since it uses the I2C interface. I am going to use it a lot in the future projects
because it offers temperature, humidity and pressure sensors in one package. This makes our weather station projects easier
to build and more compact. I would love to hear your opinion about this
sensor. Are you going to use it any of your projects? If yes, what kind of projects are you going
to build using this sensor? Please post your ideas below, I would love
to read them. Thanks! If you are new to the channel, I would love
to have subscribed by clicking on the channel icon here, because every Saturday I post a
new video about DIY electronics and robot projects. I hope you will join our community. See you next week! [ Translating these subtitles? Add your name here! ]

Danny Hutson

53 thoughts on “Arduino Project: Weather Station with a BME280 sensor and an LCD screen with Arduino Mega

  1. Nick, you can look at my recent video what can be done with ESP8266 and cheap LCD – Arduino Uno Shield type. Total price of my Internet Weather Station is about $10. It's time to switch to ESP8266 and STM32 world.

  2. i done this in the past with a standalone atmega chip on internal clock with DHT22 and the BMP.. a nokia lcd displays the data

  3. Τέλειο βίντεο. Μήπως θα μπορούσες να κάνεις ένα βίντεο για το πώς να συνδέσεις ένα Micro SD module στους μετεορολογικους σταθμούς? Ευχαριστώ. Συνέχισε την καλή δουλειά!!!

  4. Ανέβασε λίγο το επίπεδο, αυτά πλέον είναι εύκολα και τα έχεις ξανά κάνει στο παρελθόν.. Φιλικά.

  5. Thanks for this Contribution.
    You asked for projects wit BME 280. I use many BME280 together with WeMos ESP8266. Plase pay attention using the adafruit library. By a self heating effect it will lead to a temperature error. Temperature will be measured too high. It is much better to use the https://github.com/embeddedadventures/BME280 allowing the parameters recommended in the BOSCH data sheet.
    I published some measurements and comparisions here: http://homematic-forum.de/forum/viewtopic.php?p=324372#p324372 even this is in German language you will see the diagrams and google may help to translate.
    For the quality of humidity measurements see http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html

    The pressure sensor is also very precise. I used it to build a pneumatic inventory gauge (level measurement) for a stationary fuel oil tank. you can read it there: http://homematic-forum.de/forum/viewtopic.php?p=328133#p328133
    http://homematic-forum.de/forum/viewtopic.php?p=328152#p328152

  6. Hi! Sincere thankyou for making this project. What modifications would I need to make to the project so that I am able to store the 2second data in a simple text file (for creating graphs and recording historical high temperatures for a given date, etc.)

  7. Νίκο έχεις κάνει και κάνεις καταπληκτική "εκπαιδευτική" δουλειά. Έχω ανεβάσει εδώ http://www.hlektronika.gr/forum/showthread.php?t=88190&p=800570&viewfull=1#post800570 μερικά link απο την δουλειά σου!!! Η προσφορά σου στην εκπαίδευση της πλατφόρμας του Arduino είναι πολύ αξιόλογη. Συγχαρητήρια.

  8. Can I use 6-pin BME280 module for this project? Is there any difference between the 4-pin and 6-pin sensor? Thank you!

  9. I liked this video quite a lot. I had no clue such a little (yet complete) sensor existed. And it's also very cheap. I bought it from your link… I hope you get a few cents from it.

  10. I have a question how can i use leds to show the level of the temperature, the humidity and the barometric pressure with 9 leds or with a 16×2 i2c lcd screen thx for your answers

  11. I get error compiling code: "exit status 1 redefinition of float temperature".I am not a programmer any help appreciated.

  12. You beat me to it. I'm pretty much in the process of making the same thing you're making but instead I'm adding a ds3231, am going to log data like (Max temp, Min temp ect) on its eeprom and the processor is an 8051

  13. Hi! My name is Benedito and i am meteorologist. First my congratulations by excellent work. This weather station project is great! But i have a question. How i do to save the meteorological informations in the .txt or .dat format? It exist a computer program that execute this record process? I have another question. What is cost of the all components these project in dollar?
    This project is very good. It have infinity applications, mainly in education high school.
    Thanks!

  14. I am doing the same, but there's some problem seeing the result in the serial monitor.It's not showing the result…what are the changes to be done to see result in serial monitor.

  15. Hi, great job, thanks.
    Do you have CODE OF THE PROJECT for
    Weather Station with a BME280 with a Nokia 5110 LCD Display.

  16. I couldn't launch the BME280 sensor. I keep getting error messages. Could you help please?

  17. I plan on using it along with a "snow/ raindrop detection sensor module and a capacitive soil moisture sensor (as backup) and a radio transmitter to send the data from outside to inside my house if I can get it all on an ATTiny. Otherwise I'll most likely use an ESP32 and use the on board bluetooth or wifi, and add a lux sensor. Then 3D print a case for it. 😉

  18. I love your videos. However, I have been having trouble getting my BME280 to work, so I decided to buy the parts that you listed for your project and try to follow it as is without deviation. Since I already had 3 of the sensors I did not buy any more. Sadly mine is not 5V tolerant, so I planned to use a logic level shifter. Nevertheless, before I ever got that far I realized that there was not enough power to run both the mega and the screen at the same time. I tried first hooking it up to my raspberry pi 3B+ with a 2.5 amp power supply and then on my regular computer. Neither would make the screen light up. I thought it might be the screen so I tried putting it on my Uno and it lights up. Then I thought I might have a bad mega but it will run the blink program without the screen attached. I noticed that the screen hat does not use the scl or sda pins, so I do not know how I could do the project with the Uno. any ideas how I can get more power to the mega, or any other ideas?

  19. Hi, thanks for the info. I am getting the following errors

    compilation terminated.

    exit status 1
    Error compiling for board Arduino/Genuino Uno.

  20. Hi. Nice job!
    But I think our brains visualize and work better with analog display than with digital displays. What do you think of doing a project similar to the one below?
    https://www.youtube.com/watch?v=-jbLFXd0PYk

  21. Hi nick, would you please to create comparison of the humidity and temperature sensor, which is the best sensor

  22. Thanks for these details, I would like to know how to send some infos captured to puredata ? Maybe via udp ? Or if there exist other better choices ? Thank you !

Leave a Reply

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