Skip to content
Step by Step Internet 馃寪 Guides for learning to surf the Net

How to build a weather station with Arduino? Step by step guide

Versatility is a prominent feature that Arduino boards have. This is why it is possible to create a weather station taking into account some concepts in its development.

This will prevent you from making mistakes when choosing materials and programming opcodes. If you want to know how to do it, you will have to continue reading this article until the end.

We will explain, in detail, the process you must go through to design and assemble a weather station with Arduino. By last, you will find a list with the best kits that you can use to assemble a project of these.

What do you need to build a weather station with Arduino? Main kits and plates

The materials you will need to build a weather station with Arduino are the following:

Arduino UNO board

You will need that I have a microcontroller of type ATmega328P, with an input voltage of 7 to 12 volts, operating at 5 volts from a continuous current of 20 mA. In addition, you must have a memory of 32 KB.

Sensor to detect the relative humidity of the environment

In this case, a supply that is between 2.7 and 3.3 volts. It should also have a temperature range between -10ºC to 60ºC with an accuracy of + -3%. While the measurement range should be 1% to 99%.

Atmospheric pressure detector and temperature sensor

Must have a working range of -40ºC to 60ºC and a detection capability of 300 to 1100 hPa with 0.03 margin of error. The power supply that this board must have will have to be around 1.8 and 3.6Vdc.

Bluetooth module

This board will be required to handle communication with a phone with an operating system Android. Operating current should be , while the voltage for the supply will have to be between 3.3 and 6Vdc.

Arduino programming environment

To program you will need the Arduino software. To do this you will have to go with your trusted browser to the URL https://www.arduino.cc/en/main/software download the program that is compatible with Windows, Linux and MacOS.

Notepad ++ text editor

With this editor you can work on programming any type of language. To download it you will have to enter the official page through the link https://notepad-plus-plus.org/downloads/.

Developer App Inventor 2

With this platform you will be able to create in a much easier way the applications that you will use on your smartphone Android via Bluetooth. In order to download it, you will have to enter the page https://appinventor.mit.edu/explore/ai2/windows.html and then follow the simple installation process.

Learn step by step how to design and assemble a weather station with Arduino

Next, you will find the step by step you must do to design and build a weather station with Arduino.

Pay attention to every detail:

Connect the I2c bus

East bus is a protocol that is used to communicate in a specific way the master with the slaves in a process of electronic communication. For this reason, it is convenient to start at this point.

What you will have to do is connect in SDA (Serial Data):

  • The Vcc of 1K.
  • The Arduino board who will work as a teacher.
  • Pressure sensor atmospheric and temperature.
  • The detector moisture.
  • The plate bluetooth.

In SCL – Serial Clock and in GND you must include:

  • The Arduino Master.
  • The sensorss of humidity, temperature and atmospheric pressure.
  • The board by bluetooh.
  • The Vcc of 1K.

For this you must connect the GND from the humidity sensor with the brown wire to any pin of the Arduino GND, then the black wire will connect the VDD to the 3.3V pin from the Arduino board. While for the temperature and atmospheric pressure sensor you will have to connect the analog pin 4 and 5 of the Arduino with gray and white SDA and SLC cables.

In turn, the bluetooth module must take the GND pin and connect it with some digital pin of the Arduino board. Finally, the blue cable will be in charge of being connected to the digital pin 10 to HC-06 and from the peripheral to pin 11 from Arduino.

Temperature and pressure sensor algorithm

Temperature and pressure sensor algorithm

This process starts with the Arduino library via l2c bus which, through the reading of calibration data and establishes a decision making. In case there is no error in reading of calibration data it will be understood that the operations of the floating point data are not valid and returns the value 1. Instead if there is an error in the reading, the value it returns is 0 and in this way the process ends.

Temperature sensor algorithm library

The algorithm that is responsible for initializing the temperature data tells the sensor that it needs to collect the data by means of specific bytes. It then registers a control in the first position, after a while it also registers in the second position. Keep in mind that it takes writing in bytes as the temperature command. If an error has not occurred, it returns the value 5, but if there is an error when writing the bytes, it returns the value , causing the process to end in both cases.

Atmospheric pressure sensor algorithm

In the case of the atmospheric pressure method, the algorithm process used to return pressure captured by sensor starts when it is indicated in the datasheet that the device needs to take the temperature.

Then, result record is performed in the first position and returns a byte read. Which, if it has not produced errors, performs the temperature calculation and returns the result to end the process. On the other hand, if there is an error in the reading, it returns the value result and thus ends the procedure.

To establish the atmospheric pressure reading, the value of the sampling must be indicated, which will return in waiting time. Once the type of sample is indicated, 1 byte will be written to the device that is displayed in the process. Then if the write method ran successfully, it will return the time in the unit of measure ms, but if the process has failed it will return the value . In both cases, the measurement process ends.

Humidity sensor

The algorithm used in this case is runs it through the library called Wire. This process is responsible for the transmission of data between the device and the sensor, the reading of the data and the availability of the device to do that reading. In this case, when the process starts, the transmission between the Arduino and the slave, then the data is transmitted and a request for bytes occurs indicating the direction between the master and the slave.

Is taken as an unsigned integer and set, after a timeout, the result to end the process. If the frequency counter is not available, throw the value and the process ends. On the other hand, if the frequency counter is available, it will work to read the value of this sequence and return in units of measure. hr, and then finish the procedure.

Arduino board algorithm

In this case the algorithm is made up of three parts. The first is the initialization and is in charge of importing the libraries, establish the class types and start up all the devices involved. The second part of this algorithm is the reading of data coming from the different sensors. At this stage reception methods are used are related to the libraries of the first part.

By last, the third section that this algorithm has is to communicate the information through bluetooth. This is done by transmitting the data through the Inventor 2 app. If you don’t want to do it by this means you can choose to transmit the data to a led screen. These programming codes can be found in the next step.

Writing the Arduino codes

To perform the main operations of a weather station you will have to use these codes:

Set the pin to connect to the sensor:

Incorporates the humidity variable:

Next, you have to indicate which pins will use the led screen, for this, you have to write:

Indicate the place where the writing will begin:

To read the humidity, the following codes must be entered:

At this time, you must indicate where the writing will begin on the led screen:

Meet the best Arduino Kits to create weather stations from scratch

Next, we will show you the best kits you can buy for create your own weather station with Arduino.

Choose the one you like best:

ESP8266 Weather Station

ESP8266 Weather Station

This weather station element kit includes a temperature sensor, ambient pressure and humidity sensor. It has a led screen for an Arduino IDE IoT Starter board. In addition, you can find a complete guide so that the assembly is not a problem for you.

LCD 1602 Kit

The Arduino board that this kit brings is the UNO R3 with an I2C 1602 bus, which allows a better management to transmit the information. It has a module to detect humidity and temperature, You can also find a board for the detection of water and sound. The newest thing about this equipment is that it includes a remote control of a servomotor to tilt the components in all directions.

Weather station kit with BMP180

Weather station kit with BMP180

The sensors that are included in this set of elements are the BMP180, DHT11 and BH1750FVIIn this way, atmospheric pressure, temperature and humidity data can be obtained with a high degree of precision. Includes a manual in English with which you can work to make a step-by-step guide.