Raspberry Pi Pico & Nextion Weather Station Using Visuino

by RonFrtek in Circuits > Arduino

249 Views, 2 Favorites, 0 Comments

Raspberry Pi Pico & Nextion Weather Station Using Visuino

Raspberry Pi Pico & Nextion Weather Station using Visuino

In this tutorial we will learn how to make a simple weather station using the Raspberry Pi Pico board & Visuino to display Temperature & Humidity values on the Nextion display.

Watch the video!

What You Will Need

Raspberry-Pi-Pico-RP2040-boot.png
WEATHER (12).png
2022-02-22_18-01-07.jpg
nextion-display.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
41015728-1.jpg
breadboard.png


The Circuit

2023-11-19_18-08-48.png
2023-11-19_18-55-31.png
  • Connect Nextion Display pin [+5V] to Pi Pico RP2040 pin [VBUS]
  • Connect Nextion Display pin [GND] to Pi Pico RP2040 pin [GND]
  • Connect Nextion Display pin [RX] to Pi Pico RP2040 pin [1]
  • Connect Nextion Display pin [TX] to Pi Pico RP2040 pin [2]
  • Connect DHT11 pin [+5V] to Pi Pico RP2040 pin [VBUS]
  • Connect DHT11 pin [GND] to Pi Pico RP2040 pin [GND]
  • Connect DHT11 pin [S] to Pi Pico RP2040 pin [4]

Nextion Editor

2023-12-11_16-49-33.jpg
F8IES1ILG54QTGH.jpg
F2FUVTSLG54QTEP.jpg
FCHCVFXLG54QTEO.jpg
F5S2Q1DLG54QWPG.jpg
2023-11-19_19-02-27.png
2023-11-19_19-05-47.png
2023-11-19_19-06-52.png
2023-11-19_19-07-12.png
F7NPAJTLG54R1AY.jpg
F6515SALG54R1AZ.jpg
  • Download Nextion Editor and Install it
  • Start Nextion Editor
  • In the Nextion Editor click on the "New" button
  • In the Window set the name for the Project like "PicoDht11"
  • In the "Setting" window select the Model of your Nextion Display & click "Ok"
  • Select Display Direction 90 & click "Ok"
  • In the Menu select "Tools">"Font Generator"
  • In the Font creator window set the "Height" to 40 & set the name for your font and click "Generate Font", Save the Font, you will be asked "Add the generated font?" Click Yes
  • In the Editor on the left in the "Toolbox" find:
  •  "Text" & drag it to the right
  • and in the Attribute window set "txt" to TEMP
  •  drag another "Text" to the right
  • and in the Attribute window set "txt" to HUM
  • In the Editor on the left in the "Toolbox" find:
  •  "Gauge" & drag it to the right
  • and in the Attribute window set "bco" to green
  •  drag another "Gauge" to the right
  • and in the Attribute window set "bco" to blue
  • You can also set other settings such as "PCO" or "WID"


  • In the Toolbar click on the "Compile" button
  • In the Menu Select "File" > "TFT File Output"
  • Set the Output folder & click on the "Output" button
  • Save the File to the SD card
  • Insert the SD card to your Nextion Display
  • Power the Raspberry Pi Pico/RP2040 and you will notice that the Nextion Display will start to Update it self
  • On the Finish disconnect the power and remove the SD card from the Nextion display


Start Visuino, and Select the Raspberry Pi Pico (RP2040) Board Type

select-board-uno.jpg
FROSP2ELNEMAEN9.png

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Raspberry Pi Pico (RP2040)" as shown on Picture 2


In Visuino Add & Set Components

F9A0TAXLG54R2OQ.jpg
2023-11-19_19-14-40.png
2023-11-19_19-15-04.png
2023-11-19_19-15-22.png
2023-11-19_19-18-00.png
2023-11-19_19-18-13.png
2023-11-19_19-19-08.png
2023-11-19_19-20-03.png
  • Add "Nextion Display" component
  • Double click on the "DisplayNextion1" And in the Elements window drag "Analog Gauge" to the left side and in the properties window set "Max" > "Value" to 40
  • Drag another ""Analog Gauge" to the left side and in the properties window set "Max" > "Value" to 100 and "Element Name" to z1
  • Drag "Text" element to the left side and in the properties window set "Element Name" to t2
  • Drag another "Text" element to the left side and in the properties window set "Element Name" to t3
  • Close the Elements window


  • Add 2X "Analog Multi Source" component
  • Add "DHT11" component

In Visuino Connect Components

2023-11-19_19-25-20.png
pico-nextion.png
  • Connect "HumidityThermometer1" pin [Sensor] to Raspberry Pi Pico/RP2040 digital pin [2]
  • Connect "HumidityThermometer1" pin [Temperature] to "AnalogMultiSource1" pin [In]
  • Connect "HumidityThermometer1" pin [Humidity] to "AnalogMultiSource2" pin [In]
  • Connect "AnalogMultiSource1" pin [0] to "DisplayNextion1" > "Analog Gauge1" pin [In]
  • Connect "AnalogMultiSource1" pin [1] to "DisplayNextion1" > "Text1" pin [In]
  • Connect "AnalogMultiSource2" pin [0] to "DisplayNextion1" > "Analog Gauge2" pin [In]
  • Connect "AnalogMultiSource2" pin [1] to "DisplayNextion1" > "Text2" pin [In]
  • Connect "DisplayNextion1" pin [Out] to Raspberry Pi Pico/RP2040 serial 1 pin [In]

Generate, Compile, and Upload the Project

F0IN61GLNEMADQ6.png
2023-11-19_18-49-14.png
  • Before uploading the Project hold the button "BOOTSEL" on the board while connecting it to the USB on your computer.
  • After connecting it to the USB, release the button and in Visuino click on the button Compile/Build and Upload.
  • You don't need to select any port or anything else, Visuino will do all the work and Upload the project.


Play

After uploading the project to the Raspberry Pi Pico/RP2040 the Nextion display will start to show the Temperature and Humidity values.

Congratulations! You have completed your Weather Station project with Visuino. Also attached is the Visuino project, that I created for this Tutorial. You can download and open it in Visuino: https://www.visuino.com

For more Pico ideas &Troubleshooting, check this tutorial:

https://www.instructables.com/RP2040-Raspberry-Pi-Pico-LED-Blink-Using-Visuino/

Downloads