2.7inch E-Paper Display Expansion Module HAT

Product Overview

This product is a 2.7-inch e-ink screen expansion module, based on the Raspberry Pi 40PIN interface design and suitable for Raspberry Pi series motherboards. We provide C and Python version demo codes for Raspberry Pi, and reserve the SPI control interface for easy access to Arduino, STM32 and other main control boards. We also provide Arduino, STM32, ESP32 version demo codes, which can realize picture display, English and digital character display, and point, line, rectangle, circle drawing.

Product parameters

Size78.5mm(Length) x 56.5mm(width)
Weight33g
Pixels264 x 176
Display ColorMonochrome (Black and white)
Voltage TranslatorTXS0108EPWR
Signal interfaceSPI
Supply voltage3.3V/5V
LCD display area38.19mm (W) x 57.29mm (H)
Partial Refresh0.42S (4-wire SPI status)
Global Refresh3S (4-wire SPI status)

Usage

Precautions for using the E-Paper:

  • Avoid direct sunlight. Electronic paper will display particles under strong light, that is, the charged particles in the microcapsules will dry out under strong light, and then lose their activity and cannot be refreshed. This condition is irreversible. At the same time, moisture-proof and waterproof measures must be taken, and the operation should be strictly in accordance with the temperature and humidity range required by the specification. If the electronic paper is not used for a long time, it needs to be placed upside down, and the screen should be placed with a full white screen.
  • After the electronic paper is refreshed, you need to set the sleep mode, or turn off the power after setting the sleep mode. The refresh interval of the SPI serial port electronic paper is at least 180s, especially for large-sized electronic paper, if the interval is too short, afterimages will appear, which will affect the display effect of the electronic paper.
  • In order to reduce afterimages, it is recommended to add black and white full-screen refresh display after 5 partial refreshes, and increase the refresh interval.
  • If the E-Paper is not refreshed for a long time, it must be powered off or enter the deep sleep mode.
  • The EPD Panel / Module is manufactured from fragile materials such as glass and plastic, and may be broken or cracked if dropped. Please handle with care. Do not apply force such as bending or twisting to the EPD panel .
  • High temperature, high humidity, sunlight or fluorescent light may degrade the EPD panel's performance. Please do not expose the unprotected EPD panel to high temperature, high humidity, sunlight, or fluorescent for long periods of time. Please store the EPD panel in controllable environment of warehouse and original package.

All the demo codes provided by this product are based on the 4-wire SPI mode, so the BS selection switch on the back of the board is set to "0" by default.

Module Resource Profile

Module Resource Profile is shown in the figure below:

① Reserve LED and button expansion pins

② Two user buttons

③ Two user LEDs

④ SPI line number selector switch

⑤ Raspberry Pi Pico header

⑥ E-Ink display connector

⑦ Raspberry Pi 40PIN header

⑧ Reserved SPI header

Raspberry Pi Demo Codes Usage

Since the bookworm system no longer supports the wiringpi library, the example program for this system uses the lgpio library, and for the bullseye system, the wiringpi library version of the example program can be used.

Raspberry Pi Platform Interface Definition

The bullseye system example program for the Raspberry Pi uses the pin definitions number in wiringPi, and the bookworm system uses the pin definition of the BCM number. The definition of the wiring with the Raspberry Pi motherboard is shown in the following table:

E-Ink displayWiringPi numberBCM number
VCC3.3V
GNDGND
BUSYP524
RSTNP017
D/CP625
SDAMOSI/P1210
SCLSCLK/P1411
CSBCE0/P108
D174
D2118
K1227
K2322

WiringPi library installation

C:

sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb # Raspberry Pi 4B version upgrade
sudo dpkg -i wiringpi-latest.deb
gpio -v # If version 2.52 appears, the installation is successful

Python:

pip3 install wiringpi

Lgpio library installation

wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
make
sudo make install

Open SPI interface

sudo raspi-config

Enable SPI interface:

Interfacing Options->SPI->Yes

To view enabled SPI devices:

ls /dev/spi*

The following will be printed: "/dev/spidev0.0" and "/dev/spidev0.1"

Installation of python library

The demo codes uses the python 3 environment. To run the python demo codes, you need to install the pil, numpy, and spiderv libraries. Enter the following commands in order to install:

sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo apt-get install python3-pip
sudo apt-get install spidev

C version demo codes

Open 2.7inch E-Paper Display\demo codes\raspberry_pi\c directory

sudo make clean
sudo make
sudo ./main

After entering the above command, you can observe the E-Ink display.

Python Version demo codes

Open 2.7inch E-Paper Display\demo codes\raspberry_pi\python directory

python3 gui_demo.py

After entering the above command, you can observe the E-Ink display.

Raspberry Pi Pico Demo Codes Usage

Hardware interface configuration description

Table 4-2 is the wiring definition between Raspberry Pi Pico and E-ink display:

E-Ink screen interfaceRaspberry Pi Pico
VCCVSYS
GNDGND
CSGP3
CLKGP6
MOSIGP7
DCGP2
RSTGP1
BUSYGP0

Demo Codes Usage

1. Press and hold the BOOTSEL button on the Pico board, connect the Pico to the PC using a Micro USB cable, and then release the button. The device will then recognize a removable disk (RPI-RP2);

2. Copy the RPI_PICO-20240602-v1.23.0.uf2 file in the Raspberry_Pi_Pico directory to the removable disk (RPI-RP2) just identified;

3. Open Thonny IDE and select the interpreter, select Tools -> Options... -> Interpreter, then select MicroPython (Raspberry Pi Pico) and the corresponding port;

4. Select View-> files, then find the files under the \demo codes\Raspberry_Pi_Pico\ path in the "This computer" window, move the mouse to the epd_2inch7.py file, right-click, and select "Upload to /" to upload the file to Pico. Follow the above method to upload the epd_gui.py, epd_demo.py, image.py, and led_key.py files to Pico as well;

5. Double-click gui_demo.py in the Raspberry Pi Pico window (see 1 in Figure 4-3), then click "Run current script (F5)" (see 2 in Figure 4-3) to run the program, and then observe the ink screen display.

6.Double-click led_key.py in the Raspberry Pi Pico window, then click "Run current script (F5)" to run the program, and then press button K1, D1 will light up, and D1 will go out after releasing K1; press button K2, D2 will light up, and D2 will go out after releasing K2.

Arduino Demo Codes Usage

Hardware interface configuration description

Table 2-2 is the wiring definition between Arduino Mega and ink screen:

E-Ink displayArduino Mega
VCC5V
GNDGND
CSD53
CLKD52
MOSID51
DCD8
RSTD9
BUSYD10

Table 2-3 is the wiring definition between Arduino Mega and ink screen:

E-Ink displayArduino UNO
VCC5V
GNDGND
CSD11
CLKD12
MOSID13
DCD10
RSTD9
BUSYD8

Demo Codes Usage

Open the \demo codes\Arduino_MEGA_2.7\Arduino_MEGA_2.7.ino or \demo codes\Arduino_UNO_2.7\Arduino_UNO_2.7.ino with Arduino IDE Click Verify to verify the project file, and then transfer it to the module to observe the E-Ink display.

STM32 Demo Codes Usage

Hardware interface configuration description

E-Ink displaySTM32
VCC3.3V
GNDGND
CSPB12
CLKPB13
MOSIPB15
DCPA8
RSTPA11
BUSYPA12

Demo Codes Usage

Open the demo codes in directory \demo codes\STM32 with Keil uVision5 software, compile it correctly, download it to the module, and observe the E-Ink display.

ESP32 Demo Codes Usage

The ESP32 module used in this example program is ESP32-WROOM-32E.

Hardware interface configuration description

E-Ink displayESP32
VCC3.3V
GNDGND
CSIO27
CLKIO18
MOSIIO23
DCIO14
RSTIO33
BUSYIO13

Demo Codes Usage

Open the demo codes in directory \demo codes\Arduino_ESP32_2.7\ with Arduino IDE Click Verify to verify the project file, and then transfer it to the module to observe the E-Ink display.

Image Creation and Modeling Instructions

Image Creation

Create the images you want to display as pure black and white images with a resolution of 264 x 176 (grayscale is not supported). Save them as BMP or JPG files (BMP format is recommended).

Modeling

Bitmap creation can be done using the "image2lcd" software, which is provided in the package. Taking the example of achieving the effect shown in Figure 2-2, the parameter settings interface for bitmap creation is shown in Figure 2-3:

1. Open the image that needs to be modeled.

2. Output data type: Select "C Language Array (*.c)".

3. Scanning method: Choose "Vertical scanning".

4. Output grayscale: Select "Monochrome".

5. Maximum width and height: Choose "264" "176". After selection, click the arrow next to it to confirm.

6. Do not check any of the 5 items as shown in the figure below.

7. Color Inversion: Check to display the original image; uncheck for color inversion.

8. Click "Save" to save the converted array to a file with the extension ".c".

9. Finally, use the array in the ".c" file to replace the corresponding array in the program.

Figure 2-2
Figure 2-2
Figure 2-3
Figure 2-3

Data Resources

Schematic

Demo codes for bullseye system

Demo codes for bookworm system

Data Sheet

TXS0108E

Technical Support

Technical Support and Product Notes