Building Glance: an E-ink Dashboard/ Photo Album Display
by NuMellow in Circuits > Raspberry Pi
326 Views, 3 Favorites, 0 Comments
Building Glance: an E-ink Dashboard/ Photo Album Display
I would like to present to you Glance: an e-ink device that displays fun and helpful information throughout the week. I originally created it to tinker with e-ink displays and explore what I could make with them. I find them cool because they require very little power to run, and are also fun to look at. It would be interesting to see what other they can be used for besides e-readers.
With that, I created two apps [so far]. One is an instructables contest dashboard so I can keep up with all the contests currently going on, and the second, a photo album display, that gets photos from a shared google photo album and displays a different image each day. I also use the photo album app as a daily drawing reference tool which has come great for days I don't know what to draw :D
It is able to wake up, run and shutdown by itself which means you wouldn't have to worry about turning it on/off each day. This, along with the fact that the screen doesn't need power to display information (only when it's updating it) means that it also goes for close to 2 weeks before it needs to be charged again!
If you'd like to build one yourself, or just see the journey I took to make it, then follow me and continue reading :D
Supplies
For this project you will need:
- 7.5 inch waveshare e-ink screen (link)
- Raspberry Pi along with a micro SD card to load the operating system on
- This instructable uses a raspberry pi zeroW, but any Pi should work.
- PiSugar battery:
- 2 Plus- for Pi 3/4/5 (link)
- 2 Portable - for Pi zero/ zero2W (link)
- 5 M2.5x5 screws
- 3D printed parts
- 2mm EVA foam
- [Optional] 5x7inch picture frame (If not 3D printing)
Tools:
- Screwdriver
You will also need to able to connect the Raspberry Pi to a monitor, keyboard, mouse to complete the initial setup
Print Parts
Alright, let's start assembly! Go ahead and download the STL files to print the casing. If you don't have access to a 3D printer no worries! Just go to step 3 once it's time to fit the screen in the case during the Assemble Parts step
Assemble Parts
Attach the PiSugar
If you haven't done so already, attach the PiSugar to the Raspberry Pi. It comes with Pogo connectors that make it easy to attach it to the bottom of the Pi, leaving the GPIO pins free for use for the screen.
Attach the e-ink screen HAT
Attach the HAT to the GPIO pinks on the Pi
Connect the flex cable to the screen
Lift the black tab in order to open the port for the cable and close the tab to secure the cable once placed. Take care as the cable connecting to the screen is delicate
Peel off the plastic cover
Make sure to peel off the plastic cover from the screen otherwise there will be a glossy glare from any light source which defeats one of the advantages of e-ink screens that they are very readable in direct light.
Place screen in the frame
Very carefully, place the screen in the front half of the frame. Be slow and deliberate with this step as the frame is sized to fit the screen exactly and will need to be placed in carefully to avoid breaking it.
Place foam padding on the screen
Cut the 2mm EVA foam to size and place it on top of the screen. This will provide some cushion and also ensure that the cable adapter does not scratch the back of the screen. If you do not have access to EVA foam, any other padding should do. Preferably 2mm so the screen is not loose when closed.
Place the back cover
Fold the flex cable so that it comes out of the opening in the back cover as shown. Despite their name, flex cables aren't all that flexible in some directions and do not like being bent repeatedly, so be sure not to fold-unfold-refold trying to find the "perfect fold".
Once in place, screw the back frame using the M2.5x5 screws
Connect the flex cable to the Pi
Connect the cable to the Pi as shown
Place Pi in slot
Flip the Pi carefully into it's slot such that the HDMI, power and USB ports are facing up.
Done!
Congrats! You are done! 🎉 You are now all set to download and run the glance software!
No Printer? No Problem (optional)
If you do not have access to or just don't want to 3D print the case, you are in luck. You can also use a 5x7inch picture frame as the case. Just be careful when placing the screen as it is fragile. The only downside of this approach is that the flex cable connecting to the Pi would be more exposed and there isn't a slot for the Pi to sit in. However depending on your frame, you may be able to put the Pi in a case and use Velcro or double-sided tape to attach it onto the frame.The plus side is you can get all different kinds of cool frames.
I used the smooth glossy sample photo that came with the picture frame as a back padding so back of the frame doesn't scratch the back of the screen. I also cut out a paper frame for the front since the e-ink display's width is much smaller than the frame.
Setting Things Up
There's a few things we need to set up before we can install the Glance software, namely: Setting up the OS, the PiSugar and the e-ink screen.
OS setup
Download the latest version of Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/ and install it using your method of choice. If you are not familiar with installing an OS to an SD card, the site provides a software tool that will do most of the work.
PiSugar setup
The software setup will allow us to do things such as measure the battery level, schedule auto shutdown, wake up and set custom button controls. Follow the steps on https://github.com/PiSugar/PiSugar/wiki/PiSugar-Power-Manager-(Software) to get set up. They are fairly simple and mostly boil down to enabling the i2c interface on raspi-config and run this command to download and run:
curl https://cdn.pisugar.com/release/pisugar-power-manager.sh | sudo bash
I recommend using the link instead in case they update their steps in the future.
During the set up it will prompt you for a username and password to use for its web application. Make sure to remember them so you can set up the auto wake up later.
E-ink Screen setup
Go to https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT_Manual#Working_With_Raspberry_Pi and follow the steps on how to setup the e-ink screen. They are also fairly simple and boil down to enable the spi interface on raspi-config and reboot. Again, I recommend following the steps from their page in case the documentation ever changes.
Glance Setup
Glance setup
With that done, let's go ahead and download the Glance software. You can either:
- Go to https://github.com/NuMellow/glance and download the code, by clicking the green <> Code button and select Download ZIP. Once downloaded, unzip the folder. OR
- In the terminal on the pi, run:
git clone https://github.com/NuMellow/glance.git
Once downloaded, open the glance.conf and album.conf files in an editor of your choice. These files determine the settings Glance will use when running.
Glance.conf
page: determines which app (also called pages) to show. change this value to 0 to display instrucatbles contests, and 1 for photo album
has_pi_sugar: determines whether Glance is using the pi sugar battery and can display battery percentage in the different apps. If you're not using the battery update it to False
numofapps: This is the total number apps available.
Album.conf
url: add a link to a shared google photos album. If you don't have/want to use google photos see setting below
should_download: determines whether Glance downloads the album from google photos. If you don't want to download the album repeatedly, or if you don't want/use Google photos, set this value to False. You can instead manually put your photos in a folder called album and put it in the src/static folder.
schedule_download: This allows you to schedule downloads on a specific day of the week. If you set to False, glance will download the photo album every time it's run (everyday)
download_day: If schedule_download is true, you can set a day of the week you want to download the album.
lastly, go to the src folder and run this in the terminal to get the required libraries to run glance:
/setup.sh
Running Glance
With everything assembled and set up, go to the src folder and run this command to run the app:
python glance.py
If all went well, you should soon see the current instructables contests going on, or your photo album (depending on which page you entered in glance.conf).
If you have any issues, check out my troubleshooting section of the wiki here!
Automation
The final piece is to make glance shutdown, wake up and run by itself automatically. In the src folder there is a file called startup.sh. This is a script that runs glance.py and after 15 minutes, tells the raspberry pi to shutdown. To have this script run when the raspberry pi boots up, we need to edit a file in the raspberry pi called rc.local. This file can be found in the /etc/ folder.
But first, lets open up startup.sh and make a quick change. when you open the file in a text editor, update the second line that says:
cd absolute/path/to/glance/src/directory
to the location you downloaded glance. For me, it looks like this:
cd /home/pi/glance/src
Okay, now on to rc.local.
Update rc.local
First, in the terminal run:
sudo nano /etc/rc.local
This will open up an editor in the terminal. With the arrow keys go down till the bottom of the file and the following lines above the line exit 0
sleep 10
/home/pi/glance/src/startup.sh
Sleep 10 tells the raspberry pi to wait 10 seconds and this gives time for the pi to connect to the network before running glance. The second line will run the start up script. If you downloaded glance in a different location you should update this line to match where you saved it.
Great now when we turn on the raspberry pi, it will run glance and then shutdown after 15 minutes.
Note: if you ever need to use the pi and don't want it to shutdown, you can run this command within the 15 minutes to cancel the shutdown command:
shutdown -c
The only thing left is to get it to turn on by itself. To do this we will use the PiSugar web app we set up earlier to get to it wake up at a specific time each day.
Update PiSugar wake schedule
To go to the PiSugar webpage open a web browser and enter the pi's ip address with port 8421 in the url bar like:
http://10.0.0.27:8421
To see your ip address just hover over the wifi icon.
Once you hit enter you will be asked to enter the username and password that you set up when installing the PiSugar software. Once you enter it you will see a dashboard-like app including the battery level and a few controls you can edit.
Under Schedule Wake Up switch the dropdown to Enabled, and set the time you want it to wake up. If you only want it to turn on on certain days, then you can click the repeat button and set which days of the week you want it to wake up.
Optionally you can also set a safe shutdown so, so that it can safely shutdown if the battery is too low to finish running glance.
And with that we are all set! :D
A kind of bonus thing we could do while we are here, is set a custom button function. The PiSugar has a small button on its board that we can configure to run custom scripts. I used the single tap to switch which app glance should run. To do this, click the dropdown menu next to Single tap and select custom. Then in the text field type and save:
python /home/pi/glance/src/next_app.py
Remember, if you saved the glance folder in a different location you should edit the command to your file location.
Now the next time glance runs it will swap and display the next app.
Bonus: Making Your Own Apps for Glance!
As I hinted in the introdution, there are other apps I would like to make, including a cafe menu app, daily writing prompts and maybe a recipe book.
If you'd like to make your own apps though, or want to request some for me to make I have a couple of options :D
I'd like to make my own apps
If you're comfortable with exploring the code and figuring things out, you can create your own files in the glance folder and create to your hearts content.
Alternatively, if you'd like a guide, I'm planning on creating a how to tutorial on Glance wiki. Feel free to check here in the next coming month or two
I'd like to request an app
If you'd just like to request an app, you can fill out this google form or if you have a github account, go directly to the project page and on the issues tab, create an issue with the label of app request and fill t the details there
That's All Folks
Thanks for following along. I hope this has been helpful and or fun to read. For any future updates checkout my github page https://github.com/NuMellow/glance and wiki https://github.com/NuMellow/glance/wiki. Also feel free to ask me if you have any questions.
Thanks for reading!