Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Reduce Ghosting on ESP32 E-Paper Displays

· 5 min read · Smart Home

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Ghosting and refresh artifacts are common on ESP32-driven e-paper displays, where faint remnants of previous images linger or dark flashes appear during updates. This guide explains how to reduce these effects through proper initialization, waveform selection, and update strategies. You'll need an ESP32 board, an e-paper display (e.g., 2.9" or 4.2" from common vendors), and the relevant driver library installed in your Arduino IDE or PlatformIO environment.

What You'll Need

  • ESP32 development board (e.g., DevKitC, NodeMCU-32S)
  • E-paper display module (compatible with your driver library)
  • Jumper wires or breadboard for connections
  • Arduino IDE or PlatformIO with the e-paper library installed (e.g., GxEPD2, Adafruit_EPD, or manufacturer library)
  • USB cable for programming and power

Step-by-Step

  1. Connect the display correctly. Wire the SPI pins (SCK, MOSI, CS, DC, RST, BUSY) to your ESP32 as per your library's pin definitions. Double-check that the display's VCC is 3.3V (not 5V) unless the module explicitly supports 5V.
  2. Initialize the display with the correct size and rotation. In your code, call the display's init() method with the width, height, and rotation that match your panel. Using the wrong dimensions can cause partial refreshes and artifacts.
  3. Use a full refresh (full update) for major changes. For initial drawing or when the content changes significantly, call display.display() (or fullRefresh() in some libraries) to perform a full screen update. This uses a waveform that clears the screen thoroughly, reducing ghosting from previous content.
  4. For partial updates, use the library's partial refresh mode. Many libraries support display.updateWindow() or display.refresh() after setting a partial region. This updates only the changed area, which reduces artifacts because the rest of the screen remains untouched.
  5. Clear the screen before drawing new content. If you're updating a region, first fill that region with white (or the background color) and call the partial update, then draw the new content and update again. This two-step process prevents ghosting from the old pixels.
  6. Choose a suitable waveform. Some libraries allow you to select a waveform (e.g., setWaveform()). For monochrome displays, a standard waveform works well; for grayscale, you may need a different one. Test the available options and pick the one that minimizes artifacts for your typical content.
  7. Add a cleanup routine before deep sleep or power-off. If your device sleeps, call display.hibernate() or display.sleep() after the update. This powers down the display properly, preventing residual charge that can cause artifacts on the next wake.
  8. Implement a periodic full refresh. Even if you use partial updates, schedule a full refresh every 10–20 updates (or after a few minutes). This clears any accumulated ghosting that partial updates cannot fully eliminate.
  9. Adjust timing if needed. Some displays require a delay between commands. If you see artifacts, increase the delay after init() or before the first refresh (e.g., delay(200)) to let the panel stabilize.
  10. Use the display's built-in temperature compensation if available. Some advanced libraries accept a temperature parameter for the waveform. If your environment varies, adjust it to reduce artifacts caused by temperature sensitivity.

Common Mistakes

  • Using partial updates for full-screen changes: This leaves old pixels visible because the waveform doesn't fully clear the screen.
  • Not clearing the region before redrawing: Overwriting text or graphics without first clearing the area often leaves ghost outlines.
  • Incorrect pin assignments: A wrong BUSY pin can cause the display to update prematurely, leading to artifacts.
  • Powering the display with 5V: Many e-paper modules are not 5V tolerant on the logic pins, causing erratic behavior and artifacts.
  • Skipping the hibernate call: Leaving the display powered on without sleep can cause charge buildup and ghosting on the next boot.

Tips

  • Test with a simple pattern: Draw a checkerboard or solid blocks to visually assess ghosting after each change.
  • Use a slower refresh speed if available: Some libraries let you set refresh speed; slower often reduces artifacts.
  • Keep the display away from strong light during updates: Ambient light can affect the optical response, making artifacts more visible.
  • Consider using a display with a built-in controller that handles waveforms automatically: Newer panels (like those with SSD1680) have better default waveforms.
  • Log the number of partial updates: Use a counter to trigger a full refresh after a threshold.

Troubleshooting

Ghosting persists even after a full refresh. Try calling display.clear() and then display.display() twice in a row. If that doesn't help, check your supply voltage—drops below 3.3V can cause incomplete updates.

Dark flashes during update. This is normal for some panels, but if it's excessive, ensure you're using a full refresh and not a partial one. Also, verify that the BUSY pin is correctly read; if the library polls it too early, the update may be cut short.

Artifacts only in one corner. This often indicates a loose connection or a damaged flex cable. Re-seat the display and check solder joints.

Display shows random noise after deep sleep. Add a display.init() call before any update after waking, and ensure you call hibernate() before sleeping.

Frequently Asked Questions

Q: Can I completely eliminate ghosting? A: No, e-paper technology inherently has some residual image due to the physical properties of the ink particles. You can minimize it, but not eliminate it entirely.

Q: How often should I do a full refresh? A: It depends on your content. For text or simple graphics, every 10–20 partial updates is a good balance. For images, you may need a full refresh every time.

Q: Does the refresh speed affect ghosting? A: Yes, slower refresh speeds generally produce cleaner images because the particles have more time to settle. If your library allows, reduce the refresh speed.

Q: Why does my display ghost more in cold temperatures? A: E-paper particles are less responsive in cold environments. If your library supports temperature compensation, use it, or warm the device slightly.

Q: Is it better to use a dedicated e-paper driver chip? A: Not necessarily. The ESP32 can drive most panels fine, but the waveform quality depends on the library. Using a well-maintained library like GxEPD2 often yields better results.

Q: Can I use partial updates for animations? A: Yes, but keep the number of updates low and insert a full refresh periodically. Rapid partial updates without cleanup will cause severe ghosting.