The displays used in microcontroller projects have significantly evolved since the days when we only had simple 7-segment LED displays.
Today, we have a wide variety of options, such as LCD, OLED, and more innovative technologies like ePaper, which offer significant improvements in energy efficiency. These new technologies allow for more dynamic and customizable interfaces, suitable for a wide range of applications, from wearable devices to IoT projects and industrial systems.
In this project, we will explore a practical application using a 4-color ePaper display and I’ll show you how to control it using a special expansion board from Seeed Studio, specifically designed for this type of display. We will also use the XIAO RA4M1 board as the controller, programmed with Arduino IDE V2. This will give us an excellent opportunity to continue discovering the capabilities of this small yet powerful board.
E-Ink DisplaysE-Ink technology, also known as ePaper, was developed over 30 years ago with the goal of creating screens that resemble printed paper.
It works by using a system of microcapsules containing white and black pigments (initially only monochromatic, but later gray scales and more colors were added). These microcapsules are suspended in a fluid and can move to the surface when an electric current is applied, creating high-contrast images without the need for backlighting.
This movement mechanism is called the electrophoretic effect, which is why these displays are sometimes referred to by the same name. Another common term for them is EPD, which stands for Electronic Paper Display.
Advantages
The main advantage of electrophoretic technology is its low power consumption, as it only requires electricity when the image on the screen changes, while it consumes nothing if the image remains static. Additionally, the image has high contrast, making it easily readable even in bright environments.
Disadvantages
The Achilles' heel of these displays is their low refresh rate: changing the image on the screen can take several seconds. This severely limits their use for displaying rapidly changing content, such as videos. Another limitation is their ability to display many colors. Although this is a technology under constant development and there are currently screens capable of showing a wide range of colors, they are still behind other technologies like OLED.
Applications
The most popular applications of these displays are eBook readers, electronic price tags, signage in sunlight-exposed environments, and informational panels for home automation applications, among others. You can also find them in some portable devices as a low-power auxiliary screen.
EPD or ePaper displays usually have many control pins, and it's common for these pins to be available on a flexible printed circuit (FPC) ribbon, which needs to be connected using a special connector with very small spacing. These connectors can be difficult to solder without specialized tools, so various manufacturers produce adapter boards to make working with these displays easier.
In this tutorial, I will use a board from Seeed Studio called the eInk Expansion Board, specifically designed to connect different XIAO boards to a variety of EPDs.
Features
The outstanding features of this adapter board are the following:
- 24-pin connector for the flexible display ribbon.
- Socket for connecting the XIAO board.
- 0.1″ pitch 8-pin connector for connecting to another microcontroller.
- Resistors for signal level adaptation between the EPD and the XIAO.
- Support for multiple displays and various XIAO boards.
You can find all the details of the eInk Expansion Board in its Wiki.
The display I will use for this tutorial is the GDEY0213F51 from Good Display, which is also sold by Seeed Studio.
Features
- Size: 2.13 inches
- Resolution: 122 x 250 pixels
- Controller: JD79661
- Active area: 48.55 mm x 23.7046 mm
- Colors: White, Black, Yellow, and Red
- Full refresh time: 25 seconds max
- Interface: SPI
- Connector: 24-pin flexible ribbon, 0.5 mm pitch
- High contrast
- High reflectance
- Ultra-low power consumption (9.9 mW during transition)
After reviewing the different components to be used, let's now look at the procedure for displaying images on the display.
Preparing the imageBefore displaying an image on the ePaper, some preliminary steps are necessary. First, we need to design the image following the size specifications and the allowed color palette. Then, it is necessary to convert the image into a compatible format that we can integrate into our code.
Image design
The image to be displayed should be 250 pixels wide by 128 pixels high (even though the display has only 122 pixels). You can create or design the image using any design software, even Paint, which is included with Windows.
If you use Paint, you can configure the size by clicking on File– Image Properties (or pressing Ctrl + E).
Once you've set the image size, you can let your imagination run wild and draw whatever you want, but remember that you only have four colors available: White, Black, Red, and Yellow. You can find these colors in Paint's color palette:
Here’s an example (as you can see, my imagination didn’t go very far 😊):
Another option is to take an image or part of an image that you’ve already designed and reduce the number of colors in the palette using a slightly more sophisticated design program like GIMP.
In the example below, I created a 250×128 pixel image using Canva's AI image generator. I requested it to have 4 colors, but the resulting image actually had a much larger color palette. Using GIMP, I reduced the number of colors by applying a custom palette I defined, containing only the colors supported by the display, which are:
- White: #000000
- Black: #FFFFFF
- Red: #FF0000
- Yellow: #FFFF00
And if you don't want to complicate things, here's an online tool that converts colors using different methods.
Click this link to access the online tool.
Whichever method you use to prepare the image, you should save it in BMP or JPG format for the conversion process.
Image ConversionOnce your image is ready, with the correct size and color palette, you need to convert it to another format to incorporate it into your code written in the Arduino IDE.
This can be done using the image2lcd program, which takes the image and converts it into a header file (a ".h" file) with the image information in the form of an 8000 byte array (unsigned char).
Installing image2lcd
The image2lcd program can be downloaded from this link.
By clicking on the link, a compressed file in 7z format will be downloaded. You need to unzip it, run the executable file, and follow the installation steps. This program is exclusive to Windows and does not have versions for other operating systems.
Once installed, run it, and you'll see a screen like the following:
At the bottom right, there is a tab that says “Register.” It’s important to register the program; otherwise, it will add text to the images you want to convert. Click the “Register” tab and enter the following code: 0000-0000-0000-0000-6A3B.
Converting the image
Once the program is installed and registered, you can proceed to convert the image format.
Click the Open icon and load the image you want to convert. Adjust the settings on the left so they are as follows:
Once the settings are adjusted, don’t forget to press the arrow-shaped button next to "128." This will convert the image.
Now, click the Save icon (to the right of Open) and save the data with any name (for example, "demo.h"). It should look something like this:
To transfer and display the image on the screen, we will use a demo program provided by Seeed Studio in their Wiki, which you can download from this repository. (The description refers to a 212 x 104 display, but the code is for 250 x 128).Copy the code into the Arduino IDE, and in the same folder as the “.ino” file, copy the “demo.h” file that contains the image data. (If you changed the file name, you will need to modify the include directive at the beginning of the code accordingly).
In the following video, you can see the code in action:
As you can see, this display is much slower than an OLED and takes a few seconds to load the image, but this is compensated by its low power consumption. In fact, if you disconnect the power from the adapter and the display, the image remains.
ConclusionsIn this project, I walked you through the steps to display images on a four-color ePaper display using a XIAO RA4M1 board.
We covered what ePaper or electrophoretic technology is, along with its main advantages, disadvantages, and applications. I also described the features of the ePaper adapter board from Seeed Studio, which greatly simplifies connecting this type of display to various XIAO boards. Likewise, we reviewed the main features of the GDEY0213F51 display used in this tutorial and how to connect it to the adapter board.
Finally, I showed you the process for designing and preparing an image, considering the size and color palette. I shared various options for adjusting the color palette, including an online tool to simplify the task. We also went over how to convert the image into a “.h” header file using the image2lcd program and how to include it in a sample program that you can test using the Arduino IDE to transfer the image to the display.
I would like to take this opportunity to thank the people at Seeed Studio, who, as part of the Early Adopter program, sent me the materials needed to create this tutorial and provided the necessary support when I had questions or needed to make inquiries.
This surely won’t be the last tutorial dedicated to this display, which has great potential. In the future, I will show you other ways to use it to its full advantage, as well as share some practical projects and applications.
I hope this tutorial serves as a useful starting point for you to create your own projects with this display and the XIAO board series.
More info- Display Datasheet in PDF
- Download Link for image2lcd
- Good-Display Website, the Manufacturer of the EPD
- E-Ink Expansion Board Page on the Seeed Studio Wiki
For more information and projects, you can check out my blog and social media.
Comments
Please log in or sign up to comment.