• sales

    +86-0755-88291180

e-Paper HAT Hardware/software setup

We provide examples for four popular platforms: Arduino UNO, Jetson Nano, Raspberry Pi, and STM32. You can refer to the corresponding part according to the platform you use(This is a common template will be used by all types of the e-Paper, please refer to the corresponding type you have)

Arduino UNO

The example we provide for Arduino platform is based on Waveshare UNO PLUS (it is compatible with official Arduino UNO R3). If you use other Arduino board which is not compatible with UNO, you may need to change the wring.

Hardware connection

Connect to Arduino UNO
e-PaperArduino
Vcc5V
GNDGND
DIND11
CLKD13
CSD10
DCD9
RSTD8
BUSYD7

Running examples

Download demo codes from Resources, unzip it to get projects. Arduino example is located in the directory ~/Arduino UNO/…
Open project according to the type. For example, if the e-Paper you have is 1.54inch e-Paper Module, please open the epd1in54 folder and run project epd1in54.ino.
Open project, choose the correct Board and Port, then compile and upload it to board.
Note: Because of the small RAM of Arduino, it cannot support drawing function, therefore, we only provide image display function. The image data are stored in flash. Or you can think about using Waveshare e-Paper Shield for Arduino board

Working With Arduino

Hardware Connection

Use an 8PIN cable to connect, please refer to the pin correspondence table below:

Connect To Arduino
e-PaperArduino UNOMega2560
VCC5V5V
GNDGNDGND
DIND11D51
CLKD13D52
CSD10D10
DCD9D9
RSTD8D8
BUSYD7D7

Install IDE

Run The Demo

  • Download the demo in Resource, unzip it to the "E-Paper_code" directory, and you can see the following content:

Arduinos Guides for 4.37 e-Paper 001.jpg

  • Open the test demo: E-Paper_code\Arduino\epd2in9b_V3\epd2in9b_V3.ino

Arduinos Guides for 2.9mb e-Paper 2.jpg

  • Select the corresponding Board and Port in the Tools in the Arduino IDE.

Arduinos Guides for 4.37 e-Paper 003.jpg

  • Finally, click upload, the upload is successful as follows (Arduino 1.8.13).

Arduinos Guides for 4.37 e-Paper 004.jpg

Raspberry Pi

Hardware connection

If the board you get is the HAT version like 2.13inch e-Paper HAT, you can directly attach it on the 40PIN GPIO of Raspberry Pi. Or you can wire ti to Raspberry Pi with 8PIN cable.

Connect to Raspberry Pi
e-PaperRaspberry Pi
BCM2835Board
VCC3.3V3.3V
GNDGNDGND
DINMOSI19
CLKSCLK23
CSCE024
DC2522
RST1711
BUSY2418
  • Open terminal, use command to enter the configuration page
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes  to enable SPI interface



Reboot Raspberry Pi:

sudo reboot

Please makre sure that SPI interface was not used by other device

Libraries Installation

  • 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
#For more details, please refer to http://www.airspayce.com/mikem/bcm2835/
  • Install wiringPi libraries
sudo apt-get install wiringpi

#For Pi 4, you need to update it:
cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
#You will get 2.52 information if you install it correctly
  • Install Python libraries
#python2
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-pil
sudo apt-get install python-numpy
sudo pip install RPi.GPIO
sudo pip install spidev
#python3
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
Download examples

Open terminal and execute command to download demo codes

sudo git clone https://github.com/waveshare/e-Paper
cd e-Paper/RaspberryPi\&JetsonNano/
Running examples

  • C codes

Find the main.c file, uncomment the definition of e-Paper types, then compile and run the codes.

cd c
make clean
make
sudo ./epd
  • python

Run examples, xxx is the name of the e-Paper. For example, if you want to run codes of 1.54inch e-Paper Module, you xxx should be epd_1in54

cd python/examples
# python2
sudo python xxx.py
# python3
sudo python3 xxx.py


Jetson nano Developer Kit

The example for Jetson Nano use software SPI, speed of sfotware SPI is a little slow

Hardware connection

Jetson Nano's 40PIN GPIO is compatible with Raspberry PI, and API of Jetson.GPIo is same as RPi.GPIO, therefore, the pin numbers of Jetson nano are same as Raspberry Pi's

Connect to Jetson Nano
e-PaperJetson Nano Developer Kit
BCM2835Board
VCC3.3V3.3V
GNDGNDGND
DIN10(SPI0_MOSI)19
CLK11(SPI0_SCK23
CS8(SPI0_CS0)24
DC2522
RST1711
BUSY2418
Software setting

  • Open terminal, and install GPIO libraries :
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install Jetson.GPIO
sudo groupadd -f -r gpio
sudo usermod -a -G gpio your_user_name
sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

Note: your_user_name is the user name of your Jetson, for example:waveshare

  • Install I2C libraries
sudo apt-get install python-smbus
  • Install PIL libraries
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
Download examples

Open terminal and execute commands:

sudo git clone https://github.com/waveshare/e-Paper
cd e-Paper/RaspberryPi\&JetsonNano/
Running examples

  • C codes

Find main.c file, Open it and uncommend the e-Paper which you use, compile and run it

cd c
make clear
make
sudo ./epd
  • python

Run examples, xxx is the name of e-Paper. For example, if you want to run examples of 1.54inch e-Paper Module, xxx should be epd_1in54

cd python/examples
# python2
sudo python xxx.py
# python3
sudo python3 xxx.py

STM32

Hardware connection

The examples we provide are based on Wavshare Open103Z , the connecting method provide is based on STM32F13ZET6 as well. For other board, please port it by yourself.

Connect to STM32F103ZET6
e-PaperSTM32F103ZET6
Vcc3.3V
GNDGND
DINPA7
CLKPA5
CSPA3
DCPA2
RSTPA1
BUSYPA3
Running examples

Enter the directly of STM32 examples, open project by Keil5 software. Set Board and programmer, then compile and download it to board