Projects / E-paper weather photo frame

E-paper weather photo frame

Intermediate3 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. Pi ZeroRASPBERR2.13

    Flash the Pi

    Raspberry Pi OS Lite with Wi-Fi and SSH set.

  2. Pi Zero

    Enable SPI

    Use raspi-config and reboot.

  3. Pi ZeroRASPBERR2.13

    Fit the HAT

    Plug it on the header with power off.

  4. Pi Zero

    Run the Waveshare demo

    Check the panel draws.

  5. Pi Zero2.13

    Fetch the forecast

    Print it in the terminal.

  6. Pi Zero

    Draw the layout

    Temperature, high and low, rain.

  7. Pi Zero

    Add the timer

    Refresh every 30 minutes.

In short

How do you build an e-paper weather photo frame?

A Pi Zero with a large e-paper display shows the forecast, a quote and a photo, refreshed every 30 minutes. You need Raspberry Pi Zero 2 W, SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi 15 W USB-C power supply and 2.13 inch e-paper HAT for Raspberry Pi. It takes 7 steps and about 180 minutes.

Level
Intermediate
Time
About 180 min
Parts
4

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
E-paper HATPi 40-pin header (plugs on top)Power, SPI and control pins in one connector
Pi micro-USB (PWR)5 V 2.5 A supplyPower
FrameHolds the Pi behind the panelMounting

Code

The Pi draws a picture with Pillow and sends it to the e-paper panel, which holds the image with no power. The forecast comes from Open-Meteo, which needs no key. Waveshare provides the display driver in its own repository; copy the folder for your panel and use the matching module name, since each size has its own. A systemd timer wakes the script every 30 minutes, so the frame is up to date without a program staying open. Refreshing more often than every few minutes shortens e-paper life, and a full refresh flashes black and white, which is normal. Do not store your Wi-Fi password in scripts you share; set it in Raspberry Pi Imager. The Pi Zero 2 W needs a good 5 V 2.5 A micro-USB supply. For a photo, convert it to one-bit with dithering. Use a wider panel (7.5 inch) for a real wall frame; the drawing code then needs new coordinates.

# E-paper weather frame. Run on the Pi (Raspberry Pi OS Lite). Setup:
#   sudo raspi-config  -> Interface Options -> SPI -> Enable, then reboot
#   sudo apt install -y python3-pil python3-requests python3-gpiozero python3-spidev git
#   git clone https://github.com/waveshareteam/e-Paper   (Waveshare's own driver library)
#   Copy RaspberryPi_JetsonNano/python/lib/waveshare_epd next to this script.
# This script assumes the 2.13 inch V4 panel (epd2in13_V4). Use the module name that matches your panel.
import requests, time
from datetime import datetime
from PIL import Image, ImageDraw, ImageFont
from waveshare_epd import epd2in13_V4

LAT, LON = 12.97, 77.59            # your latitude and longitude

def forecast():
    url = ("https://api.open-meteo.com/v1/forecast?latitude=%s&longitude=%s"
           "&current=temperature_2m,weather_code&daily=temperature_2m_max,temperature_2m_min,precipitation_probability_max"
           "&timezone=auto&forecast_days=1" % (LAT, LON))
    d = requests.get(url, timeout=20).json()
    return d["current"]["temperature_2m"], d["daily"]["temperature_2m_max"][0], d["daily"]["temperature_2m_min"][0], d["daily"]["precipitation_probability_max"][0]

epd = epd2in13_V4.EPD()
epd.init()
w, h = epd.height, epd.width       # the panel is used in landscape
img = Image.new("1", (w, h), 255)
draw = ImageDraw.Draw(img)
big = ImageFont.load_default(size=36) if hasattr(ImageFont, "load_default") else ImageFont.load_default()
small = ImageFont.load_default(size=14) if hasattr(ImageFont, "load_default") else ImageFont.load_default()
try:
    now_t, hi, lo, rain = forecast()
    draw.text((8, 4), "%.0f C" % now_t, font=big, fill=0)
    draw.text((8, 56), "High %.0f  Low %.0f" % (hi, lo), font=small, fill=0)
    draw.text((8, 76), "Rain chance %s percent" % rain, font=small, fill=0)
except Exception:
    draw.text((8, 40), "No forecast", font=small, fill=0)
draw.text((8, 100), datetime.now().strftime("%a %d %b %H:%M"), font=small, fill=0)
epd.display(epd.getbuffer(img))
epd.sleep()                          # put the panel to sleep, the picture stays

# Run it every 30 minutes with a systemd timer. Create these two files in /etc/systemd/system/:
# weather-frame.service:
#   [Service]
#   Type=oneshot
#   WorkingDirectory=/home/pi/frame
#   ExecStart=/usr/bin/python3 /home/pi/frame/frame.py
# weather-frame.timer:
#   [Timer]
#   OnBootSec=1min
#   OnUnitActiveSec=30min
#   [Install]
#   WantedBy=timers.target
# Then: sudo systemctl enable --now weather-frame.timer
# To show a photo instead, open it with Image.open(path).convert("1") (this dithers it to black and white).

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Run the scriptPanel refreshes within 15 seconds
Pull the powerPicture stays visible
Wait 30 minutesScreen updates by itself
Network offShows No forecast, no crash

If it does not work

Blank panel

Check SPI is enabled and the module matches your panel.

Import error

Copy the waveshare_epd folder next to the script.

Ghosting

Do a full refresh occasionally.

Timer never runs

Check systemctl status for the timer.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the e-paper weather photo frame?

Raspberry Pi Zero 2 W, SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi 15 W USB-C power supply and 2.13 inch e-paper HAT for Raspberry Pi. Raspberry Pi 15 W USB-C power supply: Use micro-USB for the Zero. 2.13 inch e-paper HAT for Raspberry Pi: Use a 7.5-inch panel for a frame.

How long does the e-paper weather photo frame take to build?

About 180 minutes for a intermediate maker, in 7 steps.

How do I know the e-paper weather photo frame works?

Run the script: Panel refreshes within 15 seconds. Pull the power: Picture stays visible. Wait 30 minutes: Screen updates by itself.

Blank panel: what should I check?

Check SPI is enabled and the module matches your panel.

Import error: what should I check?

Copy the waveshare_epd folder next to the script.

Ghosting: what should I check?

Do a full refresh occasionally.

Timer never runs: what should I check?

Check systemctl status for the timer.