Introduction: Weather Display

About: I spent my career in computer networks. Now retired I am interested in topics that work my neurons. I am passionate about home automation and site administration that I host at home. I acquired skills in the f…

Construction of a weather display with the following specifications:

  1. Allow information to be read from up to three meters away. At a glance, users should be able to see what the weather is like.
  2. Display of indoor temperature.
  3. Display of outdoor temperature, humidity, wind direction, and wind speed.
  4. Display temperature trends over the last fifteen minutes.
  5. Use few components.
  6. Use an ILI9341 TFT display (240x320) in SPI mode.
  7. Use the Raspberry Pi W controller.
  8. Be able to easily access/modify the program once the device is complete.

Supplies

Very few components are required. I am using a prototyping board for proof of concept.

  1. The thermometer function (indoor) is provided by the DHT11 component.
  2. The weather function is provided by the “openweathermap” website. The site offers a free API key for access to weather data based on location. A URL with this key returns all the information in the form of a character string. This string is used by the program (see example in the bibliography section).

The device is powered by a USB cable connected directly to the Pico. Connecting to a PC allows you to refine the program and make improvements.


All files (applications and documentation) can be downloaded HERE .

Step 1: Basic Assembly

Assembly is simple and straightforward. The case, with its transparent front panel, makes installation easy.

Step 2: The Display

The images describe the functions displayed. The size of the characters makes them easy to read from a distance of 2 to 3 meters.

At a glance, you can see what the weather is like. Colors are also used when a value exceeds certain thresholds (e.g., white for outdoor temperatures below 4 degrees Celsius).

Three screens follow one another in sequence to allow all information to be viewed: temperatures, wind, general conditions, and humidity.

Step 3: The Program

The application contains several files.


"definitions.h" contains variable declarations as well as constant arrays.

  1. Constants related to internet access (WiFi, weather site URL).
  2. Weather report and associated images.
  3. Positions of graphic elements on the screen.
  4. Various variables for storing temperatures.

"functions-internet" groups together the functions related to relationships with the internet.

  1. WiFi startup.
  2. Weather information call.
  3. Extracting weather elements and storing information.

"function-display" contains the display functions for the three screens.

“progafftemp2” is the main program that orchestrates everything.


The diagrams show the progression of the program over time.


Special features of the program:

  1. Use of the “FixedString-main” library. It offers safer, simpler, and more predictable memory usage than dynamic String objects.
  2. The use of pointers allows for efficient memory management and performance optimization.
  3. The images used were downloaded from the “openweathermap.org” website and adapted by conversion to “.c” format (see bibliography).

The application is located in the "progafftemp2" folder.

Step 4: Conclusion

This project has few components and is easy to assemble. The data display is clearly visible and allows you to see the weather conditions at a glance. Since the device can be connected directly to a PC, you can customize the program to suit your needs. Enjoy it!

Bibliography

  1. Arduino 2.8″ ILI9341 Tutorial: http://educ8s.tv/arduino-2-8-ili9341-tutorial
  2. Adafruit GFX Graphics Library: https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts
  3. WiFi (Raspberry Pi Pico W) Support: https://arduino-pico.readthedocs.io/en/latest/wifi.html
  4. ArduinoHttpClient library <== examples for inspiration
  5. Openweathermap: https://openweathermap.org/weather-conditions
  6. Image converter: http://www.rinkydinkelectronics.com/t_imageconverter565.php


Example of a weather function call:

https://api.openweathermap.org/data/2.5/weather?lat=xx.xx&lon= yy.yy&appid= 919uif897b48jg375b7e95aa7f38c6e457&units=metric

Information in bold must be provided.


Example of the string received from openweathermap:

{"coord":{"lon":xx.xx,"lat":yy.yy},"weather":[{"id":804,"main":"Clouds"," description ":"overcast

clouds"," icon ":"04n"}],"base":"stations","main":

{"temp":2.03," feels_like ":-4.58,"temp_min":1.43,"temp_max":2.96,"pressure":1018," humidity ":64,

"sea_level":1018,"grnd_level":1002},"visibility":10000," wind ":{" speed ":10.8," deg ":40," gust ":16.46},

"clouds":{"all":100},"dt":1766599863,"sys":{"type":1,"id":6595,"country":"xx","sunrise":1766560793,

"sunset":1766590630},"timezone":3600,"id":2973783,"name":"xy","cod":200}