I was talking to my friend early in July about various display techniques and they pointed me at
this video by Ben from Applied Science and it's an amazing video. I urge you to go watch it. At any
rate I headed over to Waveshare, the people who make a bunch of types of e-paper displays, and
bought some and it was basically the very next day that they went and posted to their twitter about
this seven color display, and it BLEW MY MIND, so I just immediately headed over to Waveshare
and bought it. Well good thing I did because right after I bought it it went out of stock,
so you can tell that there's a lot of other people who thought this was pretty cool. Not long after I
purchased this did I actually start to get some ideas about what I might be able to do with it,
and one of those ideas was to make a gift for my mom. A picture frame which changed pictures
at night. So, because it's an e-paper display it doesn't light up. It looks a lot like an actual
picture. I really wanted to make something where I could try to trick my mom into thinking that I
gave her a different picture. I don't know, maybe I was going to gaslight her. I don't know how well
that would work considering she, well, knows that I'm as crazy as I am. The reason I wanted to have
it update at night is because this version of the display can take up to 15 seconds to update,
which, if you're, you know looking at it you're going to notice something's up.
You might be wondering why I decided to release the video now instead of back in August and it's
because they're back in stock and you can go buy some and do everything that you see in this video
yourself now. Because I had a pretty good idea as to what I was going to do I ended up designing it
on the stm32f042 on a live stream with a whole bunch of other people who could go contribute
their sorts of ideas and attitudes towards things. I decided to write it as a pure software-based
driver. That way, when I was going to be porting to a completely different processor eventually I
moved the ATmega128pb, just because of simplicity for low power, I was able to do so with minimal
effort. One of the things I decided to do is take a look at this e-paper display under a microscope
while it was changing and I thought it was pretty neat. It goes through these sorts of just patterns
of going in and out and I think it substantiates Ben's idea as to how these displays actually work.
I'm still a little bit confused as to how it could work with this many colors,
but it was pretty fun. A little bit after doing the live stream I discovered yet another color
that the displays could display. A sort of purpley whitish color. And even though it wasn't exactly
the most vivid of colors, it was still something that could help pad the colors and make it just a
little bit better. Now that I had all of the parts of the system kind of moving, I had this this bit
banged library which I could run on just about any processor I'd ever want, and I could do it without
much effort porting. Much to my surprise it just kind of worked on the ATmega168. So I still needed
to be able to do two other things: one was make it so it'd be really low power and the other one was
to be able to support SD cards so I could store my images on an SD card. Now, one of the things
you might be familiar with is that a lot of people use SPI to talk to SD cards. And you also might be
familiar that that's not really that great of a solution because a lot of SD cards don't support
SPI as a communication protocol, which is honestly kind of surprising they're all that terrible, but,
many years ago I ran into a similar problem where there was an SD card with a Wi-Fi that I wanted to
talk to and it did not support SPI. So I went and wrote my own software bit banged stack for
talking to SD cards using the SCSI commands and it's actually really small and really simple. So,
I used it. I was then able to take just these random old 16 gigabyte just modern SD cards
and plug them directly into this ATmega168 and everything just kind of worked. Now,
just because I was able to have some dot raw files on some SD cards that were able to load images
into the display does not mean my job was over. I still had to make this thing really low power and
I also had to pick out some pictures to use with it and figure out the best way to display them.
In order to take a nice high fidelity image and convert it into something that you can easily
and clearly display on this Waveshare device, you're going to have to take your image and
convert it down to eight colors. Now the way I found to do this was to select these eight
colors manually and then go convert it by Floyd Steinberg. If you try it for any of the others,
say nearest, it looks like garbage. If you try positional it looks really rough,
but Floyd Steinberg dithering looks really, really good on this display, and I think you'd agree.
Now that's not everything. I did try a few things to get even better color representation on this
display but it didn't really pan out. I really tried taking a picture of the display displaying
all of the colors, blurring it, and then using those as the palette things so that the display
that GIMP thinks it will be presenting the user is what the user would actually see.
Unfortunately the Floyd Steinberg algorithm just doesn't look very good when you convert
the image to anything that's other than the sort of stretched palette, this imaginary palette that
I started with. So that's why I'm pretty confident that the palette colors that I've chosen inside of
the converter application are pretty good. After being converted down the colors, it goes in this
converter application which goes, looks up in a table the closest color to each of the known
indexes and then creates a data file, like a raw file, that would be able to be displayed to the
Waveshare color display. I selected several images that I would put onto the card and
each one would be read off at around 3am every night and would be displayed in sequence until
it rolled over and then displayed the first picture again and I needed to be able to make
this entire process really, really low power. On the board here I actually have the ability to cut
off power to either the SD card or the display. So I had a much more complicated sequence of events
that I would do instead of just leaving the power to the display and SD card on. The idea is that
most of the time the microcontroller lives in a power save mode and that power save mode is only
about 40 microamps. It's actually a little bit less and that's for the entire system because it
has the display and SD card off. Then, once every 24 hours it wakes up and it powers everything off
just to make sure it was off. Then it powers on the e-paper and initializes it and it powers on
the micro SD card and then proceeds to read the next image off of the SD card. And once it's done
reading the image it turns the SD card back off, and, then it issues the command to the display
to go change. And while it has the display and SD card on it's using around 16 to 20 milliamps
and then when it decides to go flip it goes up to about anywhere between 10 and 50 milliamps.
But because it only does this once a day that actually doesn't use very much power. Over the
course of the 18 seconds that it takes to switch the image it uses on average about 27 milliamps,
which adds up to 486 milliamp seconds, but that's actually only 0.135 milliamp hours. Over the
course of the day it uses about 30 microamps at a time, so over 24 hours it uses about 790 microamp
hours. All of this totals together to under a milliamp hour per day, so with these two 380
milliamp hour Tenergy batteries, this is probably going to last an upwards of around two years.
I could have done some things to get the idle power usage a little bit lower, but it just wasn't
worth it. It was already pretty low as it was and I was happy with it and decided to move on.
Up next is the final assembly. I was able to just mount the circuit board, the TB-168. By the way,
the schematics and code is all in the description below. So I was able to mount the circuit board to
the back of the picture frame and then use magnet wire to connect that circuit board to the picture
frame, and use regular old connectors to connect to the batteries, and from there I basically had a
standalone e-paper display which would do what I needed. I went to Michael's then to get the mat
professionally framed, and it's just because it's really hard to get a professional look on a mat.
From there it just fit the display right in and I tried putting it into the picture box.
Unfortunately there really wasn't enough room for the batteries and everything else
and so I have to try extra hard to go shave off a little bit of material here and there
in order to make everything fit and not look really suspicious. I did want to test this
for a few days before actually giving it to my mom, so I did. I put the batteries in at 3:30am
and from there I decided to just check up on it every day or so to make sure everything was well,
and answer was it did work, and it worked really well. So the night before came. I went,
I put in the batteries, and there was the picture of my brother at his wedding.
Little did I know that my mom had the same exact picture on display in her living room.
So I totally could have picked a better picture if I was gonna go trick her.
Let's see what she says when I give her this gift. “Oh isn’t that,
that's nice. That's beautiful.” “So I actually printed that one myself using a new technique.”
“Oh, I noticed it's different from the one that I have.” “Yep.” “Thank you!” The very next day
she called me and uh, I think the conversation kind of speaks for itself. “Um yeah. And I was
pleasantly surprised to see the next photo on there.” “Haha. Did you expect that?”
“No. When you gave it to me I didn't expect anything like that.
Yeah, that's nice. Does it change every 24 hours or what?” “Yes.” “Wow.
Well, thank you, I mean that's really a very unique present.” “Haha, I was gonna try to
like drag it along but I figured like dad kind of ruined it yesterday with saying like just ask
him tomorrow or something like that.” “Ask what tomorrow?” “Like just to drag it along to make
you think that it was like the same, that that was the picture I gave you. Like play dumb.”
“Yeah, I mean I thought well I'll have two of the weddingthen, which is fine, they’ll just be
in different locations there in the dining room it’s nice.”
So I think ultimately my mom kind of smelled something was up. At any rate, this was a
really fun project, but trying this new format I don't think any of my other videos are going
to be quite this in depth moving forward. But yeah, go get one of these color displays. They're
awesome. All of my code and schematics are in the links in the description and thanks for watching!
It's so weird that there's just nothing plugged in and the picture is still there. It's so strange.