Top 5 This Week

Related Posts

Build your own elegant e-paper weather display powered by an ESP32 microcontroller

As a kid, I remember that my grandparents always had a weather display hanging on the wall. It was pretty basic, but it told us the inside and outside temperature and humidity. Fast-forward an undisclosed number of years, and we can actually build our own elegant weather display that provides much, much more information about the weather. Let’s walk through how to do it.



Related

5 simple projects anyone can build with an ESP32 microcontroller

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

Planning your weather display build

Luke Marzen, a graduate computer science student, developed this open-source project. The weather display is powered by a Wi-Fi-enabled ESP32 microcontroller with a 7.5-inch e-paper display. You can view current weather conditions and a five-day forecast retrieved from the OpenWeather API. The project includes an internal sensor to display indoor temperature and humidity.

Before you get started, you should decide on a case or stand for your weather display. You could either build your own wooden box or print one, if you have access to a 3D printer. Marzen has provided links to several great options on the project’s GitHub repository, and they’re all free to download and print.


In addition to the case or stand, you may want to support the e-ink display with a thin acrylic sheet. The rest of the hardware you’ll need to complete the project is listed below.

  • 7.5-inch (800×480) e-paper display
  • 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 Marzen can use it for more than six months on a single charge of the 5,000mAh battery he installed in his weather station.

In addition to the supplies listed above, you will also need access to a computer in order to configure, compile, and install the software on the ESP32-E microcontroller.

A transparent render of the ESP32-WROOM microcontroller

ESP32

The ESP32 is a fantastic development board that combines solid specs with an affordable price. Despite being cheaper than Arduino and Raspberry Pi Pico, it outperforms most of its rivals. Plus, the ESP32 even has Wi-Fi and Bluetooth functionality built into every board.

Building and programming the weather station

Once you have the necessary components, it’s time to wire, assemble, and program your weather station. Always test your wiring using a breadboard first to avoid the hassle of desoldering your connections if something doesn’t work as expected.


Wiring considerations for your e-paper weather display

If you’re using an e-paper HAT in your project, this diagram shows how your wiring should be done. It’s important to note that Waveshare’s most recent e-paper HAT revision has been problematic for some makers.

wiring_diagram_waveshare_rev22
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
.

To avoid potential issues with the e-paper HAT, Marzen recommends connecting the display using a DESPI-CO2 adapter board. Another benefit to the adapter board is it eliminates the use of level converters, which makes it work better with 3.3V low-power setups. The wiring diagram below shows how to connect everything that way.


wiring_diagram_despi-c02
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

For the weather station to get current and forecasted conditions, you’ll need an OpenWeather API key. While OpenWeather would love to charge you for API calls, that’s unnecessary. Follow these instructions to subscribe and ensure you never exceed the 1,000 API calls you get for free.

  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 use more than 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 utilize a handful of error screens if issues arise. 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 time server errors. If one of these error screens appears, Marzen provides troubleshooting steps on the GitHub repository page.

This is a great project, even for beginners. Given the space available inside the stand designs, you could leave everything wired through a breadboard if you lack soldering skills. However, it will still give you a great-looking weather display that keeps you updated on current conditions, short-term forecasts, and the temperature and humidity within your home or office.


#Build #elegant #epaper #weather #display #powered #ESP32 #microcontroller

source: https://www.xda-developers.com/build-elegant-e-paper-weather-display-esp32-microcontroller/

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Popular Articles