This post describes how to connect the 2.7″ ePaper display development module from Embedded Artists to the ESP8266. ePapers are very interesting in the IoT field since they only require power during the update. Depending on the type of display they can then maintain the image while the connect micro controller goes back to sleep.
Connecting this display required a bit of creative thinking. At first I thought that the ESP8266 wouldn’t have enough pins to connect the display. I decided to strip some aspects and I’m honestly not 100% sure what the side effects are. The board comes with a temperature sensor and I decided to set the temperature manually to save pins. This probably yields better quality for displayed pictures.
[the_ad_placement id=”inpostplacement”]
Another problem was to figure out how the pins on the connector were arranged. Here the following schematic helped:
So here is how you connect it:
ePaper Function | ePaper PIN | NodeMCU (Generic) | ESP Function |
---|---|---|---|
GND | 1 | GND | |
VCC | 2 | 3V3 | |
SCK | 3 | D5 (14) | CLK |
MOSI | 4 | D7 (13) | MOSI |
MISO | 5 | D6 (12) | MISO |
SSEL | 6 | D3 (0) | CS |
UART RX | 7 | ||
UART TX | 8 | D4 (2) | |
I2C SCL | 9 | ||
I2C SDA | 10 | ||
GPIO | 11 | ||
EPD Reset | 12 | D0 (16) | |
EPD Panel On | 13 | D2 (4) | |
EPD Discharge | 14 | D1 (5) |
When you have connected the display download this sample code:
https://github.com/squix78/ePaperDemo1
I adjusted my OLED library for the SSD1306 to the ePaper display. It has the advantage that you first create the content of the ePaper display in a buffer. When you are ready to write everything to the display call the appropriate method and the content of the buffer will be written to the display. The library currently supports the following function:
- Draw Text at a given location. Define text alignment and get information how much space the text will consume
- Create custom font files with http://oleddisplay.squix.ch/ and include them in your firmware
- Draw lines, circles, boxes and fill them
I hope to extract a library from it but until then just use the demo code to get started with your own project.
The temperature sensor on these displays is used to adjust the refresh times to improve the display clarity at low temperatures where it takes longer for the ePaper “particles” to find their new state. So it is reasonable to not use the sensor if the display’s operatine temperature range is not very large.
The correct pin-out allocation table is here:
http://i.imgur.com/j1zcgWI.png
Ideally the “busy line” ought to be connected as this is used by the driver functions.
I also see the PWM line is not connected, I am not sure what the implications of this is but that is typically used to generate bias voltages. It could be that function is not needed on the latest displays?
Confirmed, COG v2 displays do not need the PWM signal. So earleier generation EPaper displays may not work with this code.
how to rotate the character at any degree?