Difference between revisions of "2.13inch e-Paper Cloud Module"

From Waveshare Wiki
Jump to: navigation, search
Line 29: Line 29:
 
<div class="tabbertab" title="Resources">
 
<div class="tabbertab" title="Resources">
  
 +
=Resource=
 
==Document==
 
==Document==
 
*[https://www.waveshare.com/w/upload/3/31/2.13inch_e-Paper_Cloud_Module_Sch.pdf 2.13inch_e-Paper_Cloud_Module Schematic]
 
*[https://www.waveshare.com/w/upload/3/31/2.13inch_e-Paper_Cloud_Module_Sch.pdf 2.13inch_e-Paper_Cloud_Module Schematic]
 
*[https://{{SERVERNAME}}/w/upload/d/d5/2.13inch_e-Paper_Specification.pdf 2.13inch e-Paper V2 Specification ]
 
*[https://{{SERVERNAME}}/w/upload/d/d5/2.13inch_e-Paper_Specification.pdf 2.13inch e-Paper V2 Specification ]
 +
 
==Demo codes==
 
==Demo codes==
 
*[https://{{SERVERNAME}}/w/upload/5/50/E-Paper_ESP32_Driver_Board_Code.7z  ESP32 Examples]<br>
 
*[https://{{SERVERNAME}}/w/upload/5/50/E-Paper_ESP32_Driver_Board_Code.7z  ESP32 Examples]<br>

Revision as of 02:51, 18 May 2022

2.13inch e-Paper Cloud Module
2.13inch e-Paper Cloud Module

Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

This is a 2.13inch e-Paper cloud module, 250 × 122 Pixels, WiFi connectivity, use ESP32 as a controller.

Introduction

  • The wireless network driver board is designed for 2.13inch e-Paper.
  • It has a battery interface and can supply power by battery.
  • It uses the Type-C interface to keep up with social trends.
  • It supports Arduino development, you can use me like any other Arduino board.
  • It can get picture information from a PC or smartphone via WiFi or Bluetooth, and display the information through an E-ink screen.

Features

  • Incorporates ESP32, and supports Arduino development.
  • No backlight, keeps displaying last content for a long time even when power down.
  • Voltage detection circuit for preventing the battery from over-discharging.
  • Features battery connector and recharge circuit, allows off-line running.
  • Provides Android APP for refreshing the module via Bluetooth EDR, easy to use.
  • Provides HTML host computer code for refreshing the module via the remote webpage, easy to be integrated into sorts of Internet applications.
  • Supports Floyd-Steinberg dithering algorithm, more color combinations, and better shadow rendering for the original image.
  • Supports popular image formats: BMP, JPEG, GIF, PNG, etc.
  • Delivered with embedded e-Paper driver (open source).

Specifications

  • WiFi Standard: 802.11b/g/n
  • Interface: SPI
  • Bluetooth: 4.2 (BR/EDR/BLE included)
  • Communication interface: 3-wire SPI、4-wire SPI (default)
  • Power supply: Battery
  • Charge current: 1A
  • Outline Dimensions: 71mm × 30.2mm
  • Display Dimensions: 48.55mm × 23.7mm
  • Dot pitch: 0.194 × 0.194mm
  • Resolution: 250*122
  • Display color: Black, white
  • Grey level: 2
  • Partial refresh time: 0.3s
  • Full refresh time: 2s

【Note】:
Refresh time: The data provided is experimental data, the actual time may be a little different. It is normal that the e-Paper blink when fully updating.
Power: The power data is experimental data.

Application

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

  • Electronic name card
  • Device label
  • Shelf label
  • Information storage
  • Serial information display board, etc.

Pinout

PIN (e-Paper) ESP32 Description
VCC VCC Power input (3.3V)
GND GND GND
KEY 12 User button
SCK 13 CLK pin of SPI, clock input
DIN 14 MOSI pin of SPI, data input
CS 15 Chip select pin of SPI, Low active
BUSY 25 Busy pin, indicates whether the e-Paper is busy
RST 26 Reset pin, Low active
DC 27 Data/Command control pin, Low for Command and High for Data
ADC 36 ADC data input, the voltage detected is 1/3 of the battery voltage.

PS: The pins described above were connected by default, you need to operate them.

Preparation

Hardware Connection

  • Use a Type-C cable to connect the ESP32 driver board to the computer

Hardware Connectionesp32.png

Download examples

Three examples were provided for the display, Blutooth, WiFi example and the offline example. You can find the archive in Resources tabber. Or directly download the link here to download
Unzip the arvhive and you will get the following examples:
Epd esp32 download 1.png

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

Environment Debugging

  • If the Arduino IDE is not installed on your computer before, or the version of the IDE is older. It is recommended to go to the Arduino official website to download the latest IDE and install it according to your own system. Link:https://www.arduino.cc/en/Main/Software

Download ESP32 Dev Module Development Board Tools Management

  • Open the IDE and choose File->Preferences and add the link to the Additional Boards Manager URLs box:
https://dl.espressif.com/dl/package_esp32_index.json

Epd esp8266101.png

  • Open Tools -> Boards -> Boards Manager, find the "ESP32", and install the latest version.

ESP32.png

  • After installing, you can find the ESP32 Dev Module option in Tools - Boards of Arduino IDE Menu.

ESP32-33.png

  • If the installation cannot be completed due to repeated errors, please contact the after-sales technicians.

Image Process Algorithm

In the Bluetooth example and the WiFi example, we use two kinds of Image algorithms, Level and Dithering.

Level

An image can be divided into several large color gamuts. Each pixel on the image is classified into the corresponding color gamuts according to how close the color is to these color gamuts. This method is more suitable for images that have few colors, such as bright or three-color shapes or text images. Take the black, white and red ink screen as an example. When processing the image, we hope to process it into black, white, and red. Therefore, for an image, we can divide all the colors of the image into three color areas: black area, white area, and red area.
For example, according to the figure below, if the value of a certain pixel in the grayscale image is equal to or less than 127, we regard this pixel as a black pixel, otherwise, it is white
Epd esp32 lever 1.png
As we know, color images have three color channels called RGB. Compared with the red channel, we can collectively call blue and green the blue-green channel or the non-red channel. According to the figure below, if a pixel on a color image has a high red channel value but a low blue-green channel value, we classify it as a red pixel; if the value of both the red and blue-green channels are very low, we classify it as a black pixel; if the values of the red and blue-green channels are both high, we classify it as white.
Epd esp32 lever 2.png
In the algorithm, the color definition is calculated based on the difference between the RGB value and the sum of 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.
Epd esp32 lever 3.png

Dithering

For images with more colors or more gradient areas, the above color scale 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 Level method, the image will lose a lot of image details. Many pictures taken by cameras use the method of mixing colors to draw shadows and transition areas. In these images, the gradual area accounts for most of them.
For the human eye, it is easy to confuse very small colors. For example, set two colors red and blue side by side, if it is reduced to a small enough size, it will become a mixture color of red and blue to the human eye. 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 Floyd-Steinberg algorithm is based on the error diffusion method(published by Robert Floy and Louis Steinberg in 1976). The formula is based on the error diffusion of the image below
Epd esp32 dithering 1.png
X is the error (a scalar (vector) difference between the original color and the gray-scale value (the color value)), and the error spreads to the right, bottom right, bottom, and bottom left, adding weights of 7/16, 1/16, 5/16, and 3/16, respectively, to the values of the four pixels. If you are interested in the algorithm, you can search online for more resources

Expected result of two methods

Original picture

Epd esp32 compare 1.png

"Black/White-Level" and "Colors-Level"

Epd esp32 compare 2.png Epd esp32 compare 2-2.png

"Black/White-Dithering" and "Colors-Ditherring"

Epd esp32 compare 3.png Epd esp32 compare 3-2.png

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 image to 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 is the beginning position on the image. For example, if you select an image with 800x480 resolution, and the display you connect is the 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 choose.

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 processed.
    • 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.

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.

FAQ

Question about Software

 Answer:
*Our demo uses stm32f103zet6. If the customer modifies other models in MDK, such as stm32f103rbt6, the ram space becomes smaller, and the stack size and heap size in the startup file need to be modified on the original basis.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
*Install the imaging library using the command sudo apt-get install python-imaging
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
If it is a three-color screen, when you need to transmit B/W data, use Data Start Transmission 1, when transmitting RED data, use Data Start Transmission 2, because the 2.13inch e-Paper HAT (D) can only display black and white, Therefore, when working in KW mode Data Start Transmission 1, the last data is sent, that is, the so-called old, and 0x00 is directly sent in the program. When Data Start Transmission 2, the data that needs to be refreshed, the so-called "NEW" is sent. data.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The Chinese character library of our demos uses GB2312 encoding method, please change your xxx_test.c file to GB2312 encoding format, compile and download it, and it will display normally
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
You can adjust the value of Vcom in the program to change the display contrast, and the screen improvement effect with local brushing is particularly obvious.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The border display color can be set through the Border Waveform Control register or the VCOM AND DATA INTERVAL SETTING register.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
In this case, the customer needs to reduce the position of the round brush and clear the screen after 5 rounds of brushing (increasing the voltage of VCOM can improve the color, but it will increase the afterimage).
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The process of re-awakening the e-ink screen is actually the process of re-powering on the power. Therefore, when the EPD wakes up, it must first clear the screen, so as to avoid the afterimage phenomenon to the greatest extent.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
*It may be caused by the unsuccessful spi driver.

1. First check whether the wiring is correct.
2. Check whether the spi is turned on and whether the parameters are configured correctly (spi baud rate, spi mode and other parameters).

{{{3}}}
{{{4}}}

{{{5}}}


Question about Hardware

 Answer:
Yes, now there is a level conversion chip onboard, supporting 3.3V drive.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The rated input voltage of the ink screen is 2.3~3.6V. If it is a 5V system, level conversion is required. In addition, the voltage should not be lower than 2.5V, so as not to affect the display effect of the ink screen.

Device selection can use the model in the schematic diagram we provide or choose according to the data sheet.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Yes, pay attention to the correct timing.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Check if SPI communication is normal.

Confirm whether the BUSY pin is normally initialized to input mode.
It may be that there is no normal reset, try to shorten the duration of the low level during reset (because the power-off switch is added to the drive circuit, the reset low level is too long, which will cause the drive board to power off and cause the reset to fail). If the busy function sends the 0x71 command, you can try to comment it out.

{{{3}}}
{{{4}}}

{{{5}}}


Question about Screen

 Answer:
*【Working conditions】Temperature range: 0~50°C; Humidity range: 35%~65%RH.
  • 【Storage conditions】: Temperature range: below 30°C; Humidity range: below 55%RH; Maximum storage time: 6 months.
  • 【Transportation conditions】: Temperature range: -25~70°C; Maximum transportation time: 10 days.
  • 【After unpacking】: Temperature range: 20°C±5°C; Humidity range: 50±5%RH; Maximum storage time: Assemble within 72 hours.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
*refresh mode
    • Full brush: The electronic ink screen will flicker several times during the refresh process (the number of flickers depends on the refresh time), and the flicker is to remove the afterimage to achieve the best display effect.
    • Bureau brush: The electronic ink screen has no flickering effect during the refresh process. Users who use the partial brushing function note that after refreshing several times, a full brush operation should be performed to remove the residual image, otherwise the residual image problem will become more and more serious, or even damage the screen (currently only some black and white e-ink screens support partial brushing, please refer to product page description).
    • refresh rate
    • During use, it is recommended that customers set the refresh interval of the e-ink screen to at least 180 seconds (except products that support the local brush function).
    • During the standby process (that is, after the refresh operation), it is recommended that the customer set the e-ink screen to sleep mode, or power off operation (the power supply part of the ink screen can be disconnected with an analog switch) to reduce power consumption and prolong the life of the e-ink screen. (If some e-ink screens are powered on for a long time, the screen will be damaged beyond repair.)
    • During the use of the three-color e-ink screen, it is recommended that customers update the display screen at least once every 24 hours (if the screen remains the same screen for a long time, the screen burn will be difficult to repair).
  • Application
    • The e-ink screen is recommended for indoor use. If it is used outdoors, it is necessary to avoid direct sunlight on the e-ink screen, and at the same time, take UV protection measures, because charged particles will dry out under strong light for a long time, resulting in loss of activity and failure to refresh. This situation is irreversible. When designing e-ink screen products, customers should pay attention to determining whether the use environment meets the requirements of e-ink screen.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Ideally, with normal use, it can be refreshed 1,000,000 times (1 million times).
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Power on the development board for a long time, after each refresh operation, it is recommended to set the screen to sleep mode or directly power off processing, otherwise the screen may burn out when the screen is in a high voltage state for a long time.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Yes, but you need to re-initialize the electronic paper with software.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Maybe the SPI rate is too high, resulting in data loss, try to reduce the SPI rate.

Insufficient or unstable power supply leads to data loss.
The data cable is too long to cause data loss, the extension cable should not exceed 20cm.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The display gray scale of electrophoretic electronic paper is determined by the spatial position of the particles in the microcapsule or microcup. The electrophoresis phenomenon occurs between black particles and white particles under the action of voltage. This voltage sequence that promotes the electrophoretic movement of the particles is the driving force of the electronic paper. waveform. The driving waveform is the core part of the electronic paper display, and the optimization of the driving waveform will directly affect the display effect of the display. The driving waveform file is used to describe the parameters formed by the voltage sequence that promotes the electrophoretic movement of the particles, and it needs to be called regularly when the electronic paper is refreshed.

Different batches of e-paper diaphragms and electrophoretic matrices require different voltage values ​​when driving the display due to materials, manufacturing processes, etc. The waveform of the e-ink screen is reflected in the relationship between grayscale, voltage and temperature. Generally speaking, after each batch of electrophoresis matrix is ​​generated, there will be a corresponding waveform file in the form of a .wbf file. The film manufacturer will provide the waveform file and electrophoresis matrix to the manufacturer of the electronic paper screen, and then the The manufacturer of electronic paper screen integrates the protection board, substrate and driver and then provides it to customers; if the waveform file does not correspond to the screen, it is likely that the display cannot be displayed or the display effect is unsatisfactory. Generally, the waveform file has OTP built into the driver IC of the ink screen when leaving the factory, and some programs we provide also call external waveform files to drive the e-ink screen.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
LUT is the abbreviation of LOOK UP TABLE, and OTP is the abbreviation of ONE TIME PROGRAM. The original intention of LUT is to load waveform files, and the waveform files are divided into OTP and REGISTER. Among them, OTP is the built-in waveform storage method, and REGISTER is the external waveform storage method.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
There are mainly two types of ink screens.

One is to brush the background image first.
The other is to alternately refresh old data and new data.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Simultaneous brushing in different locations needs to be operated in the program design, that is, first brushing the data of different locations into the electronic paper IC, and finally doing the Update/TurnOnDisplay uniformly.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Yes, when e-Paper is batched, there will be some color difference, which is a normal phenomenon. Store the e-paper faces up to reduce the reddish/yellowishness to a certain extent.
{{{3}}}
{{{4}}}

{{{5}}}


Others

 Answer:
with film.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
0.5mm pitch, 24Pin.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
Cable socket 0.5-24pin rear flip type 2.0H (FPC connector).
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
At present, all screens have built-in temperature sensors, and external LM75 temperature sensors can also be used with IIC pins.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The full brush initialization function needs to be added when the ink screen is switched from partial brush to full brush.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
It may be a demo based on the BCM2835 library that has run the C language before. At this time, you need to restart the Raspberry Pi and then run the python demo.
{{{3}}}
{{{4}}}

{{{5}}}


Support

Support

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