Just how to Build a Raspberry Pi Pico Weather Station

By  |  0 Comments
Related Products

Do you require an electronic hydrometer to keep track of the temperature level as well as moisture in your house or workplace? Rather than acquiring one, currently you can make your very own with a Raspberry Pi Pico microcontroller board. When the task is full, string the DHT sensing unit via a home window for the most exact climate analyses (or utilize this task to check your interior temperature level).

In this tutorial, we use the Raspberry Pi Pico microcontroller to check out temperature level as well as moisture information as well as show the information on our 16 x2 LCD display. Unlike every various other Raspberry Pi, the Pico (see our Raspberry Pi Pico evaluation) is a microcontroller board, instead of a full-fledged Linux computer system. That makes it excellent for managing light-weight jobs, including sensing units as well as various other digital elements, particularly those that make use of analog input, something various other Pis can not take care of without an add-on board.

The Pico board can be configured with C/C++ or MicroPython. We have actually picked C/C++ for this tutorial. As an incentive, this tutorial likewise consists of a fundamental setup of Pico SDK as well as cmake. Please allow us recognize in the remark area if you want to see this tutorial in MicroPython.

What You’ll Need

Timing: This task is approximated to take a minimum of 1 hr to finish, however we have actually consisted of the last bundle data (UF2 data) as a ‘short-cut’ technique.

The bulk of this tutorial is based upon incurable commands. If you are not acquainted with incurable commands on your Raspberry Pi, we very advise evaluating 25+ Linux Commands Raspberry Pi Users Need to Know

Setting up your Raspberry Pi Pico

1. This task calls for pin links to your Pico board. If you have actually not currently done so, you’ll require to solder pins to your Raspberry Pi Pico Connect your key-board, computer mouse as well as display to your Raspberry Pi.

2. Boot your Raspberry Pi. If you do not currently have a microSD card see our write-up on exactly how to establish a Raspberry Pi for the very first time or exactly how to do a brainless Raspberry Pi mount

3. Update Raspberry Pi OS. Open an incurable as well as get in:

 sudo apt-get upgrade && & & sudo apt-get upgrade

Test your Pico board with the C/C++ Blink example code located right here

4. Download the blink.uf2 data from the C/C++ Getting Started overview

5. While holding back the BOOTSEL switch on your Pico board, attach your microUSB from your Pico board to your RaspberryPi.

( Image credit report: Tom’s Hardware)

6. Drag as well as go down the blink.uf2 data from your Downloads folder to RPI-RP2 detachable media Currently enjoy the on-board LED on your Pico board beginning to blink. You can detach your Pico board from your Raspberry Pi for the following action.

Raspberry Pi Pico Weather Station

( Image credit report: Tom’s Hardware)

Connect Your Pico to LCD display as well as DHT22 Temp as well as Humidity Sensor

1. Place your Pico board on your breadboard.

2. With your jumper cords, attach GND from the Pico to the GND rail, Connect pin 36/ 3.3 V to the power rail.

3. Connect your DHT22 sensing unit to the breadboard as well as attach GND to the GND rail, power to the power rail as well as the OUT signal to GPIO15/ Pin 20 (for 3 pin DHT sensing units). If you are making use of a 4-pin DHT22 after that consist of a 10 K ohm resistor as received the circuit layout.

4. For your LCD display, attach SDA to Pin 6 as well as SCL to Pin 7

5. To power your LCD display, attach LCD VCC to VBUS (pin 40) on the Pico as well as LCD GND to the GND rail of your breadboard

( Image credit report: Tom’s Hardware)

Short Cut Method – Pico Weather Station

If you remain in a rush to obtain your Pico Weather Station up as well as functioning, you can download and install the put together UF2 construct data right here Please keep in mind that making use of the put together data does not permit you to personalize the message or transform the signal pins.

1. Download weatherstation.uf2 from right here

2. Disconnect your Pico board from your Raspberry Pi.

3. Hold down the BOOTSEL switch while attaching your Pico board to your Pi. You must see a pop-up as well as RPI-RP2 look like detachable media.

4. Drag as well as decrease weatherstation.uf2 to your Pico identified RPI-RP2 from your downloads folder in your data supervisor.

( Image credit report: Tom’s Hardware)

In a couple of secs (to a min) you must see your space temperature level as well as moisture show on the LCD display.

( Image credit report: Tom’s Hardware)

Full Instructions: Raspberry Pi Pico Weather Station

This technique generates the very same result, an LCD that presents temperature level as well as moisture, however you will certainly discover exactly how to put together resource code for the Pico board. This technique likewise consists of a fundamental setup of the pico-sdk for customers going back to square one. For an extra thorough setup with even more instances, take a look at ” Getting begun with Raspberry Pi Pico C/C++ dev” PDF right here

1. Open a Terminal on your Raspberry Pi desktop computer (press Ctrl-T).

2. We’ll begin by developing a directory site as well as duplicating the code we require to put together C/C++ for the Pico board with the adhering to commands.

 mkdir weather-station.
cd weather-station.
git duplicate -b master https://github.com/raspberrypi/pico-sdk.git.
cd pico-sdk.
git submodule upgrade-- init.
cd.
git duplicate https://github.com/carolinedunn/pico-weather-station.

( Image credit report: Tom’s Hardware)

3. Install cmake with the proper reliances for Pico. This action can take about 5 mins on a Raspberry Pi 4.

 sudo appropriate upgrade.
sudo appropriate mount cmake gcc-arm-none-eabi build-essential.

( Image credit report: Tom’s Hardware)

4. Currently is a blast to have a look at the resource code we’ll make use of to construct our climate terminal.

Optional: Navigate to/ home/pi/weather-station/ pico-weather-station as well as open weatherstation.c with Geany in your File Manager to evaluate the resource code.

( Image credit report: Tom’s Hardware)

Code Notes for weatherstation.c

  • weatherstation.c is the major resource apply for our task today.
  • Line 17: We established our Pico to review our DHT from GPIO15 You can establish several DHT’s or transform your GPIO pin right here.
  • Line 199-200: This printf declaration is for repairing functions as well as can just be accessed using minicom. Accessing analyses using minicom will certainly be reviewed in the repairing area.
  • Line 202: We will certainly show Farenheit analyses in this climate terminal. You can transform the analysis to Celsius.
  • Line 211: Display an upgraded temperature level at 2 2nd periods (or 2000 nanoseconds).

Compile the C/C++ code as well as transfer to Pico

5. In the very same incurable from Step 3, get in the adhering to commands to construct your UF2 data.

 cd pico-weather-station.
mkdir construct.
cd construct.
export PICO_SDK_PATH=././ pico-sdk.
cmake.
make.
Image 1 of 2

Raspberry Pi Pico Weather Station

( Image credit report: Tom’s Hardware)
Image 2 of 2

Raspberry Pi Pico Weather Station

( Image credit report: Tom’s Hardware)

6. Navigate to/ home/pi/weather-station/ pico-weather-station/build

( Image credit report: Tom’s Hardware)

7. Disconnect your Pico board from your Raspberry Pi.

8. Hold down the BOOTSEL switch while attaching your Pico board to your Pi. You must see a pop-up as well as RPI-RP2 look like detachable media.

9. Drag as well as decrease weatherstation.uf2 to your Pico identified RPI-RP2 from your downloads folder in your data supervisor.

( Image credit report: Tom’s Hardware)

In a couple of secs (to a min) you must see your space temperature level as well as moisture show on the LCD display.

( Image credit report: Tom’s Hardware)

Once you obtain your Pico Weather Station functioning, you can include an LED or a buzzer if the temperature level or moisture exceeds (or listed below) a limit.

Battery Operated as well as Portable Solution

You can currently power the Pico without use the Raspberry Pi. Merely disconnect the USB from the Raspberry Pi (attached to the Pico) as well as plug in to your power financial institution battery charger or USB power adapter.

Raspberry Pi Pico Weather Station

( Image credit report: Tom’s Hardware)

Troubleshooting Guide

  • LCD display is powered on however space: Adjust the potentiometer on the reverse side of your LCD display.
  • Temp as well as Humidity are constantly no: Adjust the timing in line156 if (matter > > 46).
  • LCD display is functioning, however I would certainly such as to see the raw temp/humidity information: Open a brand-new incurable as well as key in the adhering to commands:
 sudo appropriate mount minicom.
minicom -b 115200 -o -D/ dev/ttyACM0.

( Image credit report: Tom’s Hardware)

Running minicom will certainly tire the Pico’s 2040 chip. Information will certainly ice up as well as you will certainly see a couple of negative information analyses. This is ok.

happywheels

You must be logged in to post a comment Login