top of page
Search

Developing an E-Paper display (work in progress)

Table of contents:

Connecting to Raspberry Pi

Displaying Images

Demo Images: Original vs e-Paper


Introduction

The project idea was to learn how to use an e-paper (EPD) display so eventually could apply them on a variety of low power applications using displays obtained from E-ink.

On the beginning the display used was from Waveshare and Pimoroni due to easy accessibility and existing libraries and slowly it evolved into using E-ink displays.

On this blog it is a description of the workflow on the first display which was obtained from Waveshare and tested with library from Waveshare and Pimoroni.


Details

The first display that I worked on is an AB1024-EGA, a reflective electrophoretic E Ink technology display module based on active matrix TFT. It has 5.65” active area with 600 x 448 pixels. The panel is capable of displaying 7-colors of black, white, red, yellow, blue, green, and orange images depending on the associated lookup table used. Which I obtained from Waveshare.

I found that the controller for the display is compatible with the IC driver UC8159 present on Pimoroni's displays.

The controller uses LUTs (Look Up Tables) to generate the appropriate waveforms to drive the display. The supplied LUTs are preprogrammed inside a FLASH memory that is soldered directly to the flat-flex cable, different displays have different controllers given different colors or different sizes of TFT arrays.

The process of updating the display works as follows:

  1. Pixel values are loaded into the internal frame buffer,

  2. A command is sent and the update sequence starts.

  3. The controller reads the ambient temperature from the internal temperature sensor.

  4. The controller loads the appropriate LUTs from FLASH.

There is a set of LUTs for each temperature range.


Pixel Construction

Every single pixel on the E-ink displays have all color pigments inside of it, which is very different from a LED screen which uses a combination of RGB and back light or opaque in order to create color.

The pixels are small capsules filled with some sort of a liquid substance. Each capsule contains fore different pigments (yellow, cyan, magenta, and white), the colored pigments are transparent while the white pigment is not. Below is a basic representation of what is happening inside each pixel to display each color.


Display Construction

The display uses a TFT matrix like an LCD screen. The grid of pixels is sandwiched between two electrode layers. The top electrode layer is transparent and common for all pixels, spreading over the entire surface. The bottom electrode layer is chopped up into little squares, one for each pixel. Each one of these tiny electrodes is connected to the drain of a transistor. The gates of all transistors in a row are connected together, same for the source connections in a column.

The matrix is scanned line by line sequentially, a positive voltage is applied to one of the gate lines while the others are held at a negative voltage. This turns on the corresponding line of transistors. At the same time, the source lines determine what voltage is applied to the pixels in the active line. By sequentially activating one line at a time and at the same time driving the appropriate voltage on the source lines, every pixel can be individually addressed.


E-Paper Frame Rate

These displays has a very different approach for frame rates. While LCD screens the image updates every time the TFT matrix is scanned, with e-Papers it takes multiple frames to change the state of the pixels, a characteristic of a reflective electrophoretic E-Ink technology. The frame rate of these displays refers to the frequency at which the TFT matrix is scanned, with each scan it's possible to change the voltage applied to each pixel, but it takes multiple scans to update the image.


Look-Up Tables (LUTs)

Look-up tables are what determines the sequence of voltages that are applied across every single pixel. For each voltage to be generated there is a corresponding LUT. The LUTs are determined by the manufacturer and are not usually available to the screen customers.

The display controller for the 7-color display obtained from Waveshare has 10 different LUTs

  • VCOM: controls the voltage of the common electrode

  • LUT0 - LUT7: control the voltage applied to the individual pixel electrodes (the controller supports 8 different colors)

  • XON: can bypass the gate scan logic and enable all the gate lines.

Each LUT is like a pre-programmed little program, a state machine inside the controller reads the entries and determines the proper voltage on a per-frame basis with the appropriate temperature.


Connecting to Raspberry Pi

In order to use Pimoroni inky library the connection use slightly different pins compared to Waveshare library as can be noted on they code.

Raspberry Pi pinout:

Waveshare pinout:

Pimoroni pinout:


Displaying Images

In order Display images they have to be resized to match the right number of pixels (resolution), and they must be dithered to match the palette of colors.

Installing Waveshare library:

Open terminal of Raspberry Pi and run the following commands to install corresponding libraries:

  • Install BCM2835 libraries

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz 
cd bcm2835-1.60/
sudo ./configure
sudo make
sudo make check
sudo make install
  • Install WiringPi libraries

sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
  • Install Python3 libraries

sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo pip3 install RPi.GPIO
sudo pip3 install spidev

Open the terminal of Raspberry Pi and clone demo codes by the following commands:

sudo git clone https://github.com/waveshare/e-Paper

Examples:

C

  • Enter the folder of C examples

cd ~/e-Paper/RaspberryPi\&JetsonNano/
cd c
  • Modify the main.c file for corresponding e-Paper

sudo nano examples/main.c

For example, if you want to update a 2.7inch e-Paper/2.7inch e-Paper HAT, you should modify the main.c file, uncomment the line EPD_2in7_test(), comment others, and save.


  • Compile codes

sudo make clean
sudo make
  • Try to run the example

sudo ./epd

Python

  • Enter the folder of python code

cd ~/e-Paper/RaspberryPi\&JetsonNano/
cd python/examples
  • Check the folder, you can see that there are .py files for different e-Paper.

ls -al
  • Run the responding example

sudo python3 epd_5in65f_test.py

Installing Pimoroni's library:

run command:

curl https://get.pimoroni.com/inky | bash

Observation: Pimoroni requires Python 3 and it has an error:

It gives a run_time error due to a wrong block of code. The busy pin under test seems to be 0 (LOW) at all times (in other words, it doesn't do anything after the board runs. So the solution is to remove the busy-wait code in the driver inky_uc8159.py around line 307 and replace it with 1 second sleep.


python3 image.py garage1.jpg

Traceback (most recent call last):

File "image.py", line 23, in <module>

inky.show()

File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 365, in show

self._update(buf.astype('uint8').tolist(), busy_wait=busy_wait)

File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 320, in _update

self.setup()

File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 226, in setup

self._busy_wait()

File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 309, in _busy_wait

raise RuntimeError("Timeout waiting for busy signal to clear.")

RuntimeError: Timeout waiting for busy signal to clear.

To fix it is necessary to eliminate a block of code from the Pimoroni's library:


Demo Images: Original vs e-Paper

It is noticeable that the images displayed are dithered to fit the displays limitations on colors and resolution for this specific display. The process to form an image is quite long and the display used on the test had no support for Partial updates.

It is also noted the importance for cleaning the image

Original:

E-paper:

Original:

E-paper:

Original:

E-paper:


Sources:

Waveshare


Pimoroni Inky

Inky Impression (7 color e-Paper/e-Ink/EPD)


Tutorials


Github


eink-xplained-pro-asf4


 
 
 

Comments


© 2023 by Dean Raven. Proudly created with Wix.com

bottom of page