---
slug: "e-ink-weather-display"
title: "E-Paper Weather Forecast Gadget"
description: "I always thought it would be great to see the rainfall forecast when doing laundry, so I decided to create a rainfall monitoring gadget."
url: "https://www.ytyng.com/en/bio/e-ink-weather-display"
achieved_at: "2023-02-04"
updated: "2024-04-29T12:19:50.238Z"
category: "電子工作"
image_url: "https://media.ytyng.com/20240429/59c4d3d746e84b92a78dfcbde9ce094b.jpg"
lang: "en"
---

# E-Paper Weather Forecast Gadget

# Motivation

I bought a [Raspberry Pi Pico E-Paper Module](https://www.amazon.co.jp/gp/product/B092STLKM2/) because it looked interesting.

I thought it would be great to see the rainfall forecast when doing laundry, so I decided to use it as a rainfall monitor.

# Server-Side Design

For the weather forecast API, I used [Open Metro](https://open-meteo.com/), which is available for free.

I set up a separate server, and the gadget sends requests to the server at regular intervals.

The server receives these requests, sends a request to Open Metro, generates a black-and-white PNG image based on the results, and responds to the gadget.

The gadget simply displays this black-and-white PNG image.

By offloading complex processing to the server side, development becomes easier and the system's stability is enhanced.

# Gadget Design

## Initial USB-Powered Type
Initially, I created a rainfall monitor powered by USB.

![Image](https://media.ytyng.com/20240429/f82c704696664d2396d632b57da73bea.jpg)

![Image](https://media.ytyng.com/20240429/7c604b9a79ee4ec396d890f97c96ae23.jpg)

![Image](https://media.ytyng.com/20240429/03d88afe2a3f4ed383d95e8e5ef0ed25.jpg)

The microcontroller is always on and sends requests to the server every 5 minutes.

However, since this requires a cable, it doesn't fully utilize the benefits of e-paper.

## Switching to Battery Power

I switched to battery power.

I bought a [1,000mAh Li-Po battery](https://ja.aliexpress.com/item/1005005796841686.html) and a [charging board module](https://ja.aliexpress.com/item/1005005626384507.html) from [AliExpress](https://ja.aliexpress.com) and set up a charging system.

Connect the Li-Po battery to the B+ and B- of the charging board module, and the VSYS and GND of the microcontroller to the OUT+ and OUT-; this enables battery-powered operation.

<div class="stl-viewer my-3" src="https://media.ytyng.com/20240429/03b82fabf078460595679bbb963308e0.stl"></div>

![Image](https://media.ytyng.com/20240429/107f72acc42441aabff36c3ecc4755f2.jpg)

↑ It became slightly larger due to the battery. At this time, the graph is maxed out due to heavy rain.

## Reducing Power Consumption with Deep Sleep

Leaving the microcontroller always on would quickly drain the battery, so I put it in Deep Sleep mode during standby to save power.

The code looks something like this:

```python
# Disconnect Wi-Fi
wlan.disconnect()
wlan.active(False)
# Deactivate Wi-Fi
machine.Pin(23, machine.Pin.OUT).low()
machine.deepsleep(settings.DEEP_SLEEP_SECONDS * 1000)
```

[Deep Sleep Code](https://github.com/ytyng/rpi-pico-w-monitor-pull/blob/main/main.py#L37)

### Explanation

[Lowering the Power Consumption of the Raspberry Pi Pico W with Deep Sleep - MSR LLC](https://msr-r.net/raspi-picow-deepsleep/)

### Results
After setting the gadget to request the server and update the e-paper display, then enter Deep Sleep for 30 minutes, the battery lasted more than 10 days. It doesn't last for 2 weeks.

It’s at a practical level.

The combination of e-paper + battery power + Deep Sleep seems versatile, and I plan to apply it to other projects in the future.

# Source Code

[ytyng/rpi-pico-w-monitor-pull](https://github.com/ytyng/rpi-pico-w-monitor-pull/tree/main)

The README contains photos of an OLED display, but it also works with e-paper.

# Insights
By actually making a device that uses a battery myself, I realized how efficiently designed commercially available small battery-powered products (like wireless earphones) are. Professional work is impressive.
