Web Radio

I've had the intention of building a web-controlled radio for a few months now, though it took me a few false-starts to get working.

Originally I was going to use an RDA5807M module, but that turned out to be too small to easily solder to anything! Once I did get the damn thing connected the performance was terrible; it couldn't even drive headphones un-aided.

My second attempt was to use an Si4703-based evaluation board. This was fine for basic operation, but it could only drive headphones. (Because the headphone output doubled as an aerial connection. Outputing to a small amplifier just gave a horrid burst of noise).

My final attempt was to use a TEA5767-based board which looks looks like this:

module

As you can see there are four connection pins to the left of the image, two for power, and two for I2C. To the right of the image are a pair of 2.5mm sockets. One is for (headphone) ouptut, and the other for the external aerial. Once wired up this module worked perfectly, first-time.

The board is basically self-contained, and because it has its own integrated amplifier it can drive a set of headphones, as well as being connected to an external amplifier, or speakers.

There are two real downsides to the TEA5767 module:

  • You cannot programatically control the volume.
    • Although you can mute/unmute.
  • There is no support for RDS
    • So you cannot display the name of the station you're listening to on a screen, unless you hardcode a mapping.

Connecting

Connecting the hardware to the Webmos Mini D1 is pretty simple, following the example I found:

Radio ModuleWeMos Mini D1

VCC

v3.3

Grnd

Grnd

SDA

D2

SCL

D1

How it works

The TEA5767 library here can be used to drive the radio:

The code I put together can be found here:

This is a pretty basic project:

  • If you've previously configured WiFi details the device will connect automatically, and begin listening for incoming HTTP-requests.
  • If you've never configured the device it will instead notice that, and begin to operate as a WiFi access-point - you can use your mobile phone, or other WiFi-connected device to connect to this access-point and choose the local WiFi network it should join.

Once running the HTTP-server will display a simple user-interface which allows you to search the spectrum up/down, or tune to a specific frequency. That interface looks something like this:

user-interface