E-Ink Desktop Calendar DIY Project——iiv
1. Inspiration: Why an E-Ink Desktop Calendar?
Creating a desktop E-Ink calendar not only allows you to check the date and weather, but also brings a sleek and tech-savvy aesthetic to your workspace.
2. Designing the PCB:
The PCB design is available on LCSC Open Source: Project - LCSC Open Source Hardware Platform.
(1) Software Tools
The PCB was designed using LCSC EDA Pro, a powerful and user-friendly PCB design tool that also offers free prototyping!
(2) Project Parameters
- The M61 module serves as the main controller for refreshing the e-ink display and reading sensor data.
- An SHT40 temperature and humidity sensor collects environmental data.
- A DS1302 provides time info (though it's somewhat redundant).
- A GN4054 charges the lithium battery, with pin 1 indicating the charging status.
- A TF card slot is included on the board, but it's not currently in use.
- The design includes battery voltage detection with a low - battery alert.
- An infrared emitter is reserved, but the audio function is disabled.
- A CH340X USB - to - serial converter enables auto - programming without cold starts.
- An RS2227 chip allows switching between USB and UART, though this feature isn't currently used.
- A rotary switch: press down for boot mode; other directions can be customized. In the code, moving it right wakes the MCU to refresh the screen.
- A reset button: pressing it resets the MCU.
- A sliding switch: turning it off cuts the 3V3 power, but the RTC keeps running.
(3) Ordering the PCB
Export the Gerber files of the designed PCB and place an order with JLCPCB.
3. Soldering the PCB
(1) Preparing Materials
M61 module, CH340, SHT40, resistors, capacitors, inductors, etc.
(2) Soldering Process
For the e-ink display boost circuit, use high - voltage capacitors rated at least 25V, preferably 50V for a safety margin.
The 0402 - packaged components aren't closely spaced. Avoid bridging when soldering the FPC connector. After soldering, check for shorts before powering on.
4. Writing Code: Bringing the Calendar to Life
(1) Setting Up the Development Environment
Use the Bouffalo SDK from Ai - Thinker's repository for development. We may switch to the Bouffalo Git repository's SDK later, as it has many bug fixes and new demos.
(2) Code Logic
In the project's user_config.h, define macros to configure Wi - Fi settings. I've added comments for clarity. The firmware and source code are in the attachment. After flashing the firmware, you can configure parameters via the serial port.
The e-ink display driver is ported from Waveshare, with drivers for two 4.2 - inch screens. Other parts are self - written, though not very standardized.
Currently, there's no other way to connect to the network. In the future, we may add a mini - program for networking and screen brushing. But you can configure parameters via the serial port at a baud rate of 2M (2000000).
Command format: [set ssid pass token per_sleep_time], e.g., [set MI - WF 1234567 ABDCDEFG 0]
- Parameter 1: Wi - Fi account
- Parameter 2: Wi - Fi password
- Parameter 3: Required for obtaining lunar calendar info; you need to apply for it -- click here.
- Parameter 4: Refresh interval in minutes. For example, 120 means a refresh every 2 hours. If set to 0, it refreshes once daily at 12 PM. The internal clock may be inaccurate, possibly refreshing as late as 1 AM. Our test shows an error within 10 minutes. We may later replace the RTC chip with one that uses interrupt - based MCU wake - up for better accuracy.
We use a free weather API that gets local city weather based on network location. The weather info may not be very precise, but it's close enough.
Due to the incomplete font library, the calendar only shows statutory holidays. It displays "Workday" from Monday to Friday, "Weekend" on Saturday and Sunday, and statutory holidays by name.
If the battery is low, the battery icon...
Read more »
Ai-Thinker
Stephen Harrison
Michael Frank Taylor
Open Green Energy