The DHT22 sensor runs at 3.3 V unlike the LCD display which is 5 V. The ground, read/write and backlight cathode are connected to the PI’s ground. The LCD Vcc is connected to 5 V on the Pi. I’m using GPIO 26 for RS, 19 for enable and 13, 6, 5 and 11 for data 4 through 7 respectively. The LCD display requires 6 GPIO pins on the Pi. Assuming all dependencies are installed, these demos should work.On a small breadboard I have a 16×2 LCD display, a DHT22 temperature/humidity sensor and dual potentiometers to control contrast and brightness.
#RASPBERRY PI CLOCK AND WEATHER DISPLAY MANUAL#
Waveshare have a user manual which you can get to from their Wiki
#RASPBERRY PI CLOCK AND WEATHER DISPLAY CODE#
Learn more: Waveshare documentation and sample code If you want to force a re-login to Google or Outlook, delete the token.pickle or outlooktoken.bin. If you want to force a calendar update, you can delete the calendar.pickle or outlookcalendar.pickle. If you want to force a weather update, you can delete the weather-cache.json. The scripts cache the calendar and weather information, to avoid hitting weather API rate limits. If there isn’t enough information in there, you can set export LOG_LEVEL=DEBUG in the env.sh and the run.log will contain even more information. If you’ve set up the cron job as shown above, a run.log file will appear which contains some info and errors. You may want to further troubleshoot if you’re seeing or not seeing something expected. If the scripts don’t work at all, try going through the Waveshare sample code linked below - if you can get those working, this script should work for you too. Curse of the early adopter! Troubleshooting The reason for sticking with the Python way is that I’ve got a v1 Waveshare display, while most users have a v2 Waveshare display, and it’s easier to cater to both this way. It could further be sped up by converting the PNG to a 1-bit BMP so that there’s less data to send over the wire.
![raspberry pi clock and weather display raspberry pi clock and weather display](https://imgix.lifehacker.com.au/content/uploads/sites/4/2016/07/10/bxdccrjib26ya9055owo.jpg)
It’s possible to use the C libraries to make this process faster, but it requires writing and compiling the display binary yourself. It’s slow, it takes about 30 seconds to write to screen. The image is converted from the intermediate SVG to PNG, and then the display.py renders it to screen using the e-Paper libraries. Similarly weather info will be up to a few hours delayed. This means that any new entries in your target calendar won’t show up immediately. pickle files which store the Google/Outlook Calendar and Dark Sky API responses for a few hours. The last API call is to Google Calendar, the upcoming 2 calendar entries are written to the same SVG.ĭue to API rate limits, you will see various. The SVG is then written out to screen-output-weather.svg.
![raspberry pi clock and weather display raspberry pi clock and weather display](https://i.pinimg.com/originals/60/08/a7/6008a77403622dedfece0d70c7829e0b.jpg)
The first part of run.sh calls on the script which queries Climacell API, gets the weather info and substitutes icons and temperatures in the SVG. Being text files makes them easy to work with from dynamic scripts. SVGs are simply XML files which are understood by renderers. Picture frame detailsĮverything starts with the screen-template.svg which holds the labels and layout for the final image to be produced. The only bit of wire in the whole setup is the USB to power the Raspberry Pi. The Raspberry Pi Zero WH is light enough that it could be taped right to the stand. The ribbon from the connector loops upwards and over to the picture frame’s stand. This allowed me to put the e-paper display inside the picture frame while its connector hung outside. Using a box cutter (Stanley knife) I was able to remove a square portion from the bottom. The picture frame I got had a cheap backing. * * * * * cd /home/pi/waveshare-epaper-display & bash run.sh > run.log 2>&1
![raspberry pi clock and weather display raspberry pi clock and weather display](https://cdn-blog.adafruit.com/uploads/2012/12/breadboard.jpg)
The back needs to be made of cheap material so that it can be cut out for the e-paper display’s connection mechanism. This is the best size just larger than the e-paper display. You’ll need a 6”x4” picture frame to hold everything together. Raspberry Pi Zero WH microSDHC card Picture frame Of course you’ll also need a microSD card. Since it’s a HAT (Hardware Attached on Top), you can save some time by buying it with the GPIO presoldered. While the black and white display isn’t very fast, the colored ones are much, much slower and are only suitable for frequently-refreshing dashboards.Īlthough any Raspberry Pi can be used, the best one to get here is the Raspberry Pi Zero W - it’s thinner and more portable. As tempting as they may be, the problem with those displays is the refresh rate, in part due to the way the third color is ‘pushed’ to the surface when displaying a color. A quick search will also show similar displays available, with a single additional color. The most important component is the Waveshare display, which is a 7.5 inch e-paper HAT with SKU: 13504 and UPC: 614961951068.