Volumio based radio with NFC
Background
Inspired by the extreemly good looking Spotify Box and QR based systems like Audiosphere, I wanted to make something similar for my kids. I’ve earlier built a few radios based on small, cheap bluetooth speakers like music angel, but wanted something with better sound this time.
Prototype
QR are fast and cheap, so I made a quick prototype. It turned out they are unreliable when there’s no display to give feedback on how the camera sees them. Both lighting and focus was a problem.


Next up, NFC. I decided on a PN532 NFC reader, simply because I had one around. They’re about $8 / 70 NOK on ebay. It communicates via i2c, and there’s a python library for it. I decided to make it easy for myself and allow for any kind of NFC tag I could get hold of, so the plan was to read and use what ever data or ID the tags contain, and make a list to match IDs and URLs.

Volumio
Volumio is a general music player for small devices like the Pi. Due to Mopidy it supports playing music from lots of sources. The two I’m interessted in are internet radios and Spotify, but this will work for anything Mopidy can play.
Volumio also has plugins for other stuff, like mono output, being a Spotify Connect speaker and button controls connected via GPIO like I will use here.
Setup
As mentioned in the readme, there are a few steps to install NFC support. You have to enable SSH first. Then install packages, check that the i2c connection to the reader is working, enable services.
Reading a tag looks like this:
$ ./readnfc.py
Reading tag list readnfc.list
6 tags in store. Ready to read.
Card data: bytearray(b'K\x01\x01\x00D\x00\x07\x04!T\xcao?\x81') / 4b010100440007042154ca6f3f81
Stoping any music currently playing
Play audio feedback.
webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
Play selected source webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
Then you add that tag to your list, readnfc.list, in the same directory. There are lots of examples for radios and spotify playlists in it already. Restart the service and you should be done.
See demo video (~4MB).
Hardware
For sound I connected a cheap USB soundcard (first hit on ebay), via a ground loop filter to a Class D amplifier, to the terminals of the speaker.
A 1k potmeter for volume, and two push-buttons for play/pause and next.

