Free wiring guides
Wire the 4.2 in e-paper screen to the ESP32-C3
E-paper screen, 4.2 in, 400×300, SPI. Paper-like screen that keeps its picture with no power.
When buying: E-paper panels differ by revision. The sketch names the driver class: match it to the one printed on your panel's ribbon.
Which pin goes where
| On the part | On the ESP32-C3 |
|---|---|
| VCC | 3V3 |
| GND | GND |
| DIN | GPIO 6 |
| CLK | GPIO 4 |
| CS | GPIO 7 |
| DC | GPIO 1 |
| RST | GPIO 0 |
| BUSY | GPIO 3 |
Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.
In 3D
Example sketch
// E-paper screen, 4.2 in, 400×300, SPI
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/e-paper-4-2-inch-esp32-c3
#include <SPI.h>
#include <GxEPD2_BW.h>
#include <Fonts/FreeSansBold24pt7b.h>
const int PIN_DIN = 6;
const int PIN_CLK = 4;
const int PIN_CS = 7;
const int PIN_DC = 1;
const int PIN_RST = 0;
const int PIN_BUSY = 3;
// The driver class must match your panel: see the GxEPD2 examples for the list.
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> paper(GxEPD2_420_GDEY042T81(PIN_CS, PIN_DC, PIN_RST, PIN_BUSY));
void setup() {
SPI.begin(PIN_CLK, -1, PIN_DIN, PIN_CS);
paper.init(115200, true, 2, false);
paper.setFullWindow();
paper.firstPage();
do {
paper.fillScreen(GxEPD_WHITE);
paper.setTextColor(GxEPD_BLACK);
paper.setFont(&FreeSansBold24pt7b);
paper.setCursor(40, 160);
paper.print("It works");
} while (paper.nextPage());
paper.hibernate();
}
void loop() {
delay(1000);
}
- Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
- GxEPD2: install it from Sketch > Include Library > Manage Libraries.
This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.
What you should see
After a few seconds of flickering, the panel shows “It works” and keeps it with the power off.
If it does not work
- The e-paper never changes.
- BUSY must be wired: the sketch waits on it. Then check the driver class in the sketch matches your panel.
More parts on the ESP32-C3
- ST7789 1.54 in TFT screenESP32-C3 · 7 wires
- ST7789 2.0 in TFT screenESP32-C3 · 7 wires
- GC9A01 round screenESP32-C3 · 7 wires
- SSD1306 OLED 0.96 in screenESP32-C3 · 4 wires
- SSD1306 OLED 0.91 in screenESP32-C3 · 4 wires
- TTP223 touch sensorESP32-C3 · 3 wires
- Push buttonESP32-C3 · 2 wires
- Foot switchESP32-C3 · 2 wires
- Slide switchESP32-C3 · 2 wires
- SW-520D tilt switchESP32-C3 · 2 wires
- MC-38 door switchESP32-C3 · 2 wires
- AM312 PIR motion sensorESP32-C3 · 3 wires
- HC-SR04 ultrasonic sensorESP32-C3 · 4 wires
- Capacitive soil moisture sensorESP32-C3 · 3 wires
- BME280 sensorESP32-C3 · 4 wires
- MLX90614 infrared thermometerESP32-C3 · 4 wires
- SGP30 air quality sensorESP32-C3 · 4 wires
- HX711 load cellESP32-C3 · 4 wires
- KY-040 rotary encoderESP32-C3 · 5 wires
- 3×4 keypadESP32-C3 · 7 wires
- Passive buzzerESP32-C3 · 2 wires
- WS2812 LED ringESP32-C3 · 3 wires
- WS2812 LED stickESP32-C3 · 3 wires
- WS2812B LED stripESP32-C3 · 3 wires
- KY-016 RGB LEDESP32-C3 · 4 wires
- 2-channel relay moduleESP32-C3 · 4 wires
- 28BYJ-48 stepper motor (ULN2003)ESP32-C3 · 6 wires
- MAX98357A I2S amplifierESP32-C3 · 5 wires
- SX1262 LoRa module (Ra-01SH)ESP32-C3 · 9 wires