I saw this tired, dirty, unattractive 1960s radio in a thrift store and I just had to buy it to see if it could be modernized into something interesting.
I like to retrofit old electronics with modern components and this clock radio presented a real challenge! In addition to a major cleaning, it required a lot of updates. Basically nothing on the inside was salvageable. Although the clock worked, its motor had started to overheat at some point over the decades and was starting to melt the plastic case from the inside out. The radio sounded OK, but it used a tiny speaker with poor sound quality.
My goal was to achieve the same or better functionality as the original unit but with modern components. First, I removed all of the old internal electronics. Then I designed and 3D printed various brackets and frames to hold all of the new components in place.
A 3.5 inch LCD HAT attached to a Raspberry Pi 4 fit nicely in place of the old clock. To easily add FM radio functionality, an RDA5807 module was added. It's an entire FM radio with RDS on a tiny chip that can be controlled via I2C which is connected to the Pi. A MAX4544 analog switch module allows the audio to be switched between the Pi's audio out and the FM module audio out. A Pi GPIO controls the switch, and its output feeds a TPA2017 audio amplifier. The speaker was replaced with a better one of similar size.
The top of the radio had a large snooze button with a long plunger that manipulated mechanical parts in the old analog clock. With that clock gone, I still wanted to use the very cool looking button, so I added a clicky game switch on standoffs that makes contact when the plunger is pushed down. That switch is also wired into one of the Pi's GPIO pins. A nice USB-C panel jack for power is also mounted on the rear of the unit.
I wanted to show a lot of active content on the screen but I did not want to code an entire user interface, so I decided to just display the output of a web browser. My Python code establishes a WebSocket connection to an onboard web server, allowing the button presses detected by the GPIO pins to manipulate JavaScript code in the browser.
Like most of my projects, the various functions run in separate containers on the balena platform.
- The audio container uses the "audio block" to take care of routing audio in Linux when using containers.
- The browser container uses the "browser block" to display any URL on a connected screen using X11. It exposes an API for switching the URL which is used by the controller.
- The controller service is some simple custom Python code to tie everything together: it reads and writes to the I2C devices and the GPIO pins to control the radio, audio switch, amplifier, rotary encoder and buttons.
- The fbcp service runs the "fbcp project" that takes care of driving the LCD from the output of the browser.
- The slot service is a simple Node/Express web server that hosts all of the internal pages and connects via WebSocket to the controller. It's named "slot" because one of the new features is an HTML5 slot machine game activated by the large button on top of the unit.
To pay an homage to the original clock, I scanned in its face before removing it, and used it as a background for the animated JavaScript hands that were superimposed over it. Here are some screen shots of the new applications running on the device, which are all controllable by the various buttons.
There's still plenty of features to add as time permits, but since the unit is now software-controlled, it's just a matter of pushing updated containers to the device's Pi. I can even change the functions of the various buttons, which was impossible when they were hardwired and mechanical!
Comments