Finding a suitable case

Bush were an early UK electronics company and the DAC90A, brought out in 1950, is the classic vintage radio set. Made from Bakelite, it emanates a warm orange glow from the glass tuning panel that brings to mind clipped British voices bringing news of royal controversy and overseas conflicts. Twisting a dial through bands of static would allow you to discover glimpses of upbeat rhythmic tunes from across the Atlantic from artists with exciting and unfamiliar names. 

I lurked in many eBay auctions looking for the right radio at the right price. I wasn’t worried about it being in working order - just that the Bakelite case wasn’t badly damaged. I eventually got lucky and picked up a good example for £35 (+£12 delivery).

The inner workings of the radio didn't look to be in bad condition, but I wasn’t interested in trying to get them working - I didn’t have the skills or tools either. There are some people who do restore vintage valve radios, but I simply wanted to remove the innards and make space for my new podcast player.

I did offer the removed workings to a repair shop, but I guess these radios are so popular that spares are relatively easy to come by, so I put them in a box, where they stayed until getting culled in a garage clear-out. I think I still have a couple of the valves somewhere.

This is a point of regret on the project. Once I’d got the radio case, I didn’t take many photos to track the project. The ones I have seem to be from before I started and after I’d finished. 

Replacing the back panel

You might notice that the power cable had already been ‘upgraded’ to a modern pvc cable wired directly into the radio tuner. Clearly I would need to replace this and would need some kind of power socket. With no external metal parts, a two pin ‘figure 8’ power connector would do the trick. According to Wikipedia these are officially and IEC C7 and are intended for “Domestic audio, video, radio equipment and doubly insulated power supplies”. Perfect.

However, I was not confident in the cardboard back panel of the radio being strong enough to support the power socket - especially when pulling the cable out. So my first task was to make a new back panel. Luckily a friend, and local hero James Wallbank, had just started up a Maker’s shop and offered lessons in using his laser cutter.

It didn’t take too long to scan the radio case and trace it in Inkscape. James very kindly took the Inkscape vector files and turned into a laser cut path file. There was quite a bit of stuff he had to check - making sure that there were no double cuts, ensuring the cuts are in a sensible order. He then applied his optimised settings for the power and speed of his laser cutter to ensure that the 3mm plywood sheet we were cutting actually cut through, but didn't scold too badly.

My back panel design cut some air flow holes, which probably wouldn’t be necessary, but they kept the general feel of the original cardboard panel. Plus I added cut outs for the IEC-C7 socket and a power switch.

The electronics

With the case now in fairly good order, I had to consider what I’d be putting inside it. I figured that with no display to speak of, I had no need of a desktop operating system. So the newly released Raspberry Pi Zero would probably have enough umph to download and play some mp3 files. However, Raspberry Pis have notoriously poor audio output, so I picked up a pHAT DAC audio ‘hat’ card from Pimoroni (local Sheffield provider of electronics kit and pirate themed awesomeness).

The pHAT DAC would provide a good quality stereo audio signal (although I only needed mono), to some sound I needed a speaker and an amplifier. For the amplifier I picked up a nice cheap bare circuit “DIY” 15W amp for under £5.

The speaker was a simple 6.5 inch car speaker. The tricky bit was finding one that was a sensible cost. Clearly car speakers are somewhat a connoisseur item, but I didn;t need a pair of 600W mega Kenwoods to make the door panels thump in the car park. The best I managed to get was a 300W mid-bass for £12.50

The amp had a volume control that I could expose through the side of the case, but I still needed to work out how to provide other controls for the podcast player - for things like selecting a podcast to play, pausing, and skipping the podcast back and forward.




To allow me to control these things I ordered a pair of 12mm rotary encoders. These useful inputs will allow me to detect clockwise or anti-clockwise rotation plus a click action on the end. They are great for menu selection type of controls and they would fit behind the 2 front panel knobs.

The only thing I then needed was a suitable power supply. The Raspberry Pi and pHAT DAC required 5v, while the amplifier needed 12V. I could’ve bought a 12v PSU and added a 5v regulator to power the Pi, but if the Pi/DAC was to start drawing its peak power consumption then the regulator might need a heat sink. This felt like a bit of a faff so I decided to find a dual output (5v + 12v) power supply. These are rarer but not difficult to find on AliExpress or eBay.

 

Having taken the insides out of the radio, it would now not give off that lovely warm orange glow any more. Nor could I use the tuning indicator (basically a reflective stick attached to a wire) that showed what frequency the radio was tuned to. Instead I figured I could use a strip of addressable RGB LEDs (WS2812s or neopixels). I wasn’t entirely sure what I would show using the LEDs, but I wanted to make sure I could drive them from the Raspberry Pi’s GPIO pins. These ‘neopixels’ require a 5v power supply, but weirdly, you need to drop that to nearer 4v to drive them from the 3.3v signal from a Pi GPIO. Rather than use a regulator, it’s normal to do this by powering the neopixels via a 1N4004 diode connected to the 5v supply. The diode introduces a 0.7v drop, so the neopixels get 4.3v, which is about right to get 3.3v signals to work reliably.

Connecting all these items together needed some careful thinking. The Raspberry Pi and the pHAT DAC are designed to sit on top of each other, using the GPIO header pins on the Pi to plug into the header socket on the pHAT DAC. However, I needed to connect the power supply, the rotary encoders, and the LED power and signal to the Pi too.


Long-legged header

I opted to use long legged headers instead of standard header pins on the Pi allowing me to build a ‘connector board’ with screw terminals that could then sit on top to create a triple-decker of small boards.

photo of the connection board

To be honest, on my first go at this, I put the long-legged headers on the connector board and put it in the middle. I quickly realised that this meant I had to pull the boards about to access the screw terminals - not ideal. Desoldering the headers was a bit of a pain, but totally worth doing.






Connection list

GPIO

function

+5V

from PSU

GND

From PSU

-

+4.3V to Neopixels

GND

GND to Neopixels

GPIO12

DATA IN for Neopixels

GND

to right rotary

GPIO17

right rotary A

GPIO27

right rotary B

GPIO22

right rotary push-click

GND

to right rotary

GND

To left rotary

GPIO10

left rotary A

GPIO9

left rotary B

GPIO11

left rotary push-click

GND

to rotary

GPIO13

unused

GPIO19

unused

GPIO26 (with ext pull-up to 3.3V)

reset button

GND

To reset button

3D printing

With all of the electronics connected and the case empty, it was time to reconstruct the radio. As I didn’t want to make any more holes in the lovely Bakelite case, and with limited mounting points available inside the case, my options for fixing my new electronics inside were limited. The speaker simply replaced the existing one, but for the other parts I resorted to screwing them to small pieces of wood and then hot gluing the wood to the inside of the case. I used PVC water pipe to mount the rotary encoders inside in a way that would still give me access to the knob screws. Hey don’t judge me - it worked.

I then set about writing some software to:

And this is where the project stalled - as a lovely looking radio (if you ignored the wood/hot glue monstrosity inside that didn't work very well or reliably. To be frank, it would’ve looked as nice if I’d  put it on my desk as I’d bought it from eBay - in fact a bit better as it might’ve still given off a nice orange glow.

8 years passed until 2021 and I’d been working through my list of unfinished projects during the various pandemic lockdowns. It felt like time to revisit the Piradio. But this time I could do better. Mostly because in those 8 years I’d bought myself a 3D printer.

My plan became to get rid of the wood/hot glue and tidy the whole thing up, then tackle getting some software written. So once again I ripped the insides out, peeling back the hot glue, pulling away the PVC piping (which was still incredibly well fixed) and unscrewing the electronic parts from assorted lumps of wood. Yet again, I failed to take any photos of the setup in its wood/hot glue format - perhaps some kind of subconscious embarrassment was happening.


Volume knobMy first job for the 3D printer was to create a new volume knob. I’m not sure what had happened to the original Bakelite wave band (MW/LW) selector knob from the side of the radio. My first photos just show a hole in the case, so I suspect that it was already missing when I got the unit.

Just an hour in my favourite CAD package late and I had a fair approximation of one of the front panel knobs. Even in black plastic it looked like it belonged.

The mounts for the rotary encoders on the front of the radio were much harder to model as I had nothing to copy. Also I needed them to fix firmly enough to the case that the push button action on them wouldn’t work them loose. 

I decided on an external flange/sleeve design with a screw-in piece to allow me to fit the encoder once the flange is snuggly in place. The hole in the side is to allow access to the knob screw that fixes it to the encoder shaft.

I haven’t 3D printed screw threaded part much before and it took some trials (and mistakes) to get the tolerances loose enough to allow it to tighten up.

Towards the upper rear left hand side of my radio case there was an additional hole. It’s not clear to me if this was original or an alteration by a previous owner. I decided to utilise this hole to provide a ‘reset’ button in case my software needed to be restarted. It felt a bit better than using the traditional way of restarting a Raspberry Pi of turning off the power for a few seconds. 

This turned out to be the trickiest part to design. I went for a threaded tube with a flange. This was fixed in place by a threaded nut (with a small turning arm to help tighten it by hand). Through that tub I inserted a button shaft (not actually in orange) held in place with a cover nut. 

The small (PCB mountable) momentary push button could then be inserted into the side of the nut which was then tightened until the button shaft met it. A push on the button shaft would then actuate the momentary push button inside the nut. 

Mounting the triple decker set of Pi+DAC+connector boards was also going to be tricky. I figured that if I could print something to wedge between two of the inside lugs on the case that had the fixing holes in them, with the help of a little hot glue (I know) it should be stable enough. As these were right next to the hole for the volume control, where the amplifier had to sit, I decided to create a cradle for all these boards.

While the amplifier had some mounting screws that I could fix it down with, I wanted to mount the Pi assembly vertically so I had easy access to the screw connector. So I designed a spring clip mechanism to hold on to the pin headers on each board. I always have difficulty with printing clips like these and sure enough most of the clips have already snapped, but the friction fit between the board headers and the cradle seems to be good enough.


The board cradle - a snug fit

The ‘legs’ to hold the board cradle in place took a bit of trial and error. Fitting to existing curved surfaces is more a matter of judging by eye and adjusting than measuring. I went through 2 cycles of printing a thin template leg to check the fit. Even after I thought I had it right and printed 3 full thickness (6mm) legs they needed a bit of filling in order to fit in. However, they snapped into place so firmly around the Bakelite lugs there was no need for any hot gluing.

The only bit of 3D printing left to do was to mount a long strip of neopixel LEDs behind the glass tuning panel. I wanted to achieve that warm orange glow look rather than a sharp, pixelated digital display, so that meant diffusing the light from the LEDs somehow.

The original radio does this by using a white(ish) plastic sheet behind the glass. This also gives the tuning indicator pointer (actually called the ‘cursor’ in the service manual) something to contrast with. I decided to reuse that plastic sheet as my diffuser.

Luckily the case had 2 screw holes originally used to hold clips for the glass panel. This allowed me to design a mount to hold a strip of four 8 LED neopixel strips, the plastic diffuser and the glass panel.

My first iteration of this only included a strip of two 8 LED neopixel strips, but as they are only 50mm long, they didn’t give an even glow across the whole glass panel.

The software

With the hardware complete, I could move on to developing the software. Of course it didn’t quite happen like that, I was developing the software as I went - mostly while the 3D printer was running, but let’s pretend that I did everything in a neat and methodical order.

I’m far from the best programmer in the world. Compared with most of the developers I’ve ever worked with, I’m barely adequate. I’m slow and lazy. So when I do write code, I have some principles I like to apply:

These principles lead me to choose Python as the primary language. Mostly as some of the tricky stuff I needed to do was interface with the rotary encoders, buttons and neopixels via the Raspberry Pi GPIO. Support for these things is more mature in Python than other languages so it made struggling with the Python syntax worthwhile.

Unfortunately, good support for rotary encoders and neopixels comes from two different Python libraries. The gpiozero library deals with input devices in the event callback way that I like, but the support for addressable LEDs like neopixels (or more generically - WS2812) just isn’t there. This meant I had to also use the CircuitPython libraries, which are great for interfacing with serial bus (I2C and SPI) connected devices. More moving parts, but much less code for me to write, so a sensible tradeoff.

The pHAT DAC is based on an I2C connected device, but Pimoroni (still) provide an installer that means that it just works as via the standard Linux tools. I did find that in order to have multiple voices mixed on the pHAT DAC audio (rather than getting a ‘device busy’ error message if I tried playing two things at once), I had to follow this advice from the HifiBerry people on mixing different audio sources.

I took some time to work out which command line audio player I would need. It was important to avoid anything that provided a GUI as that would likely mean installing the X11 libraries. I wanted a CLI only mp3 player that would allow me to:

I ended up settling on mpg123. After some experimentation I found that using the Python pexpect library allowed me to send key codes to the running mpg123 process and capture the output.

Finding a service to allow me manage a podcast list turned out to be a lot easier than when I’d looked 8 years ago. Within a couple of google searches I homed in on ListenNotes. Not only is it free for the level of use I was expecting, but they also provide an API and have a python library - more code that I wouldn’t need to write. 

Rather than use a database server to maintain the list of podcasts and episodes downloaded via ListenNotes, I used the filesystem to maintain the state of the podcasts.

Interface

The radio has 4 primary controls:

Volume

The volume control is a part of the amplifier and presented on the side of the radio. The Raspberry Pi can also adjust the volume (of its pre-amplified signal), but providing another user control for this felt superfluous.

Left rotary encoder/knob

The left knob will continue to work even when a podcast episode is playing. The titles of the podcasts and episodes will be spoken over the top of the audio of the playing episode.

Right rotary encoder/knob

The right knob allows the user to control the currently playing podcast episode.

Reset button

The ‘reset’ button on the side of the radio does not actually perform a reset of the Raspberry Pi. 

Wrapping up

After just 8 years I now have a lovely retro style podcast player for my study.  While not perfect, I do find it much nicer to listen to podcasts on rather than a using Spotify and pair of head phones. 

It has a warmth that make me feel that I am listening in to a conversation happening somewhere close by. 

There is still much to do - a few bugs and a long list of improvements, but I'm now happy that it can keep me company while I'm working on my next project.