Introduction: Steampunk Weather Monitor
I wanted to build a weather monitor on my own for a long time. When I saw the epaper displays from Waveshare I thought this would definitely be the way to go. This instructables describes how to build a weather monitor with an epaper screen and a Raspberry Pi Zero W underneath the hood. The weather data is gathered from Openweather.org.
Step 1: The Hardware
For this project I used the following components:
- 1 Raspberry Pi Zero W for 17.76€ on Exptech.de
- 1 SanDisk Micro-SD card 16GB for 7.99€
- 1 Waveshare 7.5inch e-paper display for 47.11€ on Exptech.de
- 1 Waveshare Universal epaper panel driver hat for 6,75€ on Exptech.de
- 1 picture frame for 10cmx15cm pictures with 2cm depth to place the electronics inside
- 1 USB cable + USB power supply
- some nice steampunk accessories like gears and tin corners from your local craft store
The overall cost should be around 85€.
Putting the hardware together is pretty straight forward. The panel driver hat comes with female headers so you need to place male headers on the Raspberrys GPIOs before you can place the panel driver hat on it. Connect the panel driver hat to the e-paper display with the flat cable. Further instructions on installing the driver hat can be found on the Waveshare Wiki.
Use the glue gun to place your steampunk elements on your frame. After that take the cardboard and the cover out. You will need to adjust the size of the cover to fit the display. Use a pencil and a set square to draw the new borders. Cut out the new frame with a scalpel or a cutter. Use some sticky tape to place the display centric to the cover. Now put cover and display back inside the frame. Put the cardboard back in place and thread the flat connection cable between the cardboard and the wooden frame to the backside of the frame. At last add a deepening for the cable by using a grasper. Connect the USB cable with the Raspberry and fixate it in the deeping with hot glue.
Step 2: The Software
A very painless way to uploadr your image to the SD card is to use Etcher.
Enable SSH and Wifi
In order to access your Raspberry from your computer you need to enable SSH and WIFI. For this you first need to take out your SD card of your computer and put it back in so it gets remounted. Now you should see a new USB device with a /boot directory. Create a new empty file called ssh in the /boot directory. This enables SSH support for the Raspberry. To enable and configure WiFi you also need to create a file called wpa_supplicant.conf. Add the following lines to this file:
country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
Adjust the WIFI_SSID and the WIFI_PASSWORD to your needs.
Now place the sd card in your Raspberry and power up. For further instructions on headless Raspberry setup have a look at Taron Foxworth' blog post about Getting Started with the Raspberry Pi Zero W without a monitor.
Install the necessary software
Now SSH into your Raspberry Pi. On Linux or Mac just bring up the terminal and type the following command. If your on Windows you will need to use Bash or Putty for this.
$ ssh email@example.com
You will be asked for a password. The default password for the Raspberry is raspberry.
Now we need to install some software. We will need Python3 and the Python package manager pip. Also some additional fonts.
$ sudo apt-get update<br>$ sudo apt-get upgrade $ sudo apt-get install -y python3 python3-pip python3-smbus python3-serial python3-dev $ sudo apt-get install -y fonts-freefont-ttf wiringpi git<br>$ sudo pip3 install pillow requests
The next installation steps for the Waveshare display components are a bit tricky. Please follow the official instructions in the Waveshare wiki.
Run the weather script
Clone the weather script from Github.
$ git clone https://github.com/stlehmann/rpi_epaper_weatherstation.git weather $ cd weather
Now we are nearly there. We just need to set some environment variables that tell the script which location we want to get the weather information and which API key to use. The API key is needed to access the weather information on OpenWeathermap. You can obtain one by registering to Openweathermap.org.
$ export OWM_LOCATION="Berlin,de"
$ export OWM_API_KEY="yourapikey"
$ python weather.py
This should start the script and after a while you should see the weather information for your location on the display.