FREE SHIPPING WITHIN THE USA
30-Day Easy Returns 30-Day Easy Returns
Secure Checkout Guaranteed Secure Checkout Guaranteed
Free Shipping in USA Free Shipping in USA

Your Cart 0 Items

Shipping: Free
Sub Total: $0.00
February Project Feature - Two Projects to Inspire You

February Project Feature - Two Projects to Inspire You

February Project Feature - Two Projects to Inspire You

At Vilros, one of the most rewarding parts of our work is hearing about the incredible things our customers make. In this post, we’re highlighting two standout Raspberry Pi projects from the Vilros community. Whether you’re just getting started or looking for your next challenge, we hope these builds spark your imagination.

Project #1: PyMirror

Gregory Smith is a Vilros customer from Virginia who made a multi-functional wall display, complete with the time, date, weather information, and other display elements. You can view a video of his project here – https://youtu.be/dGK2Ln1uAog

Q: What inspired you to use the RPi in this way?

Quick Answer: RPi 02w had built-in wifi and HDMI plus ample memory and operating system for $15 - a bargain.

Originally I just wanted a large 7-segment display clock that would be in the same place on my wall. So often I want to know the time and other devices (like my Echo which switches the display from time to ads to current music played) make it difficult. Even looking at my watch can interrupt my "flow." 

When I priced such clocks they were $35. Since I had a cache of 16 salvaged 24" Viewsonic displays, I wondered if I might just put one on the wall and show the time - but how? That's when I thought to use a microcontroller. I remembered I had used a RPi Zero W to build a Magic Mirror project a few years ago. So I reached for the RPi Zero 2W. It turns out that Magic Mirror 2 needs a desktop and browser to run, which was too much for the poor RPi Zero 2W. So I decided to write my own version of Magic Mirror in Python - giving birth to PyMirror.

Q: What are your goals with this use case?

Quick Answer: To create a Magic Mirror 2 replacement that used minimal resources

At first I just wanted a clock. But as I thought about it I decided to expand to date, calendar, weather and news that I can gather all that information at a glance. It was important that the informationg be stable and in the same place every time I looked (so, not flipping between, say, the news and the date/time). I also wanted it to get at least 1 frame per second (to update the seconds). Finally, like Magic Mirror, I wanted it to be modular so adding new modules would be easy.

That's why I selected Python (instead of C) for the programming language. It was easy to add new modules just by reading a JSON file and "importing" the named module and then configuring it using arguments from the JSON file.

Q: What were some of the major technical challenges you overcame?

Writing to the Frame Buffer without a GUI desktop and all the wires.

There were two major challenges. The first was getting graphics on the screen. Since I wasn't using the desktop, I had to render directly to the RPI 02W'S HDMI frame buffer in-memory. There are python libraries that do this (like PyGame) but they've deprecate the ability to render directly to the frame buffer. So, I had to decode the frame buffer's memory organization and write code to send graphics directly to the RAM that was the HDMI frame buffer. But, since I was using Python, this was too slow to meet my 1 FPS goal. That's when I dropped into "C" and wrote a low-level function that took a Python 2-d array and 'bit-block-transfer' (or bit-blit) the array to the frame buffer memory. Finally, I wrapped the 'C' code with a Python function via "setuptools" so that it was callable from Python.

The other challenge was all the wires between the RPi 02W and the monitor. There was power for the monitor, HDMI/VGA, power for the RPi 02W, infrared controller, sound, and USB-on-the-go (for a optional keyboard). I had planned 4 of these "dashboards" on my wall and all those wires hanging around would be a distraction. So, I cracked open the Viewsonic to see if I could drop the RPi 02W in there. There was ample space, so I wired the display output directly to the VGA input, wired the USB-OTG directly to the monitor's USB hub, siphoned power from the monitor's 5VDC, and connected the sound output from the RPI 02W to the monitor's speakers. I went from 4-5 wires down to just one - power.

So in the end I not only created my dream dashboard, but also a iMac-like RPi all-in-one computer.

All because I wanted a clock on the wall.

 

Project #2: Keyboard, Video, Mouse Controller

Craig Keenan is a Vilros customer from Oregon who used the Raspberry Pi Zero 2 W to make a remote KVM (Keyboard, Video, Mouse) controller. 

Q: What inspired you to use the RPi for this use case?

A:  I am a fan of piKVM and that project is centered around the rpi series.  Recently the author has provided support for the rpi zero2w and I found that an intriguing idea. The Zero2 W has built in USB 2 OTG built in and would required minimal connections to work (power and USB keyboard could use the same cable)

Q: What are your goals with this use case?

A:  I am a fan of the piKVM software project.  I had previously built a custom RPi4 based piKVM and keep that at my desk to work on smaller things such as rpi and mini-PC projects.  However, I needed a more portable unit to use on site for my server and in my shop.  In addition, after helping a few friends and relatives rebuild their PC's over the phone this year, I realized that a small KVM would have been really useful.  I considered the Sipeed NanoKVM but was a little wary of the privacy issues with that product.  After doing some napkin math, I realized that I could build a piKVM based on the zero2 W at the same price and it would provide more flexibility.  Also, the small form factor would be cheap to send via snail mail and make it easier to setup for my friends and relatives. 

Q: What were some of the major technical challenges you overcame?

Ethernet - Since the zero 2W only has WiFi and piKVM is headless, it would not have been workable for my friends and relatives to set this piKVM up on their WiFi.  To counter this, I attached a SPI based Ethernet adapter to the rpi Zero 2w so they could just plug it into Ethernet on their router for initial setup.  The piKVM phones home once plugged in via VPN to an isolated sub-net on my home router and I can then contact it and setup WiFi remotely if required.  Getting the Ethernet wiring and drivers setup right was a challenge.

Software -  For the phone home feature I am using the Wireguard client to connect to my router from anywhere.  I first started with OpenVPN but after some research I decided Wireguard was a better fit.  It took a fair bit of research to figure out that the core clock determines the SPI clock speed.  I had to experiment with that clock speed to maximize the Ethernet performance - I have it running at 20Mbit up/down Ethernet throughput.

Form Factor - Fitting all of the hardware into this tiny case was difficult - there is a lot of hardware packed in there.  It took around 20 design iterations with Fusion and about 10 prints before I was satisfied with it.  Also, the soldering and wiring were difficult as things were quite small and cramped.  To make it serviceable, I also integrated connectors for the Ethernet, OLED status screen, and optional GPIO feature.

Some acknowledgements and thanks: