Maker Portal

View Original

Bluetooth-Enabled e-Paper Display with Arduino

“As an Amazon Associates Program member, clicking on links may result in Maker Portal receiving a small commission that helps support future projects.”

See this content in the original post

See this content in the original post

The main component of this tutorial is the 1.54 inch e-Paper display, which can be found in our store. We are using a specialized library designed by Waveshare with custom examples developed by our team to display text on this particular e-Paper display. Thus, we cannot guarantee that any of the examples provided here will work with other displays. Fortunately, any ATmega328P-based Arduino board can be used with the library (Uno, Nano, BLE-Nano, etc.). We’re also using a Raspberry Pi 4 Computer to interface with the Arduino board. The full list of parts to follow along with the tutorial is given below:

See this product in the original post

The wiring between the BLE-Nano (and any ATmega328P chip) and 1.54 inch e-Paper display is given below:

A wiring diagram directly between the e-Paper and BLE-Nano is given for additional reference:

For the example in this tutorial, we chose to use 3.3V as the supply voltage, however, 5V will suffice as well. The user may also find it useful for power consumption to wire the e-Paper power pin (VCC) to a digital pin on the Arduino and control the power from there. This would be useful for situations of very low power consumption, where the user does not need to update the display often. For the rest of the tutorial, 3.3V will be used to power the e-Paper display, which consumes about 3mA during idle periods.

See this content in the original post

See this content in the original post

The e-Paper library used here is based on the series of display libraries developed by Waveshare on GitHub. Users may find it helpful to check there for e-Paper displays outside of the 1.54 inch display used in this example. For reference, we are building upon the Waveshare 1.54 inch e-Paper display entitled epd1in54_V2. To follow along with this tutorial, click on the GitHub card below and get started with our library and examples:

The simplest way to test your e-Paper display is to run the example script entitled:

simple_text_display.ino

The code is also given below for reference:

See this content in the original post

This simple example will print out integer values starting with 0 and marching forward until the count overflows. We are also printing a header, defined by three different texts: “1.54in e-Paper,” “Simple Demo,” and “Maker Portal.”

The basic setup for the e-Paper library is as follows:

See this content in the original post

First, we instantiate the e-paper display (EPD) also known as the electrophoretic display. Then we assign a print function called ‘paint’ that uses the pre-allocated variable called ‘image.’ Next, we want to initialize, clear, and refresh the display using the following:

See this content in the original post

Finally, we are able to set the text to display using the following representations:

See this content in the original post

This series of commands prints values to the e-Paper display, particularly in the light background and dark foreground format. The function ‘DrawStringAt()’ defines the relative location, fontsize, and color (Black [colored] vs white [uncolored]). Next, the ‘SetFrameMemory()’ designates the location of the text within the entire e-Paper display, which is why we are using offset values based on the header and row height. There are many customizations that are possible with these variables and we are only showing a very brief example. In the next section we will explore a bit more on customizing the text display. The simple example given above should output text similar to that shown in the image below:

We can expect the simple example to iterate continually. This type of example can be extrapolated to increment as a clock or counter of a similar fashion. One example may be with an electronic label in a department store, or counter for counting customers in a store, or something similar with long-term operation and low refresh rate applications. In the next section, we will introduce Bluetooth capabilities and near real-time updating using an Android smartphone and the BLExAR app.


See this content in the original post

The following example requires the BLE-Nano board and BLExAR app (both the iOS and Android versions suffice). Thus, if the user does not have both of these - the following demonstration may not translate.

The Bluetooth demo for the BLE-Nano and 1.54 inch e-Paper display can be found at the GitHub page under the following example file:

simple_text_display.ino

The code is also given below for reference:

- BLExAR App -

See this content in the original post

Out of the box - the code above should print out the same three headers as the simple demo given in the previous section. Next, the BLE-Nano waits for the BLExAR app to send text and will print out the text as soon as it receives a newline character. The GIF below shows the user sending the text and the e-Paper updating accordingly:

Each time the text is sent to the Arduino board it sends the new text onto a new line. Thus, with the current setting, the display will refresh after 6 lines of new text, where the sixth line refreshes the display and prints to the first line. The refresh rate of the partial update in the Bluetooth case is roughly 1-2 seconds. Once the display gets the sixth line, it will take roughly 5-6 seconds to refresh the entire display and update with the new text. This is of course one downside to e-Paper display, but a well-established limitation.

A video demonstration of the Bluetooth-enabled e-Paper display is given below, showing the speed and update routine of the Arduino and Android communication:

See this content in the original post

See this content in the original post

e-Paper displays are great alternatives to LCDs and OLEDs due to their low power requirements between refreshes and their ability to maintain high contrast during sunlight - a common issue for backlit devices such as tablets and smartphones. In this tutorial, we introduced a 1.54 inch e-Paper module and wired it to a BLE-Nano Arduino board for SPI communication. The goal of the project was to send text from a smartphone device and display it in real time on the e-Paper display. We were able to achieve this by using a BLE-Nano board and the BLExAR smartphone app communicating via Bluetooth Low Energy (BLE). Two examples were given: the first displayed a simple iterator on the e-Paper module without Bluetooth; while the second example updated its display with the text sent by the smartphone. The possibilities of this e-Paper project are endless and have the potential for applications in electronic labeling in department stores, long-term status indicators, high-contrast electronic displays, and of course, electronic readers.

See this content in the original post

We focused on the implementation of the e-Paper in this tutorial. For more in-depth understanding of the technology and physics behind electronic paper displays, see the following resources:

- Heikenfeld, J., Drzaic, P., Yeo, J. S., & Koch, T. (2011). A critical review of the present and future prospects for electronic paper. Journal of the Society for Information Display, 19(2), 129-156.

- Kreit, E., Mäthger, L. M., Hanlon, R. T., Dennis, P. B., Naik, R. R., Forsythe, E., & Heikenfeld, J. (2013). Biological versus electronic adaptive coloration: how can one inform the other?. Journal of the Royal Society Interface, 10(78), 20120601.

- Kao, W. C. (2010). Electrophoretic display controller integrated with real-time halftoning and partial region update. Journal of display technology, 6(1), 36-44.

See this content in the original post