Raspberry Pi Pico ProjectsRaspberry Pi Projects

Raspberry Pi Pico Weather Station Using DHT11 Sensor

Introduction

In this tutorial we will learn How to make Raspberry Pi Pico Weather Station using Dht11 Humidity Sensor, a weather station to monitor the temperature and humidity in your home or office We will use a 16×2 LCD Display and display the DHT11 temperature and Humidity value on it.

Raspberry Pi Pico Weather Station

The DHT11 Sensor is a cheap cost digital temperature and humidity sensor. we used the Raspberry Pi Pico board to read the temperature and humidity data of the Dht11 Sensor. The data is displayed on a 16×2 LCD screen.


Materials Required

Raspberry Pi Pico

raspberry-pi-pico

The Raspberry Pi Pico is a tiny, yet powerful microcontroller that was released in January 2021. It is based on the RP2040 chip and is designed to be used with the Raspberry Pi. The Pico is a great microcontroller for beginners and professional engineers alike. It is very affordable and straightforward to use, yet still has a lot of features that more developed users will appreciate.

Raspberry pi pico Pinout

raspberry_pi_Pico-Pinout-

What is the dht11 Sensor?

Dht11_Sensor_Module

DHT11 sensor is a temperature and humidity sensor which is used in different applications like weather forecasting, etc. It consists of a sensing part and an NTC temperature sensor. The DHT11 sensor can measure the temperature and humidity of the air in the range of 0-50°C and 20-90% RH respectively.

Specification:

  • Dimensions 13 x 29 x 8 mm
  • 3.3 – 5.5V power supply
  • Average power consumption 0.2 mA
  • Communication: 1-Wire (OneWire)
  • Temperature measurement:    * Temperature measurement range 0 – 50 ° C    * 8-bit resolution (1 ° C)    * Accuracy 1 ° C    * Response time 6 – 15 s (typically 10 s)
  • Moisture measurement    * Humidity measurement range 20% – 90% RH (at 25 ° C) – in the full temperature range – 30% -80%    * 8-bit resolution (± 1% RH *)    * Accuracy ± 4 RH * (at 25 ° C)    * Measuring range 6 – 30 s    * Stability ± 1% RH / year



Schematics for Raspberry Pi Pico Weather Station

The hardware setup and Mapping guide for the DHT11 Sensor with Raspberry Pi Pico board & 16×2 LCD is super easy. The connection diagram is given Below.

Raspberry pi pico dht11 Weather stationConnect the DHT11 digital output pin to the GP15 of the Raspberry Pi Pico Board. Connect the SCL & SDA pin of the OLED Display to Raspberry Pi Pico GP27 & GP26 Pin. Supply DHT11 & 16×2 Display with VBUS(SV) VCC & Connect their GND(-) pins to Raspberry Pi Pico GND(-) Pin.

LCD -> Pico

  • GND -> GND
  • VCC -> VBUS(SV)
  • SDA -> GP26
  • SCL -> GP27

DHT11  -> Pico

  • Vcc(+) -> 3.3V
  • Out(o) -> GP15
  • GND(-)  -> GND

Source Code for Raspberry Pi Pico Weather Station

The code comprises 4 parts:

  1. dht.py
  2. lcd_api.py
  3. pico_i2c_lcd.py
  4. main.py

dht.py

Firstly you need to create a new file in Thonny IDE. Copy the following code & save the file by the name dht.py on Raspberry Pi Pico Board.



lcd_api.py

Open a new tab again in the Thonny IDE. Copy the following below code and paste it onto the Thonny IDE new tab. Save the file by the name lcd_api.py in Raspberry Pi Pico.



i2c_lcd.py

Open a new tab again in the Thonny IDE. Copy the following below code and paste it onto the Thonny IDE new tab. Save the file by the name i2c_lcd.py in Raspberry Pi Pico.

main.py

and finally, Open a new tab again in the Thonny IDE. Copy the following below code and paste it onto the Thonny IDE new tab. Save the file by the name main.py in Raspberry Pi Pico.



Conclusion

 

After the Upload code, You will see that the Pico board Start displaying the weather temp. on Display.

Read Similar Articles:

Related Articles

Leave a Reply

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

Ad
Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker