Wireless Raspberry Pi Digital Picture Frame in a Shadow Box
by fishpotpete in Circuits > Raspberry Pi
7903 Views, 77 Favorites, 0 Comments
Wireless Raspberry Pi Digital Picture Frame in a Shadow Box
This project uses a Raspberry Pi 2 Model B, wireless USB connector and an old Acer AL1706 monitor. The goal was to create a decent sized, decorative digital picture frame that could connect with our Synology DiskStation Network Attached Storage (NAS) and access our library of pictures from there. I also wanted to try to keep cabling to a minimum.
As far as the actual frame was concerned, I hoped that I could find a shadow box that would work. The strength of the box wasn’t a concern because the shadow box will be mounted to the monitor and the monitor will be the heavy part that’s actually hanging on the wall.
Key Features:
- Wireless – Gets pics from
- NSA. No SD cards or extra Cat5 cable
- Regular PC monitor – easy to hook up to a Pi
- Fits in a shadow box – No frame construction, inexpensive
- Single power chord – Easy cable management, future proof
- Controlled from remote PC – no need to access the frame after it’s hung or whatever
- Utilize existing equipment/materials when possible to keep the cost down
Materials Used
- Raspberry Pi 2 Model B – loaded
- with OpenELEC/Kodi
- Acer AL1706 computer monitor and power cable
- 5 v power supply for the Pi
- HDMI to VGA adaptor
- VGA Male to Male DSUB (VGA) connector
- Shadow Box/Display Case 12” x 16”
- Black frame matte
- Two prong AC replacement female plug
- Misc shims, electrical tape, Hook/Loop fastener, etc.
Tools – For the most part, basic household hand tools are all that are needed for this project.
Safety
- Electrical safety!
- Disconnect all devices from power before working on them – unplug everything.
- One step involves making a splice and adding an electrical outlet to a 110v AC power cable. Do not attempt this if you do not understand basic wiring principles/safety. Just use the original power cables and live with two wires instead of one.
Testing the Concept
The first step in the process was to see if using the Pi as a digital photo frame would even work with my system as I had planned.
I had a small wireless USB network adaptor that worked great with the PI and that allowed the system to access the Synology NAS over a wireless connection.
I played around with the Pi with various small Linux operating systems (e.g., NOOBS) and then ended up using OpenELEC/Kodi to run the slideshow. The nice part about using OpenELEC is that you can access/program the Pi from another PC on the network.
Once I figured out how to access the Pi using PuTTY (see appendix at the end), it was just a matter of figuring out the commands to tell the system I wanted to have it start directly into a slideshow and get pictures from a specific directory on the Synology NAS.
This worked better than expected. Pictures came out nice and it even ran videos flawlessly.
Disassemble the Monitor
This part is fairly straight forward:
- Remove the base (usually just a few screws)
- Gently pry the plastic frame apart – either the front or rear will pop off.
- Figure out how the other half of the plastic frame is attached – either screws, or in this case, a few clips.
All the plastic bits can go in the recycle bin. Be careful about not scratching the screen or mangling controls/electronics in the process.
Measure Everything
Measure the screen (height/width/depth) to determine what size shadow box and picture matte are needed.
Once all of the dimensions are figured out, then you can go shadow box shopping! This can get really expensive, so look for sales. I went to a few places but found a frame that would work at Hobby Lobby for about $15. Plus I was able to get black matting for another $2.50 or so.
Shadow Box Dry Fitting
Do a dry fit to see how the monitor fits in the box. I found that the monitor control panel was in the way. Luckily it was just a simple matter of removing the panel from the frame and bending up the metal mounting ears.
There were ¼” slats around the inside of the frame to hold the glass in and as a stop for the backing of the shadow box. These needed to be removed so the matting could fill in the entire glass area.
During the dry fit I found that the monitor would fit very neatly if I left the top slat out. The depth even turned out to be perfect.
Frame Matte
The key here is to carefully layout your lines and use a fresh, sharp utility blade to cut the matte. If you’re lucky, you might be able to find a matte that’s precut and fits your project without having to do this part.
- Measure the frame opening (without the slats) to get the final outside measurements of the matte. Make those cuts and check the matte fit in the frame.
The next cuts are harder because you are cutting the opening for display – determine the distances between the inside of the shadow box frame and outside edges of the display. It’s better to make the matte opening smaller than desired. If you make the matte opening too large, you will see the metal frame of the monitor.
- Position the monitor in the frame where you want the final mounting to be. Be sure that all slats, shims, etc. are considered in your final mounting position. For me, the monitor was only movable from side to side, so it was a simple matter of making sure each side had the same distance from the side of the frame.
- Make note of measurements: I had 15/16” to the edge of the monitor. Round up to 1 inch to make life easier.
- Measure the top and bottom of the display to the edge of the frame. For mine, the top was snug up against the frame; the bottom had a slat between the monitor and frame – The top was just over ½” (round up to 5/8”) and the bottom was right at ¾” (round up to 7/8”).
- The sides were handled differently. The edge of the monitor to the inside of the frame was 1”, the sides of the metal monitor frame was about 7/16”… I figured 1-1/2” for each side.
- Transfer all of these measurements to the matte and CAREFULLY cut out the opening. I put my markings on the back of my matte and made a number runs for each cut, getting deeper each time.
Now is a good time to totally clean the inside of the frame, glass and matte.
Final Fitting
This part was pretty easy since all the critical measuring/cutting was already done.
- Reattach the slats with a little glue and clamp until dry. The leftover slat for the top was used to help secure the top of the monitor to the frame.
- Since my monitor had slack on the sides, I needed to add some kind of a shim to keep the monitor from sliding back and forth. I used a slightly sanded down Lincoln log on each side to fill the void. A dab of glue holds these in place.
- You might need to add additional shims to tighten things up. Don’t put too much force on the sides of the frame – it can easily distort.
Mount the Components
There’s not much weight associated with the components so most loose items can be attached with a hook/loop fastener. The only watch-outs here are to make sure that the electrical components do not short out. I secured a cardboard backer to the PI and the HDMI/VGA adaptor. Similarly, I also added a strip of electrical tape behind the monitor control panel.
To hang this on a wall, simply put screws in the top two monitor mounting points and use picture hanging wire between the screws. Do not hang this from the shadow box as the box is not designed to support the weight of a monitor.
Wiring for the Monitor and Pi Power Supply
It would have been nice if my monitor had a powered USB outlet. But since it didn’t, I needed to include power for the Pi. I also wanted to keep the PI power supply easy to swap out because of the high failure rates of these things.
- I modified a standard, grounded PC power cord to include a two prong outlet for the PI power supply. This keeps the frame down to one wire coming out of it.
- If you are not qualified or comfortable to make a modification like this, you can either just run two power cords from the frame or try to find an extension/multi-plug that would fit in your frame.
All that’s left to do is to tidy things up in the back and run some tests to make sure everything is still working properly.
Last Steps and Closing Thoughts
We toyed around with where to put this thing. At least for time being, we decided to just keep it on a corner table as it is easy to view from there. So now that we have had it going for awhile, here are some things to consider:
- Because it is wireless, keep in mind the location may affect the wifi reception, which in turn will affect the speed of picture changes and video playback.
- Because of the size of the display, you might find that it’s distracting while watching TV if it’s in your line of sight… you keep looking at the display every time it changes pictures!
All in all, it’s been great. We always download our pictures to the Synology NAS as permanent, backed up storage and now we can actually see all the pictures we’ve been taking! Because Kodi can read all the directories under a directory, you just give it the highest level directory you want and everything gets displayed (no matter how deep of a directly structure you have). If you want to change it, just go back to the little PuTTY program and change it.
Because I already had most of the items I needed for this project sitting around, the final cost for this project was under $30.
Appendix: Programming the Kodi/OpenELEC With PuTTY
As usual, working with anything Linux is an exercise in trial and error, Googleing, renewing old text file skills and dumb luck. Here is a rundown of what you need to do in order to get the picture frame to always start up with picture slide show:
1. The Pi can be accessed over your network from another computer. Since I’m in a Windows environment, I’ll address that.
2. First step on the Windows machine – download PuTTY.exe from www.putty.org. This is the communications tool between your PC and the Pi. There’s something called SSH in OpenELEC that handles the communications on that end.
3. Run putty.exe and enter the IP address of the Pi. This will open up a command line box that is used to enter commands/etc.
- UserID: root
- Password: openelec
- Basic Linux commands:
ls -all =listing of directory contents
cd [dir name] =change directory
cd .. =go up one directory level
systemctl restart kodi =this command will restart Kodi
4. “autoplay.py” file – this is the file that runs when Kodi/OpenELEC starts and tells Kodi what to do at startup – in this case it will run the slideshow from the directory. Note: The use of both back slash and forward slash is confusing. Be sure to use the same slashes as shown in my example.
a. Create the audotplay.py file
i. Use the cd .. command a few times to move up the directory structure to get to the point where the ls –all command shows \storage in the directory list.
ii. Now use the cd to climb down the \storage directory until you get to \storage\.kodi\userdata\ directory (you can only move down one level at a time).
iii. Type nano autoexec.py and it will open a new file that will get saved as autoexec.py.
iv. Enter the following command into this file:
Import xbmc
xbmc.executebuiltin("RecursiveSlideShow(smb://DISKSTATION/DiskStation/Pictures/2016/)")
- Note the direction of the slashes.
- The part that has smb://DISKSTATION/DiskStation/Pictures/2016/ describes the location of the pictures. A few comments:
- smb – you may need to set this in windows so it shares properly. Google for more information.
- DiskStation is how the Synology NAS shows up on my network.
v. Now use “cnt X” to exit the editor, then “y” to exit and finally hit the enter key to save the file as autoplay.py.
Simple, wasn’t it! No offense, but this is the reason you only see Linux OS’s on geek projects.