Arduino E-Paper Display (E-Ink) Library Examples [Tutorial]

In this tutorial, you’ll learn how to interface E-Paper Display With Arduino. We’ll set up the required Arduino E-Paper Display Library and create some e-paper display examples (text & bitmap images on the e-paper screen).

This guide tutorial is an excellent starting point for your Arduino + E-Paper display project idea. Without further ado, let’s get right into it!

Table of Contents

  1. Arduino E-Paper Display
  2. Arduino E-Paper Display Interfacing
  3. Arduino ePaper Library (GxEPD2)
  4. Arduino E-Paper Display Examples (GxEPD2)
  5. Arduino ePaper Library (WaveShare)
  6. Arduino E-Paper Display Examples (WaveShare)
  7. Wrap Up

Arduino E-Paper Display

E-Paper, or electronic paper, is a relatively new display technology that mimics the appearance of ink on paper, that’s why it’s often called e-ink display. Unlike traditional LCD or LED screens, e-paper displays do not emit light but reflect ambient light, providing a comfortable and natural reading experience.

This unique characteristic makes e-paper an ideal choice for various applications where readability, power efficiency, and visibility in bright conditions are essential. E-paper displays are commonly found in devices like e-readers, electronic shelf labels, price tags, etc.

How E-Paper / E-Ink Display Works

The core component of an e-paper display is a layer of micro-capsules or micro-cups, each containing tiny particles suspended in a clear fluid. These particles are usually charged with different polarities and colors, such as black and white.

When an electric field is applied to the microcapsules, the charged particles move to the top or bottom of the capsule, becoming visible to the viewer. By selectively applying electric fields to different pixels of the display, it is possible to display text and images.

Eink E-Paper Display Working Principle GIF

E-Paper Display (E-Ink) Pros & Cons

Advantages (Pros) of E-Paper Display Units:

  • Low Power Consumption: E-paper displays consume power only when changing the displayed content. Once an image is set, it can remain on the screen indefinitely without drawing additional power.
  • Readability: The reflective nature of e-paper provides excellent readability, even in direct sunlight. This makes it ideal for outdoor and brightly lit environments.
  • Eye Comfort: E-paper displays reduce eye strain compared to backlit screens, making them comfortable for extended reading sessions.
  • Wide Viewing Angles: E-paper displays maintain consistent image quality regardless of the viewing angle.

Disadvantages (Cons) of E-Paper Display Units:

  • Slow Refresh Rate: E-paper displays typically have slower refresh rates compared to LCD or OLED screens, making them unsuitable for dynamic content like video playback.
  • Limited Color Range: Most e-paper displays are monochromatic, though some color versions exist. However, the color range and saturation are often limited.
  • Higher Cost: E-paper technology can be more expensive to manufacture, leading to higher costs for devices using e-paper displays compared to traditional graphical LCDs.

E-Paper Display (E-Ink) Applications

  • E-Readers
  • Shelf Labels
  • Store Price Tags
  • Wearable Devices
  • etc…

Buy an E-Paper 2.9″ Display: you can find it here on ( Amazon.com / AliExpress / eBay )


Arduino E-Paper Display Interfacing

1. Arduino E-Paper Display Wiring

For interfacing an e-paper display module with Arduino Uno, you can follow the wiring (connection) described in the table below. However, for other Arduino boards (Mega, Mini, etc), you need to check the corresponding “SPI pins” which is the serial interface used for connecting e-paper display modules.

e-Paper DisplayArduino UNOArduino Mega2560
Vcc5V5V
GNDGNDGND
SDI (DIN)D11D51
SCLK (CLK)D13D52
CSD10D10
DCD9D9
RSTD8D8
BUSYD7D7

2. Arduino E-Paper Display Library

For this tutorial, we’ll test two different libraries for E-Paper display with Arduino which are listed below:

  • GxEPD2
  • WaveShare

We’ll install and use each library for a couple of example projects to test their functionalities. However, after many test cases we’ve conducted, the WaveShare library is much better in many aspects so you can skip over the GxEPD2 library examples if you’re not curious about it.


Arduino ePaper Library (GxEPD2)

You can download and install the Arduino GxEPD2 library manually from GitHub, or alternatively, install it within the Arduino IDE itself. Just open the library manager. Tools > Manage Libraries > Search for  GxEPD2. Then, click Install and let it finish the installation.

Now, you can easily use the Arduino GxEPD2 library and check the built-in examples for the library to help you get started.

Next up, we’ll move to the practical code examples to test this Arduino E-Paper display library for displaying text & bitmap images on the E-Paper display module.


Arduino E-Paper Display Examples (GxEPD2)

Here are two project code examples for the Arduino E-Paper display interfacing using the GxEPD2 library. In the first example, we’ll display 3 lines of text messages on the E-Paper display (each line is center-aligned on the screen). In the second example, we’ll display a small bitmap image on the E-Paper display.

E-Paper Display Text Code Example

Here is the full code listing for this example.

Testing Result

Here is the testing result for the example code listed above.

Arduino-E-Paper-Display-Text-Example-GxEPD2-Library

Code Customization

You can easily change the font family/size of the displayed text but you need to #include the font header file and use the setFont function to change the font. In the PrintMessages() function:

The text color can be set to black or red as our 2.9″ E-Paper display supports (White, Black, and Red) colors. This can be done as follows:

To change the number of text messages (lines of text), you just need to modify this: #define TEXT_LINES  3

Then, you can edit the text strings to be displayed by modifying the variable below. Just make sure that the number of strings in the array matches the number of text lines you’d like to display and there is no “,” after the last item in the array.

E-Paper Display BitMap Code Example

Here is the full code listing for this example. Which displays a 45×45 bitmap image stored in the flash (program memory). You can use this online tool to get the bitmap array of any image you want to display on the E-Paper. But make sure it’s a small image because of the memory limitation associated with this E-Paper display library.

Testing Result

Here is the testing result for the example code listed above.

Arduino-E-Paper-Display-BitMap-Image-Example-GxEPD2-Library

❕ Note

The GxEPD2 library is really good for displaying text on the E-Paper display with little to no effort. However, it’s lacking behind the WaveShare library when it comes to graphical bitmap display and requires a lot of memory to handle graphics beyond the capabilities of the Arduino UNO board. However, the WaveShare library can easily handle E-Paper display graphics with minimal memory utilization.


Arduino ePaper Library (WaveShare)

The WaveShare E-Paper display library is not listed in the Arduino library manager so you can’t add it within the Arduino IDE itself. However, you can download the latest version of it from GitHub or WaveShare’s website.

Here is how it looks inside after downloading and unzipping the master directory.

Arduino-WaveShare-E-Paper-Display-Library-Examples

You can then try the provided examples that correspond to the E-Paper display module you’ve got. For me, the examples starting with epd2in9xxx are what I should be using because the E-Paper display unit that I’ve got is a 2.9″ display.

In the next section, we’ll create a couple of example projects to test the WaveShare E-Paper Arduino library’s functionalities.


Arduino E-Paper Display Examples (WaveShare)

Here are 3 project code examples for the Arduino E-Paper display interfacing using the WaveShare library. In the first example, we’ll display 3 lines of text messages on the E-Paper display. In the second example, we’ll display a full-size 2.9″ bitmap image (296×128) on the E-Paper display.

In the third last example, we’ll display a full-size 2.9″ bitmap image (296×128) on the E-Paper display with separate bitmaps for black & red color pixels.

E-Paper Display Text Code Example (1)

Here is the full code listing for this example.

Testing Result

Here is the testing result for the example code listed above.

Arduino-E-Paper-Display-Text-Example-WaveShare-Library

E-Paper Display BitMap Code Example (2)

Here is the full code listing for this example. Which displays a 296×128 bitmap image stored in the flash (program memory). The bitmap image data array is found in the imagedata.cpp file. You can use this online tool to get the bitmap array of any image you want to display on the E-Paper.

Testing Result

Here is the testing result for the example code listed above.

Arduino-E-Paper-Display-BitMap-Image-Example-WaveShare-Library

E-Paper Display BitMap (Black/Red) Code Example (3)

This third example project code displays two 296×128 bitmap images stored in the flash (program memory). The 2x bitmap image data arrays ( R_IMAGE_DATA red pixels image bitmap & B_IMAGE_DATA black pixels image bitmap) are found in the imagedata.cpp file. You can use this online tool to get the bitmap array of any image you want to display on the E-Paper.

You can design any custom image with black and red colors but make sure that the red image doesn’t overlap the black image pixels. Export each image bitmap array independently and replace the contents of the arrays found in the imagedata.cpp file with yours.

❕ Note

The WaveShare Arduino E-Paper display library is much more versatile and easy to use overall compared to the GxEPD2 library and we highly recommend using it instead for almost any situation (text display, graphics, fast display, partial refresh, etc).

Partial Refresh is a technique used in e-paper displays to update only a portion of the screen, rather than the entire display. This method significantly reduces the time and power required to change the content, making it useful for applications where only small sections of the display need to be updated frequently.


Required Parts List

Here is the full components list for all the parts you’d need to perform the practical LABs mentioned in this tutorial and the whole Arduino Programming series of tutorials found here on our website.

* Please, note that those are affiliate links and we’ll receive a small commission on your purchase at no additional cost to you, and it’d definitely support our work.

QTY.Component NameAmazon.comAliExpresseBay
1E-Paper Display ModuleAmazonAliExpresseBay
1Arduino UNO KitAmazonAliExpresseBay
1Complete Arduino Sensors/Modules KitAmazonAliExpresseBay
1DC Power SupplyAmazonAliExpresseBay
1BreadBoardAmazonAliExpresseBay
1LEDs KitAmazonAmazonAliExpresseBay
1Resistors KitAmazonAmazonAliExpresseBay
1Capacitors KitAmazonAmazonAliExpress & AliExpresseBay & eBay
1Jumper Wires PackAmazonAmazonAliExpress & AliExpresseBay & eBay
1Push ButtonsAmazonAmazonAliExpresseBay
1PotentiometersAmazonAliExpresseBay

★ Check The Links Below For The Full Course Kit List & LAB Test Equipment Required For Debugging ★

Download Tutorial’s Attachments

You can download all attachment files for this Article/Tutorial (project files, schematics, code, etc..) using the link below. Please consider supporting our work through the various support options listed in the link down below. Every small donation helps to keep this website up and running and ultimately supports the whole community.


Wrap Up

To conclude this tutorial, we can say that you can easily interface an e-paper (e-ink) display with Arduino using the WaveShare library. Try the provided code examples on your hardware setup to maximize the information gained from this tutorial. Make sure to wait a good few seconds after uploading each example code because refreshing an e-paper display takes some time to complete.

If you’re just getting started with Arduino, you need to check out the Arduino Getting Started [Ultimate Guide] here.

And follow this Arduino Series of Tutorials to learn more about Arduino Programming.

Share This Page With Your Network!
Join Our +25,000 Newsletter Subscribers!

Stay Updated With All New Content Releases. You Also Get Occasional FREE Coupon Codes For Courses & Other Stuff!

Photo of author
Author
Khaled Magdy
Embedded systems engineer with several years of experience in embedded software and hardware design. I work as an embedded SW engineer in the Automotive & e-Mobility industry. However, I still do Hardware design and SW development for DSP, Control Systems, Robotics, AI/ML, and other fields I'm passionate about.
I love reading, writing, creating projects, and teaching. A reader by day and a writer by night, it's my lifestyle. I believe that the combination of brilliant minds, bold ideas, and a complete disregard for what is possible, can and will change the world! I will be there when it happens, will you?

Leave a Comment