Building a radio (Part 1)

Published on: 15th January 2024

Tagged in radioesp32

I love radio. In my first job I lived 50 minutes’ walk from work and the journeys to and from would be spent listening to the morning’s news, usually Radio 5 or 4 (if I was feeling particularly classy). When I’m in the kitchen - I also love being in the kitchen - I’ll have the radio on; still 4 or 5 with occasional wanderings into Scala. Thinking about it, I probably have a radio in almost every room at home. There isn’t one in the bathroom as if I spent that long in there I’d look to get a doctor’s appointment first.

I’m now living in an area with poorer reception and some evenings the radio cuts out completely. I still don’t know why. Internet radio is now A Thing and there are some really good, albeit expensive radios out there so I shouldn’t need to worry about DAB reception. But I work in IT and tinker with things; can’t I make something that would do the job and come in significantly lower than the £150 I’d have to shell out for a good commercial one?

My needs are simple. So simple that it was easy to make a list of requirements:

  • I only need to choose between three or possibly four stations as I don’t channel-hop. So I wouldn’t need a complicated menu or controls, just a ‘next station’ button.
  • I’m not taking it outside the house so I only need to store one set of wifi login details. Once again, no menu or controls needed.
  • I want to be able to just switch it on and off. That’s a biggie and not as obvious as it sounds. There are lots of solutions that involve a Raspberry Pi (check out Bob Rathbone’s amazing work for more information if you want to build a Pi radio) but a Pi has to be booted up and (ideally) properly shut down. That takes time and if done wrong can break the operating system. So that’s out for now although I might look again in the future.

With that list in mind the only real option is some sort of microcontroller that could be programmed. This is Arduino territory, which until I started on this I knew very little about. Time to learn! And time to make a shopping list:

  • A compatible microcontroller. The Pico would be ideal but I’ve seen some solutions that involve the ESP32 so I’ll look at that to start with.
  • An MP3 module. Microcontrollers don’t have enough power to decode MP3s by themselves so I’ll need something to do the conversion. There are modules that use the VS1053 chip and require 5V which fits with everything else, so one of those will do nicely.
  • A display. I want to see what station I’m listening to! An LCD44780 two-line display is cheap and simple to program and there are a ton of guides on how to connect them to microcontrollers.
  • An amplifier. The MP3 module will output line level audio that will need to be amplified and sent out to some speakers. That should also run on 5V so I don’t need to do any conversions.
  • Two small loudspeakers. I don’t need anything fancy, especially as a 5V amplifier isn’t going to be able to drive much. I just need enough sound for a quiet room rather than a theatre.
  • A power supply that can send 5V to everything, with the 5V easy enough to access and not hidden within barrel jacks etc.
  • A case. Wood will look nice and be easier to work with than plastic or metal.

Time for some shopping! And part 2 once I have everything…

ESP32 board
The ESP32 board
UPDATE: every article should have a picture so here’s the ESP32 development board covered in wires. The board is dominated by the Wifi chip which is buried under the square of metal covering almost half of the available space.

Gallery

Click to view larger versions.

ESP32 board