E-Paper ESP32 Driver Board

From Waveshare Wiki
Jump to: navigation, search
E-Paper ESP32 Driver Board

Universal e-Paper Driver HAT
supports various Waveshare SPI e-Paper raw panels





This Wiki mainly introduces the specific operation of this product. If you want to get the type of the e-paper screen model supported by this product, please check the bottom of the official website for product details and purchase.


Universal e-Paper Driver HAT features ESP32, supports various Waveshare SPI interface in e-Paper raw panels. It also supports refreshing image to e-paper via WIFI or Bluetooth and Arduino.


20220728: The serial port chip is changed from CP2102 to CH343, please pay attention to the driver selection.


  • WiFi Standard: 802.11b/g/n
  • Communication Interface: SPI
  • Bluetooth Standard: 4.2, BR/EDR and BLE included
  • Communication Interface: 3-Wire SPI, 4-wire SPI (default)
  • Working voltage: 5V
  • Working Current: 50mA-150mA
  • Outline dimension: 29.46mm x 48.25mm
  • Flash size:4 MB
  • SRAM size:520 KB
  • ROM size:448 KB


Pin ESP32 Description
VCC 3.3V Power input
GND GND Power ground
SCK P13 SPI CLK, Clock Signal Input
DIN P14 SPI MOSI, Data Input
CS P15 Chip Select, active-low
BUSY P25 Busy Output Pin (means busy)
RST P26 Reset, active-low
DC P27 Reset, Data/Demand, low level means to demand, high level means data

PS: The above is the board fixed connection, no additional operation by the user.


  • Onboard ESP32, support Arduino development.
  • Provide Android mobile APP program, which can update the display content through Bluetooth EDR, easy to use.
  • Provide HTML host computer program, which can remotely update the display content through the web page, which is convenient to integrate into various network applications.
  • Supports Floyd-Steinberg dithering algorithm for more color combinations and better shadow of the original image.
  • Supports many common image formats (BMP, JPEG, GIF, PNG, etc.).
  • Factory built-in e-ink screen driver (open source).
  • 5V pin supports 3.6V to 5.5V voltage input, and can be powered by a lithium battery.
  • Provide complete supporting information manual.


This product cooperates with the ink screen and is suitable for the application scenario of wireless refreshing.

  • Supermarket electronic price tag
  • Electronic name card
  • Serial information display board, etc.


Hardware Connection

This product is shipped with an ESP32 network driver board, an adapter board, and an FFC extension cable.
When using it, you can directly connect the screen to the driver board, or connect it through extension cables and adapter boards.
Direct access to the driver board:
Access via extension cord:

  • Set the mode switch: Set the No. 1 switch according to the model of the EPD used. There are many screens. If it is not listed, please use 'A' to try. If the display effect is poor or cannot be driven, please try switching the switch.

Esp32 pre003.jpg

  • Turn on the serial port module: Toggle the No. 2 switch to "ON", this switch controls the power supply of the USB to the UART module. When you don't need to use it, you can manually turn off the module to save power (if switch 2 is in the OFF state, you cannot upload the program.)
  • Use a micro USB cable to connect the ESP32 driver board to a computer or 5V power supply.
Trigger state E-Paper
B 1.54inch e-Paper, 2.13inch e-Paper, 2.13inch e-Paper (D), 2.9inch e-Paper
A 1.54inch e-Paper (B), 1.54inch e-Paper (C) , 2.13inch e-Paper (B), 2.13inch e-Paper (C), 2.7inch e-Paper (B), 2.9inch e-Paper (B), 2.9inch e-Paper (C), 4.2inch e-Paper (B), 4.2inch e-Paper (C), 5.83inch e-Paper (B), 5.83inch e-Paper (C), 7.5inch e-Paper (B), 7.5inch e-Paper (C)

Download Demo

We provide three kinds of demos: local, bluetooth, and WiFi. The sample program can be found in #Resource, or click the sample programto download.
Unzip the downloaded compressed package, you can get the following files:
Esp32 download de.png

  • ePape_Esp32_Loader_APP: Bluetooth App source code (Android Studio)
  • examples: local demo
  • Loader_esp32bt: Bluetooth demos
  • Loader_esp32wf: WiFi demo
  • app-release.apk: Bluetooth demo App installation package

Environment Configuration

Image Processing Algorithms

In the Bluetooth and WiFi demos, two image processing algorithms are provided, namely Level and Dithering.

color scale method

An image can be divided into several large color gamuts, and each pixel on the image is divided into these color gamuts according to how close the color is to these color gamuts. This method is more suitable for images with few colors, such as bright or tri-color shapes or text images. Taking the black and white and red ink screen as an example, when processing the image, we hope to process it into black, white and red, so for an image, we can divide all the colors of the image into three large color areas: the black area, white area, red area.
For example, according to the figure below, if the value of a pixel in the grayscale image is equal to or less than 127, we regard this pixel as a black pixel, otherwise, it is white
For color images, we all know that RGB has three color channels. Compared with the red channel, we can refer to blue and green as the blue-green channel or the non-red channel. According to the figure below, a pixel on a color image, if it has a high value in the red channel, but a low value in the blue-green channel, we classify it as a red pixel; if its red channel and blue- If the green channel has low values, we classify it as a black pixel; if the red and blue-green channel values are high, we classify it as white.
In the algorithm, the color definition is calculated based on the difference between the RGB value and the sum of the squares of the expected color value. The expected color value refers to the color value that the pixel is closest to, and these values are stored in the curPal array


For those images with more colors or more gradient areas, the above gradation method is not suitable. In many cases, the pixels in the gradient area in the image may be very close to all color gamuts. If you use the gradation method to draw The image will lose a lot of image details. Many images taken by cameras, by mixing colors to paint shadows and transition areas, in these images, the gradient area accounts for the majority For the human eye, it is easy to confuse a particularly small color. For example, two colors, red and blue, are juxtaposed. If you reduce it to a small enough hand, it will appear to the human eye as a mixture of red and blue. into color. The defect of the human eye means that we can deceive the human eye and use the "mixing" method to obtain more colors that can be expressed. The dithering algorithm uses this phenomenon. The routine we provide uses the Floyd-Steinberg dithering algorithm - based on error diffusion (published by Robert Floy and Louis Steinberg in 1976). The formula is for error diffusion according to the image below
X is the error (a scalar (vector) difference between the original color and the gray value (color value)), this error will spread to the right, lower right, lower, and lower left in four directions, respectively 7/16, 1/16, 5/16 and 3/16 weights are added to the values of these four pixels. Interested users can go to understand the algorithm, there are many resources on the Internet.


Original image
"Black and white grading" and "Multicolor grading"
"Black and White Dithering" and "Multicolor Dithering"

Bluetooth Demo

Download example

  • Go to the Loader_esp32bt directory, double click the Loader_esp32bt.ino file to open the example.
  • Choose Tools->Boards->ESP32 Dev Module and select the correct Port according to Device Manager: Tools->Port

Epd esp32 bluetooth 1.png

  • Click the Upload icon to build the project and upload it to the ESP32 driver board.
  • Install the APP to the Android board and open it:

Epd esp32 bluetooth 2.jpg

  • APP has five buttons on the main page:
    • BLUETOOTH CONNECTION: This button is used to connect the ESP32 device via Bluetooth.
    • SELECT DISPLAY TYPE: This button is used to select the type of display according to what you buy.
    • LOAD IMAGE FILE: Click it and choose a picture to open. It is only available after choosing the display type.
    • SELECT IMAGE FILTER: This button is used to choose the image process method.
    • UPLOAD IMAGE: Upload the processed image to ESP32 driver board and update to e-Paper display.
  • Please first open the Bluetooth function of your phone. Click the BLUETOOTH CONNECTION button -> Click the SCAN icon on the top-right to scan the Bluetooth device.
  • Find the ESP32 device and connect. If your phone is the first time to connect this device, it requires pairing, complete the pairing process according to the prompt. (Note: The APP cannot work with pairing.)
  • Click "SELECT DISPLAY TYPE" to choose the display type.
  • Click "LOAD IMAGE FILE" To choose a picture from your phone and cut it.
  • Click " SELECT IMAGE FILTER" to choose a process algorithm and confirm.
    • "LEVEL: MONO": This option will process the picture to a monochrome image.
    • "LEVEL" COLOR": This option will process the picture to the tricolor image according to the display colors of the display (only valid for colorful displays).
    • "DITHERING: MONO": This option will process the picture to a monochrome image.
    • "DITHERING: COLOR": This option will process the picture to the tricolor image according to the display colors of the display (only valid for colorful displays).
  • Click "UPLOAD IMAGE" to upload the image to the ESP32 device and display it.

WiFi Demo

How to Use

  • Go to the Loader_esp32wf directory, double click Loader_esp32wf.ino file to open the project.
  • Choose Tools->Boards->ESP32 Dev Module in IDE menu, and select the correct COM port: Tools->Port

Epd esp32 wifi 1.png

  • Open the srvr.h file, modify the ssid and password to your actual WiFi used.

Epd esp32 wifi 2.png

  • Click the Upload icon to build the project and upload it to the ESP32 driver board.
  • Open the serial monitor, set the baud rate to 115200. Then you can get the information printed like the IP of the ESP32 board.

Epd esp32 wifi 3.png

  • Open a browser on the PC or mobile phone (Note that you should connect your PC/Phone to the same network as the ESP32 board), go to the webpage with the IP address of the ESP32 board:

Epd esp32 wifi 4.png

  • There are five areas in the webpage:
    • Image Operation
      Select Image file: Click the option to choose a picture from PC/phone

Level: mono: Black/White image level processing.
Level: color: Colorful image level processing (only valid for colorful display)
Dithering: mono: Black/White image Dithering processing
Dithering: color: Colorful image Dithering processing (only valid for colorful display)
Update image: Upload the image to the ESP32 board and display it.

    • IP Information: In this are, the IP information of the ESP32 board connected is listed.
    • Image Size Setting: x and y are the beginning position of the image. For example, if you select an image with 800x480 resolution, and the display you connect is 2.13. The 2.13inch display cannot display the whole picture, the codes will crop the picture according to the resolution of displays. If you set the x and y, the codes will set the (x, y) as the being pixel where it starts to crop. w and h is the resolution of the displays chosen.

Note: If you modify the x and y value, you need to click the Level or Dithering options to process the image again.

    • Display Type: You should first select the display size here according to the display used.
    • Image Preview: it will display the original image selected and the image processing.
    • PS: The upload progress value is printed at the bottom of the webpage when uploading.

For examples:

  • In area ① click Select image file to choose a picture, you can also drag the picture to the Original image area directly.
  • In area ④ choose the type according to the display, for example, 1.54b
  • In area ① choose an algorithm to process the image, for example, Dithering: color
  • In area ① click Upload image to upload the image and display it.

Epd esp32 wifi 5.png

Local Demo

Download example

  • Go to examples\ directory. copy the whole esp32-waveshare-epd folder to [Installation directory of Arduino IDE]\hardware\espressif\esp32\libraries.

Epd esp32 example 1.png

  • Open the Arduino IDE, Find the wareshare-e-Paper examples from File->Example, and select one according to the display type.

Epd esp32 example 2.png

  • Click Upload to build the project and upload it to the ESP32 board. You can open the Serial Monitor to check the debug information.



ESP32 Resources

Demo Code

Related Resources

This is a post in Arduino Form about our SPI e-Paper thanks to ZinggJM, maybe you want to refer to.

Software Driver

CP2102 (Old version, used before July 2022)

CH343 (New version, used after July 2022)


  • Open epd1in13.h in the project and change the following value to 1

Epd2in13 esp chose.png

* Open epd1in54.h in the project and change the following value to 1


Download Arduino-ESP32 Package,Unzip the files in the compressed package to the hardware\espressif\esp32 path in the Arduino IDE installation directory, select "OK to overwrite the file" (remember to back up the original file), and then re-run the routine after power off. (Note: If the path does not exist in the installation directory, you can create it manually)

Try to reduce the baud rate, you can try to adjust to 115200, as shown in the figure below

FAQ arduino.png

Connecting........................................................................................................................................................................_____....._____.... .____Error uploading project_A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
You need to press and hold the boot button on the ESP32 baseboard when the Connecting... prompt appears

It is necessary to confirm that the hardware connection is correct, and select the corresponding ink screen model

Compatible with more ink screen models, which can be adjusted according to the display effect


If you require technical support, please go to the Support page and open a ticket.