Florian Amrhein

HMV 682

This is about the updated version of my first radio project. If you want to read about the original version which was based on an Arduino UNO, please click here.

This is a nice internet radio I built. It can tune into internet radio stations from all over the world. It's built into the case of an old valve radio and the controls work pretty much the same way they did in radios back then.

Video



Hardware


Vintage valve radio

I bought an old radio off eBay. It's from the 30s and was manufactured in the UK by "His Master's Voice"

I removed the old electronics and speaker, and left only the wooden case.



Laptop

The core of the radio is an old 12" laptop. I removed the LCD panel from the casing and fitted it with the laptop in a wooden frame. The 12" panel is a bit too large for the 8" window, but it still fits in the radio case. The UI of the software only uses the visible part of the screen.

Controls

The radio is controlled by several controls which are connected to an ATMega328 micro controller.


Resistor ladder for the rotary switch. Supports up to 11 positions.

  • A potentiometer for tuning
  • Another potentiometer for volume.
  • The volume potentiometer has an in-built switch which activates when you turn the potentiometer to the far left. It acts as a power switch. The software on both the laptop and the micro controller take care of the actual power on and shutting down procedures
  • at the bottom left is a rotary switch with 4 different positions. It is connected to a resistor ladder and then connected to an analog input of the micro controller. You can switch between different "bands" (pages) of radio stations using this knob.
  • The knob at the bottom left is a rotary encoder. It is currently not used, except for the button that activates when you press the knob. The radio will then show some statistics about the currently playing song, like its name and bit rate.

Sound

The built-in sound card of the laptop was bad quality, so I decided to buy a USB sound card from Creative. It's the white box below the USB hub

Amplifier

I bought a cheap amplifier and two equally cheap speakers from eBay. They were originally meant for cars.

The photo shows the frame with the electronics (left side) after it was inserted into the radio. The amplifier and the speakers are on the right side.

Fan

The laptop usually doesn't use its fan at all. But on a hot day, or if a lot of cooking is going on in the kitchen, it might start. Since it is quite broken it produces a very loud and nasty noise. I added large fan in front of the laptop and automatically switch it on when the CPU gets hot. This keeps the radio silent.

Issues like this are reasons why I don't think that using a laptop is a great idea for such a project. But I couldn't find a affordable 8" screen for a Raspberry Pi, while I had an old laptop laying around.

Power


Relay, connecting fan and amplifier

There are currently two PSUs in the radio, connected to a simple extension chord:

  • PSU of the laptop
  • some PSU I got from ebay, powering the amplifier and the micro controller.

Laptop, amplifier and fan are connected to relays that are controlled by the micro controller. Fan and amplifier are powered on and off when needed: Fan turns on when the temperature of the CPU gets too hot, while the amplifier gets activated when music is playing. The amp will get turned off some time after the music has stopped.

For the laptop, micro controller and software on the laptop work together:

  • When the laptop is off, and you want to turn it on by using rotating the volume button a bit, the micro controller will simply activate the relay and the laptop will get power. The micro controller will detect that the laptop is actually turned on by measuring the voltage on the USB port. If the laptop doesn't turn on, the MCU will turn power off again, wait a bit, and try again. This is necessary because the laptop refuses to turn on if it wasn't switched off for at least a couple of seconds.
  • If you want to turn the radio off while it is running, it works a bit different: The MCU just tells the laptop that the power button was turned off. The UI will then turn black to give an indication to the user. For the next 30 seconds nothing happens, unless the user turns it on again - the UI will be visible again an that's it. After 30 seconds, the laptop will do a shutdown -h and switch itself off. The MCU will detect that there isn't any power on the USB port any more, and switch off the relay

I measured the power consumption:

  • when in stand by, which means that only the MCU and its PSU have power, the radio consumes about 1.3 watt.
  • when the laptop is powered on the whole radio consumes about 22 watt.
  • while music is playing, so the amplifier is switched on as well, the power consumption rises to about 27 watt.

Software


Main UI

The laptop runs Debian and a the Music Player Daemon (MPD). The UI is written in C and SDL. The UI gets the information about the controls from the micro controller by USB.

Micro Controller

The program on the micro controller reads out the information from the controls and sends an update via USB to the laptop if something has changed. It uses the v-usb library to handle the USB connection, so no additional chip is needed for USB.

More Pictures


HMV logo on the top side of the cover


Boot logo


Text on the inside of the case