Raspberry Pi STL in a Box

Pi in a box, with a fire extinguisher...

I promised more details in the future about the Raspberry Pi STL build. Well, against all odds, I'm going to deliver!

 

The project exists purely to solve a problem with getting audio between two sites for a hospital radio station. They currently use a costly dedicated line that's purely analogue. Imagine the old fashioned exchange with patch cables everywhere and you've pretty much got the picture. Ok, I admit it's not quite that old fashioned, but a balanced line with "Post Office" written on the equipment doesn't really scream the height of modern technology.

 

To reduce costs and improve quality, we started looked at a number of other options. RF links of any form are pretty much a dead option thanks to the terrain between the two sites. It might only be three miles between them as the crow flies but there's a ridge in the way. There's no way we're getting anything near "line of site" between them.

 

That's pushed us to look at IP and ADSL circuits. We're planning to get one installed which this box will be plumbed in to.

 

And talking of the box, it's configured to pull a private webstream and fallback to an audio loop on failure. This is something a Raspberry Pi can do with little bother and detailed in this article about configuring LiquidSoap (the software we're using). LiquidSoap and webstreaming was chosen over OpenOB as the station is already generating a private stream in 64k AAC+ and we needed the fallback feature.

 

But that doesn't explain why I've gutted an old equipment box headed for the bin rather than just directly installing the Raspberry Pi. There's two reasons for that. Firstly, we need the audio output to be electrically balanced. While something like an Alice Matchpak could have been used, it's yet another box that has to be supported in a remote location.

 

The second reason I've built this box is that it's going into a remote location the station has limited access to (someone else's racks room). Simple metering and a 16x2 LCD display provide information that can be relayed to us over the phone if something goes wrong. I doubt many engineers will struggle to understand a display that says "!!!ON BACKUP!!!" along with "No IP Address!".

 

The LCD display is in reality a PiFace. That in turn is fed data by a script that is constantly running on the Pi and monitors the LiquidSoap log file. It also pulls data from the MusicStats service to provide a "now playing" display. Not a necessary feature but it does prove the system is still alive and has a network connection.

 

In case you ever need anything like this youself, here's a copy of the script that's currently in use. Well, with all the sensitive bits edited out.

 

Metering is provided through a pair of LM3915 LED meter drivers and balancing is provided by a pair of SSM2142 chips. Admittedly it's probably cheating to use these but it keeps the circuit simple.

 

Anyway, enough of the words - time for pictures. First of which is the circuit diagram for the audio side of things. Click on it to see the full scale version in a new browser tab.

 

Circuit Diagram

 

 

I'll warn you before we get to the internal pictures, things are a bit messy. I've never been too good at making things look neat. That said, the fire extinguisher in the cover picture is there as a joke. I swear...

 

Anyway, here's a shot of the audio circuitry. I did warn you it would be messy:

 

Audio Circuitry

 

Now for the brains of the operation, the Raspberry Pi:

 

Raspberry Pi in a Box

 

We can't forget the PiFace, solidly glued onto the front panel:

 

PiFace bathed in Glue

 

Things are a bit tight in that box. Thankfully it all works OK and heat isn't too much of a problem (the various air holes in the box help with that one). As proof, here's some fine music from the homeland playing on the station:

 

Proclaimers - 500 Miles

 

And before you ask, yes, the text does scroll.