logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 259374 2638

TL;DR

  • Built an ESP32-S3 internet radio with an audio file player and OLED desk display, evolving through v1, v2, and v3.
  • Uses an ESP32-S3-WROOM-1, PCM5102A DAC, rotary encoders, and GitHub-hosted station lists split into banks of up to 100 stations.
  • The prototype uses a 2.42" 128x64px white OLED display, with a PCB made in Poland costing 130zl.
  • v3 adds a colour screen, weather, a calendar, RSS news from Polsat News Polska, and full remote control.
  • The first PCB had a pad-spacing mistake for the ESP32-S3-WROOM-1, so the module pins had to be bent slightly to fit.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #2491 21861462
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    My colleague @grzes_dst mobilised me and I added a connector for the keyboard on the PCB

    Here is the version with one encoder, but with two encoders it is the same

    ESP32 PCB layout with traces and headers for audio, OLED, USB, SD and encoder; dimensions 108.84×88.54
    Render of a blue “ESP32 Web Radio” PCB labeled with USB, SD, OLED, encoder, and speaker connectors
    Blue PCB with visible traces and mounting holes on a red textured background

    The board is wider than the old version - it is worth taking this into account when making the case.
    I will publish the gerbers in the near future.

    Greetings ....
  • ADVERTISEMENT
  • #2492 21861484
    ArtXs
    Level 24  
    Posts: 468
    Help: 93
    Rate: 111
    DJCheester . thank you very much for another version of the PCB and for the instructions on swapping libraries. Great job.
    When making new versions of the PCB, would it be possible to update the leads under the PAM8403 amplifier (I mean the output pads). I have marked the offset in the picture.

    PAM8403 amplifier module on a green PCB next to labeled solder pads for L/R outputs.


    Close-up of a PCB with a PAM8403 module and labeled speaker and IR connector pads.
  • #2493 21861490
    ArturAVS
    Moderator
    Posts: 26011
    Help: 2295
    Rate: 7713
    And why don't you connect it in the way recommended by the manufacturer? Output filters with inductances are a must.
  • ADVERTISEMENT
  • #2494 21861500
    ArtXs
    Level 24  
    Posts: 468
    Help: 93
    Rate: 111
    ArturAVS wrote:
    And why don't you connect it as recommended by the manufacturer? Output filters with inductances are necessary.


    Look at the documentation Link
  • #2495 21861506
    ArturAVS
    Moderator
    Posts: 26011
    Help: 2295
    Rate: 7713
    @ArtXs Read carefully. Page 9. The minimum is two ferrite "pearls". Second point, this is not a HiFi amplifier.
  • #2496 21861538
    simw
    Level 27  
    Posts: 754
    Help: 94
    Rate: 286
    ArturAVS wrote:
    Read carefully. Page 9. The minimum is two ferrite "pearls"

    Well, that's what you should read. This is the minimum for those wanting to reduce EMI above 1MHz, but the basic application from page 1 omits this, as the standard 'filtering' is the speaker inductance. At most one can interpret, each in their own way, whether this lowering of EMI is necessary, but this documentation does not settle that.

    Added after 16 [minutes]:

    Or perhaps as an alternative, a module like this:
    https://github.com/WeActStudio/WeActStudio.I2SSpeakerModuleV1/tree/master
    https://datasheet.es/download.php?file=NS4158
    It was complained in the thread that a potentiometer is needed for the PAM8403, with the ns41xx there is no such problem.
  • #2497 21861589
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    ArtXs wrote:
    would it be possible to update the leads under the PAM8403 amplifier (I mean the output pads). I have marked the offset in the photo.


    And here is the problem because ch production is Chinese makes different ones a little narrower and unfortunately bigger. I just happen to have the ones that fit my PCB perfectly.

    ArturAVS wrote:
    Read carefully. Page 9. The minimum is two ferrite "pearls". Second point, this is not a HiFi amplifier.


    That it's not HiFi I know, and the kitchen radio I have on this PCB is not HiFi either, it's not that league of equipment. It is supposed to be a cheap internet receiver and that was my assumption while designing the PCB. In addition, I completely abandoned SMD components because my eyesight is no longer that good.

    I2S module is taken into account in the next version if kol Robgold goes in this direction.

    https://pl.aliexpress.com/item/1005009587262392.html

    For the currently installed PAM8403 amplifier there are potentiometers added on the PCB for setting the input signal threshold.

    Greetings....

    Added after 6 [minutes]:

    Just wondering about replacing the IR receiver that is currently on the PCB with a JST 3-pin connector for plugging in the receiver on the wire.

    Greetings....

    Added after 1 [hour] 24 [minutes]:

    simw wrote:


    I don't know if it's so good because the amplifiers are integrated, but ordinary amplifiers with analogue input are the ones I gave above, admittedly mono so you need two pieces, but they have inputs with I2S which theoretically should eliminate any interference.

    Greetings ...
  • #2498 21861675
    grzes_dst
    Level 12  
    Posts: 74
    Rate: 7
    DJCheester wrote:
    I am just thinking about replacing the IR receiver that is currently on the PCB with a JST 3-pin connector for plugging in the receiver on a wire.


    @DJCheester I think it would be a good solution to have the IR on the JST 3 connector.
    Anyway, you can leave it as it is and you can use the JST 4 connector by removing one pin and it should fit , to bring the signal to the IR receiver further away from the board.
  • ADVERTISEMENT
  • #2499 21861695
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    grzes_dst wrote:
    JST 4 sockets by removing one pin and it should fit , to lead the signal to the IR receiver further away from the board.


    I now do this ;)
  • ADVERTISEMENT
  • #2500 21861820
    ArtXs
    Level 24  
    Posts: 468
    Help: 93
    Rate: 111
    DJCheester wrote:
    And here is the problem because ch production is chinese makes different ones a little narrower and unfortunately bigger. I have just the ones that fit my PCB perfectly.

    I see, and could you please post the exact pictures or possibly a source for the matching PAM8403 module.
  • #2501 21861956
    pipikupi1979
    Level 10  
    Posts: 15
    Sorry to jump in with something completely off topic, but I'm looking for someone who has tried working with this adc pcm1802 module in conjunction with an Esp32 and the configuration of this module (jumpers). The information I've dug up is quite contradictory on several issues hence I'm looking for people who have had any physical contact with this module. Thank you in advance for any information.
    Black PCM1802 ADC module on a wooden surface, with printed pin labels and configuration jumpers. Small electronic module board with three SMD capacitors and an IC on a wooden tabletop
  • #2502 21861959
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    >>21861820

    I'll do it tomorrow

    Greetings....
  • #2503 21862303
    dawidkosciesza
    Level 11  
    Posts: 54
    Rate: 14
    Hello.
    It would be nice if there was a way to power the PAM8304 through some sort of contactor so that it would energize with the radio running.

    I have ordered myself a PAM8406 for the time being.
    Anyone know or has tested it? A little more power and probably a better class of amplifier, and there are versions with built-in potentiometers.

    As for the potentiometers, I guess you'll have to solder them on the underside to set the value. It's a shame they came out under PCM.

    As for me the big improvement is the more detailed descriptions on the board. I missed this in the previous version. I had to make sure several times where the ground was and where the plus was, e.g. in the encoder.
    If this is not a big problem then describing the component values would be great because you don't have to look at the schematic or at the card ;) And I miss the description at the IR sensor output.
    But yes it's a super job @DJCheester :)
  • #2504 21862399
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    dawidkosciesza wrote:
    It would be nice if it was possible to power the PAM8304 via some sort of contactor so that it would excite with the operation of the radio.


    Hello

    I'm thinking of changing the PAM8403 to an amplifier with a digital i2s input which should eliminate buzz and other noise, it has a standby option, if Robgold sacrifice one GPIO to control the amp then you have a ready made circuit to switch off the amplifier along with the radio.

    dawidkosciesza wrote:
    I've ordered myself a PAM8406 to try out.
    Anyone know or has tested it? A little more power and probably a better class of amplifier and there are versions with built-in potentiometers.


    Same thing only more power (theoretically)

    dawidkosciesza wrote:
    What about the potentiometers, I guess you will have to solder them on the underside to be able to set the value. It's a shame that they came out under PCM.


    Yes they are under the module, one is slightly extended which will allow you to set the level of one channel on off, you can remove the PCM and set the other identically, these potentiometers are for a one time level setting, I don't think anyone will mess around in there afterwards.

    dawidkosciesza wrote:
    A big improvement for me are the more detailed descriptions on the board. I missed this in the previous version. I had to make sure several times where the ground where the plus e.g. in the encoder.
    If this is not a big problem then describing the values of the components would be great at all because you do not have to look in the diagram then or in a sheet of paper and I miss the description at the output of the infrared sensor.


    For the IR there will also be descriptions of the values also maybe somehow squeeze in ;)

    The PCB is in the process of being designed so anything could still be possible....

    Greetings ....
  • #2505 21862510
    Anonymous
    Level 1  
  • #2506 21862521
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    >>21861820

    I have bought on Aliexpress in a larger package twice and twice they sent different ones but the hole spacing fits perfectly.

    Here are pictures of the 2 modules in the PCB.

    Underside of a blue PCB with through-holes and a mounting hole on a beige textured fabric background Small green electronic module on a blue PCB labeled “Web Radio” and “ESP32-S3”. Underside of a blue PCB with plated through-holes and a mounting hole on a beige surface Green electronic module on a blue PCB labeled “ESP32 Web Radio” Green electronic module on a blue PCB labeled “ESP32 Web Radio”

    You have some with the inscription HW-104 it comes out not to buy these. But with the Chinese it's difficult to get along, they have different pictures and pack others. Greetings ...
  • #2507 21862592
    supsak
    Level 13  
    Posts: 81
    Rate: 5
    >>21862303
    Hi .
    I have a PAM8406 v 1 projection and I would say that it plays better as a PAM 8403. on PAM8403 I feel a time like a
    snporczenje .... On PAM8406 there is a silence instead of sound, picanja przetvornici on a display. Also it is good that PAM8406 has already potentiometer regulators on LINE in and with this you can adjust volume.

    ESP32 Web circuit board with a module, ribbon cable to a display, and a microSD card
  • #2508 21862616
    grzes_dst
    Level 12  
    Posts: 74
    Rate: 7
    robgold wrote:
    From version 3.20.04 there are presets, you can program in each bank the first stations from 1-10 as your favourites and with one click of the buttons 0-9 the radio will select the appropriate station. The presets function should also be enabled in the radio settings.


    Buddy @robgold how to store your favourite radio station from the selected Bank to the respective 0-9 button.
    Preset" function enabled in the settings, or do you have to physically move the favourite stations in the respective bank from 0-9?
  • #2509 21862987
    robgold
    Level 23  
    Posts: 698
    Help: 10
    Rate: 284
    >>21861956 The PCM1802 is not a DAC but an ADC-> "Analog-Input 24-Bit, 96-kHz Stereo A/D Converter", i.e. it converts the analogue input into digital i2s.

    @grzes_dst
    There is no memorisation, I didn't want to create another bank of "presets". You simply arrange the first 10 stations in a given bank as you like and access them with a quick dial.
  • #2510 21863008
    pipikupi1979
    Level 10  
    Posts: 15
    Yes, I know it's an ADC, but I'm looking for people who have had exact contact with this board because it's probably the only one available and unfortunately it has a lot of bugs so far I've scrolled through 3 pieces from Ali and each one surprises me with something else
  • #2511 21863122
    supsak
    Level 13  
    Posts: 81
    Rate: 5
    Hi Robgold,
    how is it remembering the station the player has when the power is on, off.
    I set myself in the setting ..bank no.txt -16, station no.txt -6, so that the Slovak station is playing, and then I listen to some other station.... in bank 10..., or in another bank, and when I turn the radio off and on a few times, it changes to playing the station from bank 1, no.1.
    Somehow, my set bank is not remembered. When I look in the setting, it is changed to bank 1, station 1.
    Thank you
  • #2512 21863127
    robgold
    Level 23  
    Posts: 698
    Help: 10
    Rate: 284
    >>21863008 I don't really understand how you would want to link this to the radio ? Apart from the fact that this PCM doesn't look complicated somehow. Put it in "master" mode, an analyser or oscilloscope to hand and some basic DAC e.g.: PCM5102 as output. Pair it together, throw in some signal and see.

    Added after 1 [hour] 46 [minutes]:

    >>21863122 Bank and station are remembered by writing to the files Bank.txt and Station.txt, both files are in SPIFFS/LittleFS memory or SD card. If for some reason your card/memory is not working properly then the radio will automatically set bank 1, station 1. Check for yourself in this case that you can see the contents of the card/internal memory in the file explorer in the menu. The logs on the terminal should also show that the configuration could not be read.
  • #2513 21863237
    supsak
    Level 13  
    Posts: 81
    Rate: 5
    Hi, I don't have an SD card, only the ESP32S3 memory... Look, the menu is configured.

    Screenshot of ESP32 web config showing Wi‑Fi, IP, MAC details and memory type set to LittleFS
    “Evo Web Radio - LittleFS” page with a file list table and an Upload button
  • #2514 21863313
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    You have LittleFS memory configured, i.e. without a card or Autostorage. If you want to use the card rigidly, find at the beginning of the code

    For commenting everything just leave the sd definition


    Code screenshot with #define AUTOSTORAGE, USE_SD and USE_LittleFS directives and Polish comments


    Greetings....

    Added after 43 [minutes]:

    dawidkosciesza wrote:
    I've ordered myself a PAM8406 for trial.
    Anyone know it, tested it? A little more power and probably a better class of amplifier and there are versions with built-in potentiometers.

    As for the potentiometers, I guess you'll have to solder them on the underside to set the value. It's a shame they came out under PCM.


    I tested the PAM8406 amplifier, for me it makes no difference in terms of quality both play the same.

    Well now some myths to dispel.
    Power or more powerful - No
    PAM8403 2x3W at 4ohm speakers
    PAM8406 2x5W at 2ohm speakers
    PAM8406 2x3W at 4ohm speakers.
    It comes out to the same thing.
    In addition, the PAM8406 has the option to work as a class AB linear amplifier, there is an input to switch the mode, but on this module it is not led to the goldpin, but on the PCB of the amplifier is permanently selected class D, so here it does not differ from the PAM8403.

    The only option that speaks in favour of its use are the PRs (they used to be called horseshoes - by the way, I wonder if any of the youngsters today have come across such a name).

    And the problem of inconveniently placed potentiometers would be solved. Take a look.

    3D render of “ESP32 Web Radio” PCB with ESP32-S3 module, PAM8406 amp board, audio jacks, OLED header
    Bottom view of a green PCB with traces and through-hole pads, four gold standoffs in the corners

    Further changes to the PCB - we are mounting the PAM8406 with PRs.

    PCB render of ESP32‑S3 web radio with speaker, encoder, OLED, USB and SD card footprint
    Bottom view of a blue PCB with vias and traces, placed on a red textured background.

    And so it is in 2D on

    PCB layout with ESP32, PAM8406 amp, speaker connectors, OLED, encoder, USB, and SD area

    And the name horseshoe itself comes from the first mounting potentiometers very much resembling horseshoes. This is such an offtopic 😀

    Three trimmer potentiometers with metal contacts on a gray textured surface Close-up of a trimmer potentiometer with metal bracket and three pins on a fabric background 3D render of a PCB with four trimmer potentiometers labeled PR2–PR4 and values 100k, 1k, 22k

    Any ideas on the PCB yet ?
    Instead of the IR there will be a JST4pin connector with one pulled out so that the spacing remains at present and if necessary give a 4pinJST plug and drive the receiver out on the wire.

    As for the chokes in series with the speakers, maybe they will appear tomorrow as time allows, I will test if it makes a difference by mounting them on the cable to the speakers.

    Regards...

    Greetings...
  • #2515 21863347
    Damian_Max
    Level 21  
    Posts: 392
    Help: 40
    Rate: 96
    DJCheester wrote:
    Any ideas for PCBs yet ?

    Hey, if I'm interpreting the jlcpcb price list correctly, there is a lower price up to size 100x100.
    And like the previous speaker, the component values on the board would be cool.
    On the descriptive layer of the bottom layer, you can give the electrode logo for the whole size of the board xD.
    On the descriptive layer of the top layer, you can insert some revision number of that board.

    I just ordered the boards from jlcpcb and those 5 pieces came out to ~18zl with shipping, I don't know if even ignoring the man-hours it is possible to make those five boards with a thermal transfer at home for that amount.

    The project itself is very worthy and I congratulate all authors and contributors!
  • #2516 21863353
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    Damian_Max wrote:
    Hey, if I'm interpreting the jlcpcb price list correctly, there is a lower price up to size 100x100.


    You are interpreting correctly but above that there is also no tragedy when it comes to necy a tile within 10zł is not a fortune after all 😀

    Except that you need to take 5pcs but I think you can resell the rest without any problem.

    Damian_Max wrote:
    And like the previous speaker, the component values on the board would be cool.
    On the descriptive layer of the bottom layer you could give the electrode logo for the whole size of the board xD.


    I'll try to add element values instead of descriptions, I also don't want it to be overblown and make it look reasonably nice.

    As for the electrode logo, I don't know if I have a license for that 😀 You'd have to ask the decision makers on that.

    Damian_Max wrote:
    On the description layer of the top layer, you can insert some revision number of this board.


    This is what I was thinking of and will be.

    Damian_Max wrote:
    I just ordered the boards from jlcpcb and these 5 pieces came out with shipping for ~PLN18, I don't know if even disregarding the man-hours it is possible to make these five boards with a thermal transfer at home in this amount.


    I've done a lot of PCB thermal transfer and I'll say that it's impossible to make a PCB at this price at my place, a laminate the size of half an A4 sheet is 15zł and the other half sodium persulphate.
    Apart from that a drill bit and messing about with it all.
    To answer, it is impossible to make a PCB at home at this price. And here you have a pro with soldermask and clean hands.

    Damian_Max wrote:
    The project itself is very worthy and I congratulate all the authors and people who contributed to it!


    On behalf of everyone who had a part. Thank you 😀

    I will make further changes tomorrow and show for public review.

    Regards...
  • #2517 21863429
    amrowek
    Level 13  
    Posts: 239
    Rate: 10
    Gentlemen, the author's DJCHESTER boards have arrived and i....my esp 32 is missing, the previous links are not up to date, is this esp model good and is it with an external antenna so that you don't have to solder these microscopic jumpers?
    https://pl.aliexpress.com/item/10050094881051...107314%21%212%210%21&gatewayAdapt=glo2pol


    about the boards
    i miss the option to choose whether RCA on the board or Pin and to the chassis wall. possibility to solder either pins or a holder with terminals
  • #2518 21863519
    ArtXs
    Level 24  
    Posts: 468
    Help: 93
    Rate: 111
    It might be worth adding the robgold -a resistor on the DAC ground mentioned by a colleague. >>21859499
  • #2519 21863521
    DJCheester
    Level 27  
    Posts: 2049
    Help: 75
    Rate: 949
    amrowek wrote:
    I am missing the option to choose whether RCA on the board or Pin and to the chassis wall. possibility to solder either pins or a holder with terminals


    Eek something is lying to me here.

    Green “ESP32 Web Radio” PCB with two blue screw terminal blocks on a carpet

    You can solder RCAs to yourself and ARK 2-pin or 3-pin where in the 3pin the middle one is the audio signal and the side ones are the ground.

    I don't want to put two markings on the soldermask because it will make a mess.

    Greetings....

    Added after 3 [minutes]:

    With ARKs you can use the sockets on the wires, and the version as it is now is just the ready inserted all the sockets on the back of the case.

    Black device enclosure with RCA “OUT” jacks and a USB port on the front panel

    Close-up of a black textured device casing with a small slide switch and a round hole

    Unless I have misunderstood you then explain what you mean.

    Greetings ...

    Added after 32 [minutes]:

    ArtXs wrote:
    Maybe it would be worth adding the resistor mentioned by robgold's colleague on the DAC ground. >>21859499


    Well, by all means, kudos to you....
  • #2520 21863549
    dawidkosciesza
    Level 11  
    Posts: 54
    Rate: 14
    DJCheester wrote:
    Now some myths to dispel.
    Power or more powerful - No
    PAM8403 2x3W at 4ohm speakers
    PAM8406 2x5W at 2ohm speakers
    PAM8406 2x3W at 4ohm speakers.
    It comes out to the same thing.
    As additional things PAM8406 has the option to work as a linear amplifier class AB is an input to switch the mode of operation, but on this module is not brought out on the goldpin instead on the PCB of the amplifier is permanently selected class D, so here it does not differ from the PAM8403.


    You are right about the power, I looked a bit in the technical data of this amplifier and the AB amplifier class also has a power of about 3W/4ohm. The choice between the amplifier class is to feed a Low(class AB) or High(class D) signal to leg #9 (mode).
    You might want to try running class AB, the descriptions say it is more immune to EMI interference.
    It would also be a nice option to be able to shut down the amplifier using foot No. 12 (Shutdown Control Input) activated by the Low signal.
    This would easily control the switching of the amplifier directly via the ESP32 and eliminate noise during the radio's Standby mode.
📢 Listen (AI):

Topic summary

✨ The discussion centers on the development of an internet radio and audio file player based on the ESP32-S3-WROOM-1 module, featuring a custom-designed prototype PCB with OLED display and user controls including rotary encoders and buttons. Key challenges addressed include pin spacing discrepancies in the ESP32-S3 module footprint, integration of Wi-Fi connectivity with dynamic station list updates, and handling of Polish character encoding on the OLED display. The project uses Arduino IDE (version 2.3.2) with ESP-IDF support and requires enabling PSRAM. Audio playback supports MP3, AAC, and FLAC streams, with the ESP32-audioI2S library recommended over the incompatible Audio library. Users reported issues with SPI MISO pin assignment causing bootloader conflicts, resolved by reassigning MISO to pin 35. The project incorporates WiFiManager for network configuration, EEPROM and SD card storage for saving last played station and settings, and includes plans for tone control via an external KA2107 equalizer and a CS8673 amplifier module. Problems with encoder input stability and memory limitations for Bluetooth A2DP on ESP32-S3 were noted. The community suggested alternatives like KaRadio and ESP32-MiniWebRadio projects. Debugging tips include serial terminal logs for HTTP errors and flash memory erasure to resolve boot loops. The project is open-source on GitHub, encouraging forks and modifications. Additional features under development include browser-based updates, directory navigation, and potential audio recording to SD card.
Generated by the language model.
ADVERTISEMENT