With the release of a Raspberry Pi Pico with wireless capabilities the possibility of porting many of the CPU less intensive projects previously done with the Raspberry Pi / Pi Zero to this inexpensive platform! Our Raspberry Pi based weather station is one of these projects; using a quad-core computer to read a few sensors is not really using the Pi 4 to its fullest potential.
In this multi-part tutorial we will be building a similar weather station to our original Raspberry Pi based project. We will be using the Raspberry Pi Pico W to take full advantage of the wireless capabilities and our Raspberry Pi Pico 1591B Weather Board to extend its capabilities. Our basic Weather Station will measure Wind Speed, Wind Direction, Rainfall, Temperature, Air Pressure, and Humidity. Going forwards, additional sensors could be added without much trouble using the Qwiic / STEMMA QT port on the Weather Board.
The Raspberry Pi Pico 1591B Weather Board can be used with the Pico or the Pico W. In this tutorial we will be using the Pico W as we want the WIFI connectivity. A standard Pico can be used, and much of the code as well, but we do recommend following the tutorial exactly if you are not experienced.
Going forwards there will also be tools and other components required – we will discuss these throughout the next 3 parts of this tutorial.
There are a few things we will need to solder to the Weather Board to get up and running. Starting with the most important part first, we will need to attach the Raspberry Pi Pico W.
Similar to the ESP series of microcontrollers, the Raspberry Pi Pico uses castellated edges on the board, allowing this to be surface mounted to the board below. Don’t be thrown off by the surface mount soldering – this is a very easy method of connecting two boards, well suited to conventional soldering irons and solder. No special SMT soldering equipment / reflow / etc. are required.
In the next few steps we will get the Pico W attached to the Pico 1591B Weather Board.
This is very easy to do, simply line up the board on the outline as shown in the image. We are just going to solder one pin in one corner to ensure everything is lined up as it should. Don’t solder all the points at once, as adjusting the placement of the board is extremely difficult once several solder pads are filled. This method allows the single point to be reheated and the board moved if adjustment is needed.
If everything is still aligned as it should be, we can now solder all the remaining pads. Your result should be similar to the example image.
After this is complete, inspect your work and ensure there are no bridges between adjacent pads. Once you are satisfied the soldering completed correctly, we can move on to the next step!
Next we are going to install a 3 Pin 2.54mm Pitch 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.
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 Pico Weather Board – so no need to wire one in!
Connect your DS18B20 according to the color code of your sensor.
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 sensors – they will just plug into the Weather Board. More information on the sensors and how they work can be found on their datasheet.
Wind Direction is handled a little differently, this sensor is analog and provides a variable resistance depending on which of the 16 directions the vane is facing. We use a voltage divider circuit on the Weather Board to convert this to a variable voltage, which we can then read using the Pico’s built in Analog to Digital converter to get the direction. More information on the sensor and its resistance table can be found on the datasheet.
With many of the most popular sensors out there now being available with a Qwiic or STEMMA QT connector, numerous sensors can be added to a project using a single plug. Just about all of our new products feature this connection point, so gone are the days of having to solder protoboards and figure out pinouts for various sensors – just plug and play!
The BME280 breakout by Adafruit is one of these compatible sensors. To connect it, we are going to use a Qwiic cable and simply plug it into the BME280 running the other end to the Weather Board. There are numerous lengths of cable available in the Qwiic ecosystem, but for this instance we are using the 50mm version.
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 as well.
In the next section of the tutorial we will be powering up the Weather Station and writing code to start reading all of the sensors. The Pico works well in both Arduino and MicroPython so we will go into both versions in separate variants of the tutorial.
3 thoughts on “Raspberry Pi Pico Weather Station – Part 1”
Great tutorial. Well written and easy to follow. Where can I find the next part of coding the weather station?
William @ BC Robotics
Thank you for the feedback! The next part should be posted in a few days
Great tutorial & project.
Looking forward to the next installment * the wind direction/speed sensor coming into stock