This is the second in a series of articles about using microcontroller devices with e-paper displays for displaying dynamic calendars.
A year ago a concept video was created by Japanese designer Kosho Tsuboi about a device called a magic calendar, which is an e-paper device that displays an events calendar and will automatically update when an event in Google calendar is added or updated.
Original concept video of the “Magic Calendar”
This calendar is not a real product (at least not yet). It was a concept only, showing what the technology could accomplish. Well, I have made my own version of the “Magic Calendar”, and it is real and it is working!
I used the following items to create my version of the “Magic Calendar”:
- Adafruit HUZZAH 32 Feather (Arduino compatible microcontroller, stacking headers version)
- Waveshare 4.2 e-Paper module
- A custom Featherwing to connect the e-Paper module to the HUZZAH 32
- The IoT Calendar service to parse iCalendar feeds for IoT devices (iotcalendar.org)
- Custom code for displaying the calendar, events, temperature and moon phase.
I have tested this with both the Adafruit HUZZAH 8266 and Adafruit HUZZAH 32. The HUZZAH 32 version actually works much better for larger e-Paper displays like the 4.2 inch display used here due to the increased memory usage needed to hold the display buffer. This could work on the HUZZAH 8266 if using a smaller e-Paper display. Waveshare makes e-Paper devices in several different sizes.
My version of the “Magic Calendar”
The Waveshare e-paper displays with the module PCB attached to them are the easiest to integrate with Arduino devices. The raw devices are cheaper but interfacing with them requires additional hardware. I made a custom Featherwing to make it easier to connect the Waveshare module to the HUZZAH device. In addition to making it easy to connect the 8 wires from the display, the custom Featherwing also includes a reset button and two additional buttons for software use. I use the additional buttons to put the device into a web based setup mode. I will be releasing this custom Featherwing on Tindie for those interested in it. Although Waveshare provides a graphics library for drawing on the e-paper display, I instead used the Adafruit GFX library, which was very easy to use with the display.
Actually the hard part in all of this was being able to get the event data. The iCalendar standard helps a lot with this as it standardizes the format of events so a program can read calendar events from different vendors using the same code. However, iCalendar files are not easily parsable and the memory and computation requirements are beyond what most IoT devices can handle. Doing some research, I did not find any service for IoT devices for parsing iCalendar files. Fortunately, I have some iCalendar experience, creating and maintaining the iCalendar.org site, which includes, among other things, an iCalendar validator tool and a PHP iCalendar library that I wrote. I decided to create my own iCalendar web service for IoT devices to use. You can find more details of the service at iotcalendar.org, which with its free level tier allows IoT devices to parse their events once per day. Technical information about this service is available in this article.
With the IoT Calendar service, a device sends an iCalendar URL to the service, the service parses the feed from the URL, and returns the events for a particular day (usually the current day). This data is returned in JSON format, a format that is easily read by many computer languages.
With all these pieces in place, all that remains is writing the code. Code development is continuing and as you can see from the photos, it is successfully pulling events from my calendar. In addition to displaying the current month calendar and events, it is also showing the high and low temperature for the day and the current moon phase. I have also written code for a smart name plate/badge, which is a very similar project but uses a smaller e-paper display. The smaller display and lower memory requirements makes this project better suited for the HUZZAH 8266.
The original “Magic Calendar” concept showed integration with Google Calendar. My version should work with any iCalendar compatible calendar. The photos show events from Office 365, and I have also successfully tested it with Google Calendar and other iCalendar feeds. When completed, I will post this code on GitHub.