The New York Times on epaper, every morning.
By: Pascal Boudalier
Tags: Micropython, Raspberry Pi, E Paper, NYTimes, E Ink

It all started with My Love sending me a Medium article.

She is half French and half American (not sure which half is bigger), and an avid reader of the New York Times. This article caught her eyes.

I went thru this article , and this other one titled “ This Super-Clean Smart Screen Puts a Newspaper on Your Wall“ and was intrigued by the application, and seduced by the concept behind it : Calm technology.

Both articles are about displaying, every morning, the front page of the New York Times (NYT) on a large e-paper display hanging on the wall.

Calm technology is a concept of a passive device, with no configuration, no user interface, that just sits there, doing one thing.

So I decided to reproduce this application, for my half American:

A newspaper on E-paper.

E-paper, aka Eink, is a display technology fundamentally different from LCD or OLED. Instead of emitting light it just reflects ambient light. Exactly like paper. Typically, it comes in black and white or in a few colours. It is very slowwww to refresh (think seconds , not milli seconds). However, the big advantage is the display staying on, even when the power is off. An unplugged e-panel keeps displaying the last frame. The first time I saw one, it looked like magic to me.

Consequently, it is a good match for displaying information that does not change too often.

However, I quickly noticed that those two Medium articles were using sleek, large (32inch) but quite pricy e-paper displays, in a $1500-$2500 range. I wanted to start smaller.

Also, as there was no code published, I had to start from scratch. Good challenge.

Project’s components

Without too much thought, I decided to use an ESP32 as the core of my project. ESP32 is a 32-bit microcontroller with integrated WIFI. It supports Python (aka micropython), which is my preferred programming language. As actually, somewhere on my desk I already had an ESP32 board with built-in epaper interface which had never been put to use.

This choice had serious consequences, which I will describe later. But at the end it worked.

I ordered a 7.5 inch, 800x480, black and white epaper display. It is affordable ($50), suitable for prototyping and it connects directly to the ESP32 board.

The overall flow of the application (available on github) is:

Grab the PDF of the daily NYT front page using HTTP Convert the PDF into a python image Crop, resize, rotate, ie adapt to the e-paper screen geometry Convert image into portable bitmap Store portable bitmap into the ESP32 flash memory Convert bitmap into a frame buffer Render the frame buffer on e-paper display

Portable Bit Map (pbm) is a way to … well ..to store bitmaps in a portable way. In this project, I’m using the P4 format, which is simply black and white (as opposed to grey scale or colours).

Framebuffer is a micropython object used to store bitmaps ready to be rendered on displays.

I quickly realised that micropython would not have the libraries needed to support step 2, 3 and 4.

No problem. I split the application in two, and run steps 1 to 4 on a Raspberry PI (running Linux), and steps 5 to 7 on the ESP32. Both sides are written in python and the ESP32 grabs the pbm file from the PI’s web server thru HTTP.

So in essence, the PI does all the NTY specifics, and the ESP32 just renders whatever bitmap it is given.

The PI’s script is starting once a day by cron. In my case (I’m in the French Alps), it starts at 7pm CET.

The ESP32 script starts when the board is powered on. It then connects to WIFI, grabs the pbm file using HTTP GET, creates the framebuffer, renders it on the epaper display, and then ….go to deep sleep for 24 hours. Then it will wakeup and restart.

Deep sleep is a state in which the ESP32 consumes very little power. Combined with the e-paper capability to retain display without power, it allows low power design, and ergo battery operated.

The ESP32 python script runs for about 40 sec every day and some initial measurements indicate the system consumes about 10ma while in deep sleep.

In addition to have to split the application in two parts, I also got several other blocks on the road:

The ESP32 I am using features 512K of RAM only. This may seems a lot in microcontroller land, but a big chunk is used by micropython itself. In addition, I had to manage contiguous buffer of 48000 bytes (800x480/8). So I had to do some juggling there. At the end it worked, but an ESP with more RAM (ie with additional PSRAM) would have been easier. Note that it’s also possible to drive the e-paper from a Raspberry PI. But I wanted to use a microcontroller for low power reasons.

I got the micropython driver for the e-paper display from the wonderful work of Mike Hauser. But I could never get the 7.5 inch driver to work. I guess it has to do with the fact that it is designed for the version 1 of the 7.5 display but I am using the newer version 2. So I fell back on using the driver for the 4.2 inch display and adjusted the screen geometry.

The modified driver is also on github

I am not entirely satisfied with the deep sleep consumption. I expected it to be lower, but I suppose that even if the ESP32 chip itself is in deep sleep, some components on the ESP32 e-paper board are still sucking power.

However, with a 10ma consumption and a 5000mah Lipo battery, this configuration can still run for about 20 days.

I am currently powering the project with a 18650 Lipo battery and this battery holder board which can be used to charge and use the Lipo at the same time. To know more about this board, I advice you to look at this excellent video from Andreas Spiess, a guy with a Swiss accent.

If you don’t need portability, you can permanently connect the 18650 board to a USB power plug.

As usual with electronic projects, the hardest part was the mechanical one. With the help of my teammate, some woodwork and glue, I created a 2€ stand.

Finally, the introduction photo has nothing to do with this project. It’s just my garden the day I wrote this article. But this photo also tells me I should think about building what a lot of people are doing with e-paper. A weather station.