Project 4: Using an e-Paper Display for Weather Data

After going over some specialized distributions of Linux for the Tinker Board, it's time to return to where this book began: TinkerOS. This time around, we're going to be applying the Linux, GPIO, and programming skills that we gained in the first part of

  • PDF / 1,643,476 Bytes
  • 35 Pages / 439.37 x 666.142 pts Page_size
  • 93 Downloads / 191 Views

DOWNLOAD

REPORT


Project 4: Using an e-Paper Display for Weather Data After going over some specialized distributions of Linux for the Tinker Board, it’s time to return to where this book began: TinkerOS. This time around, we’re going to be applying the Linux, GPIO, and programming skills that we gained in the first part of the book. The first project that we’ll tackle is an Internet-connected display with an e-Paper module that will show the current date, time, and weather.

What Is e-Paper? Often referred to as e-Ink or EPD, e-Paper (electronic paper) is a digital display that mimics the look of ink on paper. It’s the same type of display found in e-readers and other similar devices. It has a slow refresh rate, so it’s best for static displays, such as images or slowly changing text. Because of this, it has incredibly low power consumption. e-Paper is also known for being easily visible in all lighting conditions, including direct sunlight, and it’s easier on your eyes because it doesn’t emit the blue light found in LCD displays.

© Liz Clark 2019 L. Clark, Practical Tinker Board, https://doi.org/10.1007/978-1-4842-3826-4_10

251

Chapter 10

Project 4: Using an e-Paper Display for Weather Data

e-Paper comes in a variety of shapes and sizes. Traditionally, the displays are dual-color; usually black and white, but newer versions can showcase other colors, and tricolor displays are also beginning to come to market. They’re becoming increasingly popular for DIY applications, since they’re available for multiple platforms. Many displays can be coded in multiple coding languages with manufacturer-provided libraries that you can install, along with example code to test included. They usually connect through individual broken-out pins to attach to GPIO pins on different boards, but there are also specialized add-on boards that fit directly onto certain boards’ GPIO layouts, including the Tinker Board. The display that we’re going to use for this project is from Waveshare, a manufacturer of DIY electronics accessories. They have quite a few varieties of e-Paper displays available, and the one we’ll be looking at is the 2.13-inch HAT variety. It was originally designed to work with Raspberry Pi, but ASUS has ported the Python libraries to work with the Tinker Board so that no code adjustment is needed. We’ll examine what they did, though, so that you can try porting hardware libraries for future projects.

SPI You may be wondering how the e-Paper displays work. Some, including the one we’ll be using, use Serial Peripheral Interface (SPI) communication. SPI is a bus protocol used to communicate between devices. It has a built-­ in clock signal that is sent in conjunction with any data for highly accurate and timely communication. SPI is integrated into Python using the spidev library, which we’ll discuss shortly as we prepare for the Waveshare library installation.

252

Chapter 10

Project 4: Using an e-Paper Display for Weather Data

Early Issues with SPI on the Tinker Board Previously, there were some issues with SPI on the Tinker