Create a retro-style weather station with modern features using ESP32
Create a retro-style weather station with modern features using ESP32

Create a retro-style weather station with modern features using ESP32


Many of us probably remember the monochrome weather displays of the 80s and 90s, letting us view the indoor and outdoor temperatures at a glance, often even the current relative humidity. What if you could build something just as nostalgic but with even more real-time weather details? This project only requires a few components to do precisely that, and you can likely create it in just a single afternoon.

5 simple projects anyone can build with an ESP32 microcontroller

Who says you need a high skill-level to create cool ESP32 projects?

The e-paper weather display in a nutshell

It only looks like your grandfather’s weather station

The open-source project behind this project is courtesy of Luke Marzen, a graduate software engineer at Arm. It’s powered by a Wi-Fi-capable ESP32 microcontroller connected to an e-paper display. Once built and powered on, it pulls the current weather conditions and five-day forecast for your selected location using the OpenWeather API. Inside the build, there’s also an onboard BME280 sensor that reports indoor temperature and humidity. The project also includes an internal sensor to display indoor temperature and humidity. The software behind it supports multiple languages, customizable units, various time and date formats, AQI scales, and more.

You’ll need to gather some electronics components to build your own, as well as decide on a case or stand for it. In the project’s GitHub repository, Marzen provides the dimensions of the wooden enclosure he built, as well as several 3D-printed designs created by other makers for their own weather displays.

Marzen notes that the flimsiness of most e-paper panels may require you to support the e-ink display with a thin acrylic sheet. The remaining hardware you’ll need to complete the project is listed below.

  • 7.5-inch (800×480) e-paper display (Marzen includes a list of known compatible panels in the repository)
  • DESPI-CO2 adapter board
  • FireBeetle 2 ESP32-E microcontroller
  • BME280 pressure, temperature, and humidity sensor
  • 3.7V LiPo battery with 2-pin JST connector

The e-paper display is an ideal choice because it doesn’t require frequent display refreshes. It consumes so little power that yours will probably run for six months or more between charges. When it is time to recharge the battery, just plug it into a USB-C charger for a couple of hours.

Building and programming the weather station

Wiring considerations for your e-paper weather display

If you’re using an e-paper HAT in your project, this diagram shows how to wire it. Many options will work here, but Marzen recommends the Waveshare 7.5-inch e-paper for this project. The code includes limited support for accent colors, but using an e-paper display with color support will usually result in longer refresh times and reduced battery life.

wiring_diagram_waveshare_rev22 Credit: Source: Luke Marzen

If you use a Waveshare e-paper Driver HAT, you must correctly configure two physical switches, or the display will not work. Be sure to set the Display Config switch to position B and the Interface Config switch to position 0. Furthermore, version 2.3 of Waveshare’s 800×640 e-paper panel adds a PWR pin that you’ll need to connect to 3.3V power.

To avoid potential issues with the e-paper HAT, Marzen recommends connecting the display using a DESPI-CO2 adapter board. Another benefit of the adapter board is that it eliminates the need for level converters, which improves its compatibility with 3.3V low-power setups. The wiring diagram below shows how to connect that configuration.

wiring_diagram_despi-c02 Credit: Source: Luke Marzen

Next, if you use the same ESP32 microcontroller Marzen used, be sure to cut the thin wire in the middle of the low-power pad (marked with a label and arrow in both wiring schematics). This will reduce the board’s static power consumption by 500 microamps, allowing the best possible battery life.

Getting your OpenWeather API key

  1. In your browser, navigate to OpenWeather’s registration page and subscribe to the service.
  2. Next, go to your subscription detail page and set Calls per day (no more than) to 1,000.

This way, you’ll never exceed the free API calls and shouldn’t see any credit card charges.

Configuring, compiling, and uploading the code for the weather station

With the wiring done (even if only temporarily using a breadboard), it’s time to configure the software. Marzen uses PlatformIO for Visual Studio Code, which runs on Windows, macOS, and Linux. You’ll need to install the PlatformIO extension for VSCode if you’ve never used it.

  1. Open Visual Studio Code on your computer.
  2. In the Extension Manager, search for platformio and click the blue Install button.

  3. Clone Marzen’s repository or download and extract the .zip file, then open it in VSCode using File > Open Folder. Navigate to where you saved the repository and choose the “platformio” folder.

Depending on your circumstances and preferences, you may need to edit config.cpp and config.h to personalize the code before compiling it. These include the details for connecting the weather display to your Wi-Fi, your OpenWeather API key, and various localization settings.

The configuration files also provide options to set the display to use different hardware components than the default. This comes in handy if you choose a different ESP32 model, e-paper display panel, or other components. You can change the pin assignments if you wire your particular ESP32 differently from the schematics above.

You’ll find comprehensive details on these configuration settings on the GitHub repository page.

After configuring the source code, you can build and upload your code as usual. Connect the ESP32 to your computer via USB, then click the upload arrow at the bottom of the VSCode window to compile and upload the code to your ESP32.

Finalize your assembly and troubleshoot any problems

Once you’ve ensured the code works as expected on your weather display, it’s time for any necessary finishing touches. For example, if you’ve yet to solder your wiring connections, it may be time to ditch the breadboard and make the build more permanent.

If all is well, your display will boot up and show the weather details as you configured them. However, if problems occur, the ESP32 weather display will display a handful of error screens. These include a low battery screen when the voltage falls to 3.2V or lower, an error screen if the Wi-Fi connection fails, and error screens for OpenWeather API or timeserver errors. If one of these error screens appears, Marzen provides troubleshooting steps on the GitHub repository page.

A great introductory project for beginning your ESP32 journey

Even absolute novices to ESP32 projects can easily complete this one in an afternoon. Marzen provides several suggestions for building this weather display without soldering, but you could also just mount your breadboard prototype inside many of the enclosure or stand designs listed on the project website. No matter what, you’ll have a great-looking weather display reminiscent of your grandfather’s weather station. The key difference is this one will keep you updated on current conditions and short-term forecasts along with the temperature and humidity within your home or office.



Source link