ESP32 Streaming Clock Radio - SIMPLE!

by hausofpayne17 in Circuits > Clocks

291 Views, 3 Favorites, 0 Comments

ESP32 Streaming Clock Radio - SIMPLE!

Esp32 "Stealth" Internet Clock and Streaming Radio
stealthRadioPic.png

What happens when you live with a big hill between you and the FM radio station you want to wake up to?

You build an ESP32 Internet Clock Streaming Radio! ( I call it a 'Stealth' Clock Radio because the angular enclosure looks kind of like the F117 Stealth Fighter.)

Other reasons you may want an Internet Clock Streaming Radio:

  1. You don't like having to reset your time and alarm after a power failure (because of course the backup battery is dead)
  2. You don't like the hassle of adjusting the time by an hour twice a year.(Daylight Savings Time)
  3. You like the static-free nature of streaming radio.
  4. You like streaming stations that are not in your reception area.
  5. You just want a darned cool Internet Clock Streaming Radio!

This project also has the advantage that it uses the WiFiManager library to let you configure your internet connection via a built in Access Point server on the ESP32 instead of hard-coding in your WiFi credentials in the sketch. You can also run it off your phone hot spot!

This may NOT be a beginner project. But it's also NOT as challenging as some of the other ESP32 streaming radio projects on the internet. No crazy graphics interfaces, no scrolling meta data from the station as to the song, artist etc. Just a plain and simple display of the time and radio station ID.

I tried to imitate the simple user interface of old style digital clock radios with this project.

  1. two buttons (alarm set and radio on/off),
  2. large 4 digit, seven segment display (red - but you choose your preferred colour)
  3. an alarm on/off rocker switch
  4. a rotary encoder for choosing the radio station
  5. a linear potentiometer for the volume control
  6. a capacitive touch bar to turn the display on for 5 seconds at night and then let it go dark again to help minimize light pollution in the room

Two useful tutorials I used for this project were from the DroneBot Workshop:

I2S Audio

WiFiManager

I enthusiastically recommend you watch both these tutorials before you start building and experiment just with the basic circuits to get the code working so you understand how the project sketch works.

Supplies

ESP32 Development Board of your choice (I used a standard inexpensive Wroom32 style)

Two MAX98357(A) Audio amplifier modules (if you want stereo)

Equivalent of 69.8K Ohms of resistors for the amplifier (just need one equivalent set.

2 10pF ceramic capacitors for the amplifiers

2 0.1uF ceramic capacitors for the amplifiers

One 4 digit, seven-segment display (TM1637 driver version 0.56")

Two small 3 watt 4 or 8 Ohm speakers (these fit the enclosure)

Two momentary contact switches (10mm - but any size is fine)

10K Linear Potentiometer (1/4" shaft)

1 Rotary Encoder with press switch (for setting selected radio station as the 'wake up' preference) (1/4" shaft)

1 - 56K Ohm resistor (for activating stereo mode on the audio amplifiers

3 - 10K Ohm pull down resistors for the buttons

1 - 5V 1 amp DC power adapter

1 - Barrel connector for the DC power adapter (which fits the adapter above)

1 - SPST rocker switch for the Alarm On/Off switch (12mm approximately - fits enclosure)

Various small gauge wire and some solid core wire for the capacitive touch 'night-mode' bar

1 - Prototype board (I used 50mm x 70mm size)

Soldering Iron and Solder

3D filament of your choice for the enclosure

Small screws/nuts and offsets to mount the circuit board inside the enclosure

Some coloured transparency film if you want to darken the display a bit (I already have it on the lowest brightness).

Fasteners of your choice to attach the lid to the enclosure and to attach the speakers and circuit board inside the enclosure.(I used small neodymium magnets and small screws to hold the lid in place).

I like to build my projects using female terminal strips so I can do the soldering without the microcontroller in place and risk messing up or cooking the microcontroller. Not necessary but that's my preference.

The Arduino Sketch Files

Here are the various sketches and header files to use for the radio project. They handle the saving/loading of configuration data as well as the handing of displaying the custom characters for radio station IDs.

There are several external libraries you'll need to include for the display, rotary encoder, audioI2S support, WifiManager etc. Just look at the sketch to see the library references.

Take time exploring the sketch and .h files to be familiar with what's happening.

Pay attention to the time zone code for setting to your region and the Daylight Savings Time offset if you use Daylight Savings Time in your area. You may wish to include these settings in the web configuration functionality for your version.

Upload to your project when ready.

Build the Circuit

ESP32 Clock Radio Wiring Table.png
ampCircui.PNG

As stated in the first section, take the time to explore how all the parts go together:

  1. TM1367 Display
  2. Rotary Encoder
  3. SPIFFS
  4. AudioI2S
  5. WiFi Manager
  6. MAX amplifiers

Play with them individually on a breadboard to get used to how they work before committing them to the circuit. For the display there are sample sketches in the Examples for TM1637 that you can play with. The library for the rotary eecoder has great example sketches as well.

For connecting the display, decoder, potentiometer and buttons/switches, I used male/female terminal strip material to make small plugs/receptacles so I could attach/detach the parts as needed. Wire up as you prefer.

The circuit uses many of the pins of the ESP32 dev board. The wiring connections are provided in the attached table. Solder up the circuit as you prefer. You'll need 10K pull down resistors for your momentary contact buttons. I put them on small perf boards for ease of mounting with wires running to the main board. Again, I would recommend you play with your amplifiers using the demo tutorial from DroneBot Workshop linked above.

The wiring for the MAX98357 amplifier boards is provided on a picture of the page from the data sheet. The 56K resistor is what makes the boards perform in stereo. The datasheet source reference is here. The stereo application diagram is on page 31.

Attach your barrel connector to the 5V input and ground on the development board connections.

For testing, you can run everything off the USB jack provided the adapter or USB jack on your computer can provide enough current to drive all the devices. Be careful.

Print and Assemble the Enclosure

2025-10-26 at 15.16.00.jpg
2025-10-26 at 15.15.40.jpg
2025-10-26 at 15.14.52.jpg

Print as you prefer. I used 5% infill.

Attach the decoder and potentiometer to the case with the nuts provided.

There are some small rectangular mounts you may print to support the Alarm and Radio buttons if you prefer.

In the photo for the underside of the lid, you see the wire in the top right which connects to the touch bar on the lid.

In the photo of the inside of the enclosure you see a female terminal connector in the top left that connects to the touch bar on the lid.

I generally used "Alien" style clear two-sided tape to mount my parts in the enclosure and used some hot glue where needed (like holding the display to the front. Mount the parts as you prefer. I mounted the speakers to the front of the enclosure using hot glue.

There are small supports you can print and put small screws in them to use as attraction points for magnets mounted on the lid if you wish to use magnets.

Set Up Your Radio!

AccessPoint List.png
AP message.png
AP 2.png
ap3.png
AP4.png

Once your construction, testing and uploading is finished, it's time to set up the radio.

Hold down the RADIO button while you power up the circuit. The radio will enter configuration mode and you'll see "CFG" in the display.

Open a device and you'll see a WiFi Access Point in your network browser that is broadcast by the radio. Select it. A web page will open on your browser and you can start configuring the radio. Here it's called "Radio AP". Click on it. There will be a message to "Open browser and connect."

You'll be presented with the WiFi Manager. You may click on your home network and enter your access password.

If you wish to use a phone hotspot or other network as a backup you can specify them in the 'hotspot' fields.

You should specify the Night time Display OFF and Day time Display ON times (24 hour time).

Next you can configure your streaming radio stations. The radio ID and streaming URL settings. There is room for 10 stations in this project. You can code more if you wish.

You may use any characters that can be displayed on a 7 segment display. Visit here for a list:

https://en.wikipedia.org/wiki/Seven-segment_display_character_representations

One place to find Streaming Radio URLs is:

https://fmstream.org/index.php?c=FT

Note: Not all streams are live, some work at sampling rates not supported by the MAX radio modules and some require subscriptions. Experimentation is needed to find the URLs that work on your project.

Click the 'Save' button and all your settings will be saved.

Recycle the power on the project. The network time will be found and set.

Press the 'Radio' button and try tuning to your different stations. You need to go a bit slowly so there's time for the circuit to try to connect to each station.

If you have found your prefered wake station and set the preferred wake up volume, Press in the decoder knob and it will save the current station as your wake up station.

Now press the 'Alarm' button and use the rotary knob to set your desired wake time. Press in the decoder knob to set the wake time.

If you don't want the alarm to operate (ex. weekends/vacation), just put the Alarm SWITCH in the OFF position. Put it in the ON position when you want the alarm clock function to work (work week).

During the night, the display will go dark after the 'Night Mode' time has passed. Touch the touch bar on the lid and the display will show the current time for 5 seconds and then turn back off.

As of October 2025, I've been using this radio just over a year and it's been reliable and accurate. We've had a few power failures and when the power returned, the clock was set and the alarm was reloaded. No intervention needed! Mission Accomplished!


Enjoy your Stealth Clock Radio!


NOW GO MAKE SOMETHING WONDERFUL!