BC Robotics

Raspberry Pi Weather Station – Part 1

  PRODUCT TUTORIAL

In this tutorial we are going to go in a little bit of a different direction – this will be a project tutorial, which when followed, will result in a working Raspberry Pi based Weather Station that streams data to the ThingSpeak Data service. We will break this down into four components: A board overview and assembly guide, collecting the data using python, sending the data to ThingSpeak, and finally a section looking at installation outdoors. The tutorial is focused on our Raspberry Pi Weather Board, designed and manufactured here at BC Robotics.

About the Board:
The Pi Weather Board was designed to make the often messy task of connecting a bunch of different sensors to the Pi as organized as possible without compromising on choice of sensors. The board also addresses the Pi’s inability to read analog inputs with a built in 4 channel 12-bit Analog to Digital Converter.

So what parameters does it measure? The board itself doesn’t have any sensors on it, so this is going to depend on which sensors you choose to go with. Following this tutorial with the suggested parts will result in a weather station monitoring Wind Speed, Wind Direction, Rainfall, Temperature, Air Pressure, and Humidity. Going forwards, additional sensors could be added without much trouble.

Raspberry Pi Weather HAT and Raspberry Pi installed in weatherproof box

The Parts Needed:

In addition to a Raspberry Pi, this tutorial will be requiring a few additional parts:

Going forwards there will also be tools and other components required – we will discuss these throughout the next 3 parts of this tutorial.

Step 1 – A Quick Overview of the assembly steps

Most of the difficult tasks have already been taken care of by the Weather Board so assembly wont be too bad! We are going to start by soldering the stacking header to the Pi Weather HAT. Once that is completed, we will solder Adafruit BME280 breakout board, add the DS18B20 Temperature Sensor, and plug all of the sensors in.

9.1%

Step 2 – Soldering the header

First we need to solder the header that allows this board to plug into the Raspberry Pi. We recommend using this header, but any compatible Raspberry PI GPIO header will work. If you haven’t soldered before, or want a quick refresher course, have a look at this awesome comic: Soldering Is Easy! https://mightyohm.com/…/FullSolderComic_EN.pdf

Start by Tacking two opposite corners of the connector in place and checking the connector alignment. We do this to ensure the connector is sitting correctly before soldering all 40 pins; once these have all been soldered, it is very difficult to adjust the alignment.

18.2%

Step 3 – Soldering the header (continued)

Once the connector is aligned to the board, and you are happy with the alignment, solder the remaining pins. It should look something like the attached photo when you are finished!

27.3%

Step 4 – BME280 Part 1

The BME280 is an awesome little Temperature / Humidity / Pressure sensor and it works great with the Pi!

If you are using the Raspberry Pi 3+ or Raspberry Pi 4 there are a few things to consider. The Pi3+ and Pi4 have an extra 4 pin header for Power over Ethernet (POE) capabilities. This connector will likely contact the pins on the bottom of the BME280 if it is installed in the normal position on the Weather Board. There are two ways this can be avoided: Remove the POE header (since it can be easily re-installed later) or install the BME280 in the alternate pin location as shown in the attached image.

Once you have sorted out where it will be located, solder in the chunk of breakaway header to the Pi Weather Board. This breakaway header is normally included with the BME280.

36.4%

Step 5 – BME280 Part 2

Flip the board back over, and place the Adafruit BME280 on the pins, matching the orientation to that of the board footprint. Tack one of the corners to set the board in place, and once you are happy with the position, solder the remaining pins.

45.5%

Step 6 – DS18B20

Next we are going to install a screw terminal to connect the DS18B20 Temperature Sensor. The DS18B20 is weatherproof, so the probe will actually be mounted outside of the box, with the wires running into the board, so having them removable will make the installation into a box much easier going forwards. If you prefer, you could also solder the wires direct to board.

We went with a screw terminal on this one, but any standard 3 pin 2.54mm pitch connector would work. Just like all the other connectors, tack one pin in place, check the alignment, and solder the remaining pins.

54.6%

Step 7 – DS18B20 Continued

The DS18B20 can ship with two different sets of wire colors – these are often seen with Red, Black and White or Red, Black, and Yellow. Normally Red will be power, Black will be Ground, and White / Yellow will be the Data pin. Be sure to check the pinout, we list it on our product page for the DS18B20.

A 4.7K Ohm Resistor is normally needed to between the 5V and Data Pin when using the sensor; this is taken care of by the Raspberry Pi Weather Board – so no need to wire one in!

Connect your DS18B20 according to the color code of your sensor.

63.7%

Step 8 – Rain and Wind Speed

The Wind Speed, and Rain Gauge are both basic digital sensors. The Anemometer (Wind Speed) is measured by counting how fast it spins in a given amount of time while the Rain Gauge measures how many times the gauge tips a precise amount of water over a given period of time. There is no soldering for these ones – they will just plug in along with Wind Direction. More information on the sensors and how they work can be found on their datasheet.

72.8%

Step 9 – Wind Direction

Wind Direction is a bit more difficult with the Pi – Wind Direction sensors are often analog, and this one is no exception. So why are the difficult? Well, the Raspberry Pi doesn’t have an Analog to Digital Converter. But no worry – the Weather Board also handles this problem. We have included a 4 Channel Analog to Digital Converter. All we have to do is plug it in! 

81.9%

Step 10 – Connecting the Wind & Rain Sensors

Connecting these sensors is quite straight forward – if you look carefully, one of the two RJ11 plugs at the end of their cables has 4 wires in it, while the other has two. Plug the 4 wire line into the “Wind” plug on the Weather Board, plug the 2 wire line into the “Rain” plug. 

90.9%

Step 11 – Double Check Your Work!

Before we power anything up, it is always a good idea to go through and make sure there are no issues with the work that has been done. Make sure all the solder joints are clean, with no un-intended bridging. Check to make sure all the sensors are plugged in correctly, add the two standoffs as shown, and connect the board to the Raspberry Pi. If using the Raspberry Pi 3+ be sure to check the POE header (located near the USB ports) is not contacting the header from the BME280 header between the Pi and the Pi Weather Board.

In the next section of this tutorial we will be getting the Raspberry Pi set up with the Raspbian operating system, installing software libraries for each sensor, and writing some basic Python code to read the sensor outputs. Ready to tackle it? Head over to Part 2!

100%

33 thoughts on “Raspberry Pi Weather Station – Part 1”

Leave a Reply

Your email address will not be published.

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
  • Attributes
  • Custom attributes
  • Custom fields
Click outside to hide the comparison bar
Compare