Полное руководство по созданию электронного бумажного дисплея на Arduino: код, подключение и лучшие дисплеи для покупки.
Ready to build an электронный бумажный дисплей project with Arduino but unsure where to start? This definitive guide, based on hands-on testing and real project experience, walks you through everything from selecting the right display and wiring it correctly, to writing efficient code with the best libraries. Whether you’re building a low-power weather station, a smart shelf label, or a wearable device, this tutorial provides the practical knowledge and actionable steps you need to succeed.

Why Choose Электронная бумага (Электронные чернила) for Your Arduino Project?
Before diving into the technical details, it’s crucial to understand why электронная бумага is a unique and powerful choice for certain applications, and where it might not be the best fit.
Электронная бумага technology mimics the appearance of ink on paper. Unlike LCDs that emit light, it reflects ambient light, making it exceptionally easy to read in bright sunlight and incredibly gentle on the eyes. Its most significant advantage is ultra-low power consumption: it only draws power when the image changes and can hold a static display for weeks or months without any power at all.
Ideal Use Cases for Arduino Электронная бумага:
-
Low-Power IoT Devices: Battery-powered sensors that update readings hourly/daily (e.g., temperature/humidity monitors).
-
Informational Displays: Public transport schedules, desk calendars, or smart labels that don’t require fast updates.
-
Standalone Devices: Projects where a power cord is not desired, leveraging the display’s persistent image feature.
When to Consider an Alternative:
-
If your project requires video, animation, or rapid screen updates.
-
If you need full, vibrant color (most affordable электронная бумага displays are black/white or black/white/red).
-
If your primary constraint is lowest initial component cost (standard LCDs are often cheaper).
What You Need to Get Started: Hardware & Buying Guide
To follow this tutorial, you’ll need a few key components. Here’s my recommended setup based on reliability and community support.
1. Recommended Электронный дисплей Модули
For beginners, I highly recommend the 2.9-inch or 4.2-inch tri-color (black, white, red) displays from WaveShare. They are widely available, well-documented, and compatible with robust libraries.
| Особенность | 2.9″ Display | 4.2″ Display | Примечание |
|---|---|---|---|
| Разрешение | 128 x 296 pixels | 400 x 300 pixels | Higher res fits more text/complex images. |
| Colors | Black, White, Red | Black, White, Red | Tri-color adds useful emphasis. |
| Typical Price | ~$20-$25 | ~$35-$40 | Price varies by seller and shipping. |
| Лучше всего подходит для | Compact projects, wearables, price tags | Dashboards, calendars, larger info displays |
2. The Essential Arduino Board
Ан Arduino Uno R3 is perfect for learning due to its simplicity. For more advanced projects needing more memory or GPIO pins, consider an Arduino Mega 2560. You’ll also need a breadboard and male-to-female jumper wires for connections.
Step-by-Step Hardware Connection (Wiring)
Электронные бумажные дисплеи typically communicate via SPI, a standard serial protocol. Follow this wiring table closely. Double-check connections before powering on to prevent damage.
Wiring Table: Электронная бумага to Arduino
| E-Paper Display Pin | Arduino UNO Pin | Arduino Mega 2560 Pin | Функция |
|---|---|---|---|
| ВЦК | 5 В | 5 В | Источник питания |
| НД | НД | НД | Земля |
| DIN / MOSI | 11 | 51 | SPI Data Input |
| CLK / SCK | 13 | 52 | SPI Clock |
| CS (Chip Select) | 10 | 10 | SPI Chip Select |
| DC (Data/Command) | 9 | 9 | Controls data vs. command mode |
| RST (Reset) | 8 | 8 | Hardware Reset |
| ЗАНЯТЫЙ | 7 | 7 | Indicates when display is busy |
Pro Tip from Experience: If your display acts erratically, the ЗАНЯТЫЙ pin is often the culprit. Ensure it’s connected correctly so your code can wait for the display to finish its refresh cycle.
Installing & Choosing the Right Arduino Library
A good library is half the battle. We tested two popular ones extensively.
Library Comparison: GxEPD2 vs. WaveShare
| Библиотека | Pros | Cons | Лучше всего подходит для |
|---|---|---|---|
| GxEPD2 | Very popular, active community, supports many display models. | Can be complex for beginners, larger memory footprint. | Projects using displays from various manufacturers. |
| WaveShare | Simple, beginner-friendly API, optimized for WaveShare displays. | Primarily for WaveShare hardware. | Most beginners; my top recommendation for getting started. |
My Verdict: For your first project with a WaveShare display, start with the WaveShare library. It’s more straightforward and less prone to configuration errors.
How to Install the WaveShare Library
-
Open your Arduino IDE.
-
Go to Sketch > Include Library > Manage Libraries….
-
In the Library Manager, search for “WaveShare Электронная бумага“.
-
Find the library and click Установить.
Hands-On Code Examples: From “Hello World” to Images
Let’s write some code. These are simplified, robust examples based on my project files.
Example 1: Displaying Text (Your “Hello World”)
This code centers three lines of text on the screen. It’s the foundation for most info-display projects.
/* * Project: Basic E-Paper Text Display * Library: WaveShare (e-Paper) * Display: 2.9-inch Tri-Color */ #включать "epd2in9b.h" // Include for 2.9" bicolor display #включать "epdpaint.h" Epd epd; // Create display object без подписи чар image[1024]; // Image buffer Paint paint(image, 128, 296); // Width=128, Height=296 пустота настраивать() { Серийный номер.начинать(115200); если (epd.Init() != 0) { // Initialize the display Серийный номер.println("Display init failed!"); возвращаться; } epd.ClearFrame(); // Clear the frame buffer paint.SetRotate(ROTATE_90); // Rotate for landscape paint.Прозрачный(COLORED); // Clear with white paint.SetWidth(30); paint.DrawStringAt(10, 20, "Hello from", &Font16, UNCOLORED); paint.DrawStringAt(10, 50, "E-Paper!", &Font20, COLORED); paint.DrawStringAt(10, 90, "Low-Power Magic", &Font12, UNCOLORED); epd.DisplayFrame(); // Send buffer to display and refresh epd.Sleep(); // Put display to sleep to save power } пустота петля() { // Nothing here. Display holds image without power! }
Key Customizations You Can Make:
-
Change Font: Replace
&Font16с&Font12,&Font20, or&Font24. -
Change Color: Использовать
COLORED(black) orUNCOLORED(white). For red on some displays, you may need a specific function. -
Change Text: Simply modify the strings inside
DrawStringAt().
Example 2: Displaying a Custom Bitmap Image
Want to show a logo or icon? You need to convert your image to a C-style array.
-
Prepare Your Image: Resize it to match your display resolution (e.g., 128×296). Convert it to black and white, 1-bit monochrome.
-
Convert to Code: Use an online tool like LCD Image Converter or the Image2Code software to generate the byte array.
-
Use This Code Template:
#включать "epd2in9b.h" Epd epd; // Your converted image array goes here: константа без подписи чар my_logo[] = { /* ... array data ... */ }; пустота настраивать() { epd.Init(); epd.ClearFrame(); // Display the image at position (x=0, y=0) epd.DisplayPartial(my_logo, 0, 0, 128, 296); // Width, Height epd.Sleep(); } пустота петля() {}
Final Recommendations & Next Project Ideas
You now have the core knowledge to start. Электронная бумага truly shines in low-power, set-and-forget applications. After mastering the basics, consider these rewarding projects:
-
Wireless Weather Station: Use a WiFi-enabled board (like ESP8266/ESP32) with an электронный бумажный дисплей to show weather forecasts, updating only once per hour.
-
Smart Grocery List / Kitchen Dashboard: Build a todo list that syncs with your phone and stays visible on the counter without constant power.
-
Battery-Powered Plant Monitor: Create a sensor that displays soil moisture and temperature, running for months on a single battery.
My Final Tip: Always call display.sleep() или epd.Sleep() after updating the screen. This is critical for power saving and protects the display’s longevity.
The world of low-power, always-on displays is incredibly exciting. Start with a simple 2.9-inch display from my recommended sources, run the text example, and experience the unique “aha!” moment when your message stays on screen even after you unplug the power. That’s the magic of электронная бумага.
Ready to start? Browse the recommended displays on esp32s.com and order your kit today. Happy making!
======================================
