10 uses for Raspberry Pi Zero, part 1
Raspberry Pi Zero, a tiny (65 mm × 30 mm) $5 computer (!!!) that was launched in November 2015 is gaining popularity and is constantly sold out from all suppliers. I was lucky to get my hands on a couple of these tiny but powerful boards and wanted to share some ideas of what you could make with them.
The latest revision of Pi Zero, v1.3 has the following specs:
- 1Ghz, Single-core CPU
- 512MB RAM
- Mini HDMI and USB On-The-Go ports
- Micro USB power
- HAT-compatible 40-pin header for interacting with PWM, I2C, UART interfaces.
- Composite video and reset headers
- Raspberry Pi Camera port
This little board can run Raspbian distribution of Linux out of the box and has enough juice to be used in multiple applications. Here are some of the ones I would pursue, in no particular order:
1) Run a web server.
Zero is capable of running almost any modern web server software. Serving web pages, connecting to databases, using WebSockets are all possible on Pi Zero. NodeJS, Nginx/Apache + PHP, Python (and multitude servers based on it) and more are supported and are really quick to install. Here are some guides that you can follow to install these servers:
- To install NodeJS on Raspberry Pi Zero, follow this guide: http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
- To install Python with Flask server, follow this guide: https://www.raspberrypi.org/learning/python-web-server-with-flask/
- To install PHP with Nginx, follow this guide: https://www.raspberrypi.org/documentation/remote-access/web-server/nginx.md
When you have a server installed, you can run any of your favorite frameworks like Laravel, KoaJS, Adonis, Hapi and many more to make REST APIs, add authentication to access data, create some dashboards and interfaces and anything else a server can do.
While Pi Zero will be enough to process a few simultaneous clients, perhaps you wouldn’t want to host the next Facebook on these tiny boards. Pi Zero does not have ethernet on board so your throughput will be limited to the speed of WiFi dongle or if you are using USB -> Ethernet adapter, the speed of the adapter and USB bus.
There are many more servers and frameworks that will work with Raspberry Pi Zero and listing them could be a post of its own, perhaps you can write some of your favorite choices in the comments?
2) Connect other IoT devices with MQTT
MQTT is a popular messaging protocol for connected devices. With this protocol you can set up a network of devices that can talk to each other via PubSub. This is extremely useful when you want to control groups of devices at once or route specific command to specific device. One great example of using MQTT is connecting cheap WiFi connected boards based on ESP8266(like NodeMCU which is $9 on Amazon) to a broker running on Raspberry Pi.
Here is a guide on how to install MQTT on Pi Zero: http://mosquitto.org/download/ and a complete guide how to connect ESP8266, Raspberry Pi and Arduino together via MQTT: https://www.baldengineer.com/mqtt-tutorial.html
3) Put it on a drone
One of the coolest uses for Pi Zero is to do some useful work on a small aerial vehicle. Pi Zero weighs only 9 grams and doesn’t consume a lot of energy when no USB devices are plugged into it so it could work for a few hours using drone’s battery. Moreover all speed controllers these days provide stable 5V that can power Pi Zero without any step up or step down converters. Some of the potential uses would be:
- Gathering useful data like GPS coordinates, storing readings from accelerometers and gyro, measuring velocity and altitude.
- Recording video with Pi Camera which is 8 Megapixel camera capable of 1080P at 30FPS even on this tiny computer.
- Combining useful data and transmitting it as On Screen Display in real time over video transmitter like Eachine TS 840. Pi Zero has built in analog TV Out so it is plug and play without any adapters (you can see where those pins are on a pinout picture from Adafruit).
- Using 2 cameras at once to preprocess and transmit VR-like video.
- Using 4 cameras and 4 Pis to live stream 360 video from the drone.
Some people even go as far as using Raspberry Pi as flight controller which I would not recommend due to the nature of OS interrupts and various possible errors that can occur mid flight. In my opinion there are plenty of dedicated flight controllers that are doing an amazing job and while making your own flight controller is interesting, it is not adding value to the existing ecosystem.
I have started a project where I actually did put the Pi Zero on a Drone and turned it into FPV OSD system. Read up on it here: https://hackaday.io/project/12450-raspberry-pi-zero-fpv-camera-and-osd and check out a video captured from Pi Zero in flight:
4) Make a smart art frame
Smart frames will be in every house when battery/remote charging gets better along with displays that take less power to run. Why wait another 2-3 years and spend hundreds of dollars when you can use Pi Zero to make a smart art frame today? It literally takes about 30 minutes to install software on Pi Zero that changes what artwork is displayed and can display not only static images, but videos and GSLS shaders. Surprisingly, Pi Zero has some serious GPU for such a small board and can play high definition video without lag or even display intense animations made with OpenGL.
One of the existing open source projects that allows you to do just that is Openframe, a platform for displaying art. It provides easy installation instructions here and has a nice webapp to control what artwork is displayed on your frame. What intrigues me the most is support for GSLS shaders which can be pretty powerful and easy to write. For example, you can display something like this in no time:
— PatricioGonzalezVivo (@patriciogv) May 21, 2016
And here is a video from me, confirming that Openframe works on Pi Zero, outputting a GSLS shader to a huge TV:
— Maks Surguy (@msurguy) May 28, 2016
I bet a lot of shaders from ShaderToy would work on Openframe with minor modifications. Don’t know about you but I’m eager to write a simple shader and upload it to my openframe library right now.
I tried playing beautiful videos from http://www.coverr.co/ and they played without any delay, making Pi Zero ideal candidate for looping ad displays or brand presentation device at the entrance to your office.
One of the potential problems with smart art frames is that they need wires to operate due to high wattage of the screen. A company called Acanvas solved this problem by using a cord that unwraps at night and charges the frame to operate in the daytime. This is a brilliant solution that is worth investigating if you want to build a smart frame without losing visual appeal.
PS, somebody should create a product that is like Pandora but for artwork displayed on your smart frame!
How to get yourself a Pi Zero:
There are a few ways to get yourself a Pi, Pi Zero to be exact. You can check Adafruit’s Pi Zero stock, including the kits that come with it, and sign up for email notifications: https://www.adafruit.com/categories/813
Somebody made a clever dashboard that checks the stock for Pi Zero across multiple websites: http://whereismypizero.com/
What’s sad is that shipping or any accessories for this computer is actually more expensive than the computer itself. Also, some people associate the name “Pi Zero” with its availability, zero in stock, though the situation has been improving and I expect these boards to be more widely available within next 1-2 months.
My advice is to sign up for email notifications from all resellers, be patient and act quickly when you get an email about board’s availability.
Read Part 2 of this post at https://maxoffsky.com/hobby-blog/10-uses-raspberry-pi-zero-part-2/