Introduction: E-Ink Display Mug
This is one of those crazy ideas that just spontaneously lodge in my brain. I thought, wouldn't it be awesome if there was a coffee mug that you could customize on the fly? One that looked pretty much like an ordinary coffee cup. I did a search and found only one example of something similar, but it did not look like normal coffee cup and the display was flat.
The remarkable thing about e-ink / e-paper displays is that they can be flexible, as well as not requiring power to maintain an image. e-ink displays are mostly seen in ebook readers, but I thought why not make a cup with a display that curves to the cup? I found an inexpensive e-ink display that would fit the bill (in fact the only flexible one that I could find for purchase by a mere mortal) and so I set out to build my vision.
Step 1: Parts
The parts breakdown is pretty straight forward. The waveshare flexible e-ink display is the only one I could find, and its available easily on ebay or aliexpress. I chose an ESP32 Lolin Lite for the microcontroller because it was inexpensive (pretty sure the one I got was a clone) but had Bluetooth LE as well as a LiPo battery charger and enough storage for fonts and bitmaps for the display.
The only hard to find item was a suitable cup to fit the electronics into. I couldn't really find anything. Originally, I had planned to use a ceramic "I am not a paper cup" cup, and bend an acrylic sheet around it. Since the cup is tapered and the acrylic sheet tube would be straight, there would be enough space near the bottom to fit the parts. I didn't have much luck with the acrylic bending though.
Then I remembered years ago my kids made custom mugs with a store bought kit. I went looking for that and found places that used to sell them no longer did, until I found that Hobby Lobby still sold them. They are cheap, in every way. But for under $1 it worked perfectly, having just enough space to snugly fit all the parts inside.
Waveshare 2.13" flexible e-ink display with HAT
150 mAh Lipo battery with JST connector
Cardboard
Tape
Printed paper insert (see attached SVG file)
Foam cup
Step 2: Paper Insert and Cardboard Base
Because the cup is clear and you don't want to see the electronics, print out the insert and carefully cut it with a razor blade or scissors. Because the e-ink display isn't paper white, the insert has a light gray pattern on it that pretty closely matches the background color of the e-ink display. Cut out the rectangle for the display to show through. Put the insert into the cup to make sure it fits, and decide what side of the cup you want the display on.
Also on this sheet is a circle pattern that you can use to cut a cardboard base. I used a very thin corrugated cardboard from a small box.
This cardboard disk with serve to mount the electronics to, and to hold the paper insert against the cup at the bottom.
Attachments
Step 3: Mount Electronics to Base
I soldered right angle headers to the ESP32 and only to the pins I needed. Specifically this would leave space on one side for the small LiPo battery. Connect the wires from the harness provided with the e-ink display hat as shown. Then, with the ESP32 centered and positioned with the USP and battery connector as close to the edge as you can get, press down so the header pins puncture the top of the cardboard.
Plug in the JST battery connector and use some double sided tape to stick the battery down next to the ESP32. Be careful not to put too much pressure on the battery as they are delicate.
Plug the wire harness into the e-ink driver hat, and try to curve the wires around the female header strip and across the top of the board. Secure it with some tape. Make sure the ribbon cable is connected, and place the hat over the ESP32 as far back as it will go without going over the edge of the cardboard circle, and guide the wire harness behind the JST battery connector and USB port. Secure with more tape.
This is kinda tricky but the wires pretty much go where they need to go, and it all fits together pretty snugly.
Step 4: Charge Port
You're going to want to be able to charge your cup and also program it, so you need to place the cardboard electronics assembly into the cup and note where the USB port is. Mark a square big enough for your cable to fit through (I put it near the base of the handle so it would be less visible when holding the cup), and then cut out a hole. I used a 3/16" drill on both sides and then cut the rest out with an x-acto blade.
Place the assembly in the cup again and test that your cable can fit through and connect.
Step 5: Final Assembly
Remove the base assembly again, and then insert the paper liner. Make sure it is fully spread out inside the cup and then tape the edges to retain the shape. Attach the e-ink display to the little connector board, and the board to the ribbon coming from the hat. Carefully slide the base assembly into the cup, orient the USB port to the hole in the cup and push it down to the bottom of the cup. Again make sure you can plug your USB cable into the board.
Now center the e-ink display into the cutout on the paper liner. Make sure it is level, and pressed all the way into the curve of the cup. Use some tape to hold it in place. I added an additional paper backing to help hold the e-ink display in place. You will need to also tape the ribbon cables to the liner, and you will need to make one 45 degree fold in the ribbon to make it go from horizontal to vertical, going down to the base.
You should now be able to place the inner cup insert into the cup.
Step 6: Insulation
Because the cup is thin plastic it has almost no insulation. The e-ink display I found was sensitive to heat, so the heat from a typical cup of coffee was enough to cause the display to fade. I added some insulation around the cup by cutting the bottom off a common styrofoam cup and then wrapping it around the cup insert, trimming off the excess foam. It also needed a slot cut into it in order to fit around the little connector board.
This helped a great deal. And of course it also means your coffee stays hotter longer.
Step 7: Programming
I've provided the code on GitHub for programming the ESP32. I am using the Atom editor with PlatformIO extensions installed. The code is using Arduino framework with espressif32 platform, using Adafruit GFX Library from Adafruit to put text onto the display. I plan to add images as well as a Bluetooth connection, used with a mobile app to dynamically upload images and text. For now, there are several amusing text displays it cycles through.
I've tried to keep power consumption as low as possible but I think it is not as optimized as it could be. Still, it lasts several hours when changing the display every 10 seconds or so.
The code is a bit messy! There's stuff in there for implementing the BLE communication which is not done yet. There is also some code to communicate to a Slack Bot, the intention to let my co-workers send texts to the cup in real time from our company Slack chat room. Once all thus is working the cup will be an IOT (Internet of things) device!
Step 8: Use It
Take Display Cup into your next company meeting. Drink coffee. Wait for co-workers to notice... enjoy!

Participated in the
Arduino Contest 2019
31 Comments
Question 3 years ago
Heyo! Great idea! Thanks for sharing. Attempting to make this, and have already purchased the Lolin Lite esp32 and the original e-hat that were mentioned in step 1. I am having some issues getting the LoLin Lite to communicate with Atom (which I have never used before). The code compiles, but I can't upload it because my computer doesn't list the LoLin in PORTS? I updated the driver, still can't get it to communicate (Windows 10, lol). Any troubleshooting tips?
Answer 3 years ago
I'm on a Macbook but I also had issues initially getting things to work (Atom with platform-io). Even now I have to use "List Serial Ports" (from the platformio menu) and then whatever I find in there, I have to set it in the platformio.ini file:
upload_port = /dev/cu.wchusbserial14130
For some reason the number changes, maybe its because I dont plug it into the same port each time?
Maybe that helps.
Reply 3 years ago
also I've had issues with USB cords. Make sure you have a good cord, some cords are only for charging and wont work.
Reply 3 years ago
Update: it was the cord all along. I tried 4 before I found one that was actually COMS and not just power. Gets me every time. Now I have everything hooked up and programmed, but am seeing nothing on the E-ink display. Going to do some troubleshooting. The switch configuration for the hat is A-0, correct?
Reply 3 years ago
Make sure you have the most recent version of the GxEPD library because the flexible e-ink display was a fairly recent addition to it. I couldn't get anything to work until that new version was released (which happened only after I built this and couldn't get it to work..)
Reply 3 years ago
Got it working! I was following the wiring on the image and not paying attention to what the pin out was in the code! Oops. Thanks again!
Reply 3 years ago
Totally awesome. Love to see somebody else making this! Please post more pics of the finished product.
I still need to make the mobile app that I intended to do that would let you upload images to it.
Reply 3 years ago
I installed the version of GxEPD that was released today (lol). Still no image on the screen. Have verified power going to the e-ink display is 3.3 V, I will continue troubleshooting till I get it right XD. Thanks again for making such a cool project!
Reply 3 years ago
I switched to a new computer and suddenly the drivers installed appropriately and I have COMS, not sure what the deal was on my usual PC. Thanks for the swift reply!!
Tip 3 years ago
Oh look, they have a larger display all of a sudden:
https://www.waveshare.com/product/2.9inch-e-paper-d.htm
Question 3 years ago on Introduction
Dear Mr.Caley, nice day. Great work you've done that made me smile and happy. MAy I ask if you may provide a sample for us? Woud that be possible? I am reaching you from Istanbul, Turkey. Many best regards and thanks for a reply. Tim
Answer 3 years ago
I'm not sure what you mean by "sample"? Did you mean a kit containing all the parts? I have thought about doing that. I am actually seriously looking into getting a high quality mold made for the cup and doing a custom PCB to make a more compact design. I may do a kickstarter.
Reply 3 years ago
Hello Mr.Caley, yes actually. Many best success at you kickstarter. regards, Tim
Tip 3 years ago
I found a better option for the e-paper display and adapter:
https://www.crystalfontz.com/product/cfap104212d00213-flexible-epaper-display#undefined
https://www.crystalfontz.com/product/cfa10084-epaper-adapter-board
This would be much more compact. It does not include a cable to go from the display to the board though. And the adapter board is open source so it could be directly integrated into a custom board design using a more compact ESP32 module. We don't need a breakout with all the I/O pins available.
Here's also a pretty small QI compatible inductive receiver:
https://www.aliexpress.com/item/33002939788.html?spm=a2g0o.cart.0.0.31543c00XkgSSZ
And a lipo charger:
https://www.aliexpress.com/item/32709366716.html?spm=a2g0o.cart.0.0.7ec93c00NzpOJH
Bare ESP32 modules can be found everywhere..
3 years ago
Nice one, Aric. Love the idea.
(jake carvey, bet)
Reply 3 years ago
Hey, man. You wanna help me 3d model a better cup design? I was never able to locate an existing cup that would work.. besides this cheap one but it was only sufficient for a prototype.
3 years ago
I didn't even get runner up for the contest. :(
No matter. I am researching how to make a more permanent, marketable version of the cup.
I would like to get the cup injection molded in clear acrylic. It would be a single main piece, IE no insert, with a double wall. On the bottom would be a cap. I have found a thin Aerogel insulator pad that will fit inside, and then the patterned or colored insert could be printed on thin plastic instead of paper. With the Aerogel and double wall, it should insulate as good as a thermos!
I haven't decided on a heating element, but the only "smart mugs" around seem to have this feature. But I would like to see it have a QI charging coil in the bottom. Also the capacitive touch buttons. Maybe a couple LED's. A temperature sensor. And an app to help you program the displays, including setting things up like notifications, weather reports, whatever you want to display in real time! The other smart cups don't seem to have any connectivity.
I think I will seriously set up a kickstarter for this. I don't have any manufacturing experience so if anybody does I would like to hear from you.
4 years ago
You could add a tilt switch to the module and be able to change the display every time the mug is tipped by a certain amount (sip or big sip etc.)
Reply 4 years ago
I was going to add a small button by the handle to manually cycle through the displays, but I think I like your idea better!
Reply 3 years ago
you could maybe add a capacitive touch control to somewhere on the outside of the cup. One of these in the cup base https://www.aliexpress.com/item/32994412792.html and draw the electrode/button on up to the outside of the cup with conductive ink, although that might wash off too easily.