Since this is a personal project with no clear deadline that is still ongoing, I thought it would make more sense to treat this page as a timeline of sorts to track the progress of this project. I have also uploaded all of the relevant files to my GitHub (https://github.com/choidj11/e-paper-display).
The main idea for this project is to make an e-paper photo frame that can display a new image every day. This involves combining the e-paper display, a RTC (real time clock), a microcontroller, and a power source.
I never worked with an e-paper display before so I decided to test it out using an Arduino UNO. While the e-paper display had some documentation describing how it worked, the main issue was that the demo code provided only displayed a small image in the corner using a hard coded array to represent the image and attempts at displaying larger images resulted in garbled pixels. Plus, using a hard coded array to represent the images meant it was difficult to make my own images and clunky to manage. In other words, the main issues were the limitation of displaying only a small hard-coded image, garbled pixels when trying to display larger images, and the inability to identify and manage multiple of my own images efficiently.
Image Displayed by the demo code
Example of image distortion when displaying larger image
To identify and address the problem, I took the following steps:
Investigated the e-paper display documentation and demo code to understand its functioning.
Checked connections and made sure all necessary physical connections were correctly made and secure.
Used a multimeter to verify that the e-paper display was receiving adequate voltage and current during its operation that didn’t fall out of the ranges listed on the datasheet.
Tested hard coded arrays of different sizes and carefully reviewed error messages to identify at what point the garbled pixels began. Discovered that the garbled pixels were caused by Arduino’s memory being full when the hard-coded array was too large.
Solved the memory issue by using a microSD card to load parts of the array into a buffer, enabling the display of larger images. Set up communication with the microSD card using SPI.
Researched alternative ways to store the image data to make it easier to identify and manage multiple images efficiently. Also researched ways to reduce the number of colors in images since the e-paper display could only use 7 different colors but my own photos that I would want to display had significantly more.
Solved the color reduction issue by using an algorithm called the Floyd-Steinberg Dithering algorithm that disperses the difference between the original color and the available color for a pixel onto neighboring pixels to reduce the number of colors in an image without creating harshly contrasting color regions. Also solved the image data storage issue by using a bitmap file type with a specially configured header and specially loaded pixel values.
Implemented corrective actions by creating a Python script that cropped, resized, and dithered PNG/JPG images then converted them into a bitmap file configured the correct way.
I eventually got a functional prototype working by adding an RTC module and writing a simple Arduino program that communicated with the module using I2C. Every 24 hours, the program simply read the next bitmap file stored in the micro SD and displayed it to the e-paper display. Now that I had a functional prototype, I wanted to find ways to shrink the system, add more features, and make it battery powered.
When testing the breadboard prototype, I quickly realized that it was drawing too much current to reasonably be powered by a battery. To identify and solve the problem, I took several steps.
Used a multimeter to measure the current draw of each of the components. This helped me realize the Arduino UNO itself and the micro SD card reader were the two places in the design where the most energy could be saved.
Solved the high current draw of the Arduino UNO by designing a custom PCB driven by an ATMega328P microcontroller which allowed me to remove linear regulators, large oscillators, and other unnecessary components. A custom PCB also let me slow down the clock of the microcontroller and run the entire system on 3.3V instead of 5 V. Also put the chip into deep sleep when it wasn't actively changing the display (but this required restructuring the code to account for external interrupts from either a button press or a signal from the RTC to tell the system when to change the image)
To run the entire system on 3.3V, I decided to use 2 AA batteries since it would reduce the weight and size of the final design. However, since the voltage of the batteries would decrease over time, I had to use a boost converter to ensure the voltage in the 3.3V rails would be constant over time.
Solved the high current draw of the microSD card by using a PMOS toggled by one of the GPIO pins of the ATMega328P to only supply power to the SD card reader when needed.
Below are images of the schematic and PCB layout and the changes it went through.
The Physical PCB
Since the ATMega328P chips I ordered were brand new, they had nothing burned into their memory. In order to make sure I could upload code to them, I had to burn a bootloader onto the chip. This would also set certain fuses to determine the clock speed of the chip, its operational voltage, etc. I used an Arduino UNO as ISP and connected it to the ISP header of the PCB to get the bootloader loaded. From there, I used a USB to TTL converter to load any necessary programs onto the ATMega328P chip.
I used a cheap store bought frame to hide the electronics and create a final product I can put on my desk.
Throughout this project, I learned a lot about embedded development, PCB design, and working with new technologies. I also have a lot of plans for improving the design in the future.
Switch from a boost converter to a buck converter and increase from 2 AA batteries to 3 AA batteries.
The back of the e-ink display has a lot of extra room and I'm pretty sure additional batteries can be added without compromising the form of the frame.
Switch from ATMega328P to STM32 chip
I learned to program STM32 chips in my Microcontrollers class and I think it would be a good experience getting it to work. Also the additional control you can get with an STM32 chip would allow the system to be more efficient and have a longer battery life.
Redesign PCB to include e-ink supporting components
The e-ink display I bought comes with a PCB that has several capacitors, resistors, inductors, and other minor components to help it run. The board then connects to the e-ink display itself with a ribbon cable. I think I could move these components onto the custom PCB, helping make the overall form of the frame much thinner.