People still ask me to explain the difference between an Arduino and a Raspberry Pi. Lay people, business-types, suits and even a few techies have trouble getting their heads around this whole “microcontroller” thing.
Wearables are an area where the difference is stark between the two boards. Pi and nano-Linux based wearables have something the Arduino powered devices certainly lack: Applications!
There aren’t any applications on Arduino wearables, just the firmware. That’s a huge difference and one that most people understand.
In contrast, nano-Linux-based modules, like the Raspberry Pi or CHIP computer, gives you absolutely “exotic” wearable project super powers. Applications, whether from the Linux community or of your own design, makes adding new features, behaviors and capabilities to your techno-fashion device a snap. Once you embrace the application lifestyle on a headless Linux machine, an entirely new world of wearable possibilities will appear right before your very eyes.
A Steampunk Conference Badge
Take the case of my steampunk-themed “Conference Personality Identification Device.” I dreamed up this badge as a way to attract attention and recently wore it while running “Stackie,” our pancake robot, in Berlin.
Widely recognized as a lowly conference badge, this unassuming DIY gadget sports a first generation Raspberry Pi, 1.8” color TFT display, a tri-color “Ozone Tube” mashed up into a gaudy, over-sized brass and leather wearable package. The display part clips to the lapel on my jacket and has an antique-looking cable that runs down to the Pi in a little belt holster. The 5-volt auxiliary battery tucks away into a pants pocket and attaches to the Pi via a thin USB cable. A recently updated release of Raspbian Linux resides on the 32 GB Samsung micro-SD card.
The physical badge definitely stands out. Under the surface, there’s a full-blown Linux computer capable of amazing feats.
How about Movies?
One interesting thing the steampunk badge does is run full-motion .mp4 videos on the little 64K color LCD display.
The badge easily plays 110+ MB files without any jitters, skipping or pixelizing. My 2-minute looping “Dr. Torq” promo video is only about 4MB in size. The Pi doesn’t even break a sweat with that one. If there’s an audio track on the video, it will play as well. Syncing with the video is sometimes a little off, though. Fine tuning the video and playing around with the settings in MPlayer might eliminate the issue. I haven’t spent a lot of time debugging audio/video syncing. Here’s the command line.
pi% mplayer -ni -loop 0 -vo fbdev2:/dev/fb1 -x 160 -y 128 -zoom -flip -vf rotate 1 /home/pi/time-for-choosing.mp4
If I want a different movie, I just transfer the video to the Pi and run MPlayer with the new file. The MPlayer is a framebuffer-capable application available in Linux and that works great on the badge.
The “Dr Torq” promotional video, shows some of my Steampunk gadgets, along with title and contact sequences. I used kdenlive on my ASUS Linux notebook to create the movie from still shots. Various video filters are used to give parts of the video an antique, scratchy movie look characteristic of a late 1880’s Steampunk theme.
With some imagination, you could run different videos at different times of the day (through cron perhaps) or set up some push-buttons to step through a list of files. Hit another button and the video would be selected and played. These jobs lend themselves to standard shell scripts.
“Hey, Doc, pulsing LEDs on a Pi is pretty basic.” You, sir, are correct. Try doing it on an Arduino, with a general purpose programming language like Python. You can’t.
On the steampunk badge, the mysterious “ozone tube” is nothing more than a tri-color LED with a few current limiting resistors hooked up to three digital outputs on the Pi. A Python script initializes the pins, then gently changes the pulse width up and down to make a color cycle in and out. The ozone4.py program occupies 42 lines of code, a third of which is comments. You can think of it as a homebrew application that runs on the badge.
We could run scripts with hundreds or even thousands of line of code if we wanted. You could make some pretty complicated DIY wearable applications, with a thousand lines of code. The Pi would run it without a whimper and then ask for more.
Heck, for that matter, you could run multiple Python programs simultaneously, if you wanted. We’re still talking about a conference badge that you wear on the front of your jacket.
You don’t even have to stick with Python. Plenty of other programming languages and platforms are available with a simple apt-get.
The Connected Badge
Connectivity is another super-power of the Steampunk badge. Just plug a tiny EdiMax WiFi module into an open USB port and the badge can connect to a LAN.
I use rcp to transfer the videos I make with kdenlive from my Linux notebook to the badge. Writing and tweaking the Python code is a snap over ssh as well. You really only need to hook up a big screen, keyboard and mouse for the initial Pi and WiFi configuration. After that just logging into the badge is a no-brainer and you can do just about anything you want from the command line.
On an early badge, I used to have a DS18B20 digital temperature sensor. It isn’t currently implemented on the Pi powered badge.
Something you could do with sensors, such as the DS18B20, is periodically send its data up to the Cloud using MQTT. Perhaps, tracking the temperature in the room would be a useful metric to capture and sending the data from the badge would be pretty easy, since it’s networked.
You could also go the other direction and send data from the Cloud down to the badge. Maybe a scrolling text line on the display, updated in real-time from a server somewhere would be cool. MQTT is great for one-to-many two-way communications and perfectly suited to messaging with wearables.
Wearing Your Applications
Wearables are primitive right now. We’ve only begun to scratch the surface of capabilities for useful gadgets. Applications on nano-Linux systems are the key to unlocking wearable technology.
It takes quite a shift in thinking to effectively start harnessing the power of wearable computing. Applications running on a little chip pinned to your lapel are just the beginning. A year or two from now we may have an altogether difference concept of wearables, as the nano-Linux technology matures.
What applications will you be wearing, next year?