logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 103299 1245
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Hello everyone,

    for a long time I've wanted to make something cool that could be used basically every day - i.e. a useful computer desk accessory. So I came up with an internet radio with a file player on a cool OLED display. As I don't program microcontrollers every day, there are sometimes small errors in the code. The project will still be developed and the code fixed / optimised. Initially, I built everything on a contact board, but I was limited by the fact that the ESP32 module just happened to have one side of the pins unused, and I didn't want to keep messing it up with soldering, so I designed a new board - hereafter referred to as a prototype board, because everything on it is still on goldpin bases and sockets. Unfortunately I missed one mistake, by downloading the ESP32-S3-WROOM-1 pad from the EasyEDA base I found that there was a difference in pin spacing across the width of the module. There may have been different versions, but in the end, after slightly bending the pins, I managed to get it to fit on the base board. I have posted all the actual code, PCB view, gerber files for PCB fabrication and pictures on my github. I encourage you to make yourself such a kit to start with on a contactor, the learning and fun of an interesting device is priceless. Feel free to comment.

    https://github.com/sarunia/ESP32_radio_player

    The radio stations are downloaded from github, the banks are switched - max 100 stations each, then you switch each one back and forth:
    https://github.com/sarunia/ESP32_stream

    Costs:
    OLED display 2.42" 128x64px white £60
    ESP32-S3-WROOM-1-N16R8 WiFi , Xtensa LX7 48zł
    PCM5102A DAC module 30zł
    enclosure, I didn't want the usual black one, unfortunately this one was also expensive GAINTA G748 56zł
    MB102 power supply module for contact boards or another similar one, because there are plenty of them everywhere, mine was for 8zł
    2 rotary encoders with pushbutton, each about 8zl
    4 switches (two PS11BBK and two PS11BBU) total about 16zl
    2 gold plated RCA sockets (black marker CC-222B and red marker CC-222R) together for about 20PLN
    PCB made in Poland quite expensive, 1 piece cost me 130zl including shipping

    Currently this is what the file playback and radio looks like:

    Homemade internet radio with an OLED display. Prototype of an internet radio with an OLED display on a desk. .

    And this is how it looked during earlier work:

    Interior of a prototype internet radio based on the ESP32 module, with colorful wires connected to a breadboard. Interior view of a prototype internet radio on a breadboard with an ESP32 module and OLED display. Prototype of an internet radio with an OLED display and buttons. Prototype internet radio with OLED display on a desk. Prototype internet radio with OLED display on a desk. Prototype of an internet radio with an OLED display on a desk. Prototype of an internet radio with an OLED display on a desk. DIY internet radio with OLED display and buttons.
    DIY internet radio with OLED display and knobs. Prototype of an internet radio with an OLED display. Homemade internet radio with an OLED display showing Wi-Fi connected. .


    .


    Following this topic: on the next pages you will find the description of my v2 version of the radio with file player, which is based on v1 version. v2 version was equipped with higher resolution display and more refined as far as the source code is concerned. .
    Below I have included a link to my github where you can find the project documentation and all the source code:
    https://github.com/sarunia/ESP32_radio_player_v2

    Based on my project a fellow forum member @robgold also made his own version of the radio:
    https://github.com/dzikakuna/ESP32_radio_evo3

    Note that the following attachments are for the v1 version of the radio.

    Cool? Ranking DIY
    About Author
    MAJSTER XXL
    Level 29  
    Offline 
    MAJSTER XXL wrote 2001 posts with rating 338, helped 164 times. Been with us since 2006 year.
  • ADVERTISEMENT
  • #2 20998160
    gulson
    System Administrator
    Thanks for the construction presentation! I also thought about this, because radio and Internet receivers are still quite expensive, and their software support is quite short-lived. Hence, any solution that is our own and over which we have control remains the best.
    Overall, I recommend the SomaFM radio station:
    https://somafm.com/
    I like Groove Salad best.
    I don`t know if it`s on your list? :)

    If you give me the parcel locker, I will send you a small gift! :)
  • #3 20998179
    MAJSTER XXL
    Level 29  
    Great that you liked it. The cool thing is that you can arrange your stations as you wish and each time you turn on the power and connect via Wi-Fi, the current list will always be downloaded. Of course, the back panel will have RCA sockets, headphone sockets and a power switch. In general, the system uses 4 monostable NO buttons and 2 rotary encoders with buttons. I will provide the parcel locker details in a private message.

    Internet radio and audio file player on ESP32-S3
  • ADVERTISEMENT
  • #4 20998356
    Andrzej Ch.
    Level 33  
    I have a few free 16MB WROOM modules, so I think I`ve found a use, just to have some free time :)
  • #5 20998571
    szeryf3
    Level 29  
    I see that you have built something better than my recently purchased radio.
    Black TechniSat DigitRadio 21 IR receiver with a display and knobs.
  • ADVERTISEMENT
  • #6 20998629
    TechEkspert
    Editor
    Very nice end result, where did you make the plate?
    You can think about ESP32 with an external antenna for better communication with Wi-Fi.
  • #7 20998693
    krzbor
    Level 27  
    MAJSTER XXL wrote:
    Unfortunately, I did not notice a single error. When I downloaded the ESP32-S3-WROOM-1 primer from the EasyEDA database, it turned out that there was a difference in the pin spacing across the width of the module. Perhaps there were different versions, but finally, after slightly bending the pins, it was possible to place it on the base board.

    Recently I was looking for an 8ch driver. I found this board:
    8-channel controller with various connectors and component labels.
    I was surprised that the modules come in two widths. As you can see, it is worth using 2 rows of pins (or holes) in the prototype board.
  • #8 20998701
    efi222
    Level 19  
    szeryf3 wrote:
    I see that you have built something better than my recently purchased radio.

    And this is proof that it is worth building your own devices.
  • #9 20998782
    Imekxus
    Level 19  
    Is it possible to add readme.md on git with a description and photos? These photos are not loading properly when I browse from https://github.com/sarunia/ESP32_radio_player/blob/main/Picture_1.jpg and click on the pale menu on the left. If the board is double-layered, you can save PLN 130 and make the board yourself, e.g. with thermal transfer, if someone already deals with this type of thing anyway.
  • #10 20998796
    MAJSTER XXL
    Level 29  
    @TechEkspert
    I drew the board in EasyEDA - I will be happy to share the project, but I don`t know how to do it in this tool yet. It`s nice if someone could adjust this spacing, and then it`s worth making a smaller tile and laying it out better.
    Then I ordered a tile from Satland, and I had to wait almost a month for one piece. Probably the last time there, at that time I would also get probably 5 pieces from JLC at the same price.

    Order for PCB ESP32_internet_radio_v1.
  • #11 20999177
    ArturAVS
    Moderator
    Recently I ordered 5 pieces 150x80 mm from JLCPcb, they arrived in exactly two weeks. Price ~$21. To tell you the truth, you designed your board quite lavishly. :D
  • #12 20999255
    speedy9
    Helpful for users
    @MAJSTER XXL do texts from internet radio display Polish characters or "bushes" in their place?
  • ADVERTISEMENT
  • #13 21000129
    MAJSTER XXL
    Level 29  
    @speedy9 Unfortunately, bushes appear, but I think I`ll take care of this library a little later and add Polish characters. For now, the most important thing is to correct errors in the code, because the radio plays nicely, but supporting the free selection of a radio station and a folder or file in it while playing the current audio is still a problem for me. It`s a pity that there are few stations broadcasting in FLAC, only some work stably, and most of them have their stream cut off and it`s not on my side, but it`s probably the intermediate servers that don`t work, or heaven knows. The sound from this DAC is of very good quality, and for PLN 30, many CD players probably can`t even compare it.
  • #14 21000142
    simw
    Level 27  
    Nice workmanship - complete.
    It would be good to indicate in the code what versions of the Arduino libraries were used.
    In a week or a month it may turn out that the project does not compile, then it would be good to know what the software was "based on".
    Additionally, which library package was downloaded to ESP32 and from where.
  • #15 21000276
    MAJSTER XXL
    Level 29  
    @simw I just uploaded the package of used libraries to github, as a rule I have a habit of updating libraries that apply for update.
  • #16 21000348
    speedy9
    Helpful for users
    MAJSTER XXL wrote:
    The sound from this DAC is of very good quality for 30z

    Or to be precise, it`s $2 on Aliexpress...

    The code is for Arduino 2 or 1.8?
  • #17 21000444
    MAJSTER XXL
    Level 29  
    Arduino IDE is now in version 2.3.2, you need to add a package to support Espressif devices, I used the online installer for the entire package:
    https://dl.espressif.com/dl/esp-idf/

    You also need to enable PSRAM:
    Screenshot of Arduino IDE 2.3.2 with expanded configuration menu for ESP32 highlighting PSRAM setting.
  • #18 21001387
    Tytus Kosiarski
    Level 16  
    @Majster XXL, great project, timely and useful for everyday use :)

    You inspired me to do something like that too. I`m currently trying to do this using the electronics of my mp3 version still on AT91SAM7S256, which has been unused for years. I will use ESP8266-01 as the WiFi module.

    Regards, KT
  • #19 21002758
    austin007
    Level 17  
    Have you considered the KaRadio design? The project is constantly being developed, functional, and the community is large.
  • #20 21002883
    MAJSTER XXL
    Level 29  
    @austin007 I haven`t seen it before, I prefer to follow my own path and solve programming problems myself. As for the principle of operation and operation of buttons and menus, I know what is needed, so I just need to refine my program in this respect. It is supposed to work in a basic way with simple operation without any bells and whistles.
  • #21 21002909
    austin007
    Level 17  
    I`m just giving you a hint. It is an open project and not everyone has time to create solutions from scratch, sometimes choosing suboptimal ideas.
  • #23 21005403
    stomat
    Level 38  
    And you enter these stream addresses on the website "manually", as I understand it? How long are they valid?
  • #24 21005625
    MAJSTER XXL
    Level 29  
    @stomat I don`t understand the question, everything stays up-to-date on github until I change something there myself. Typing is rather copy/paste from ready-made links. You can edit it directly after logging in to your account on the website, or even more easily via the PC application "Github Desktop". I limit the length of the station name to 21 characters so that it fits in the first line of the display without floating subtitles.
  • #25 21006143
    stomat
    Level 38  
    What happens if the sender changes the address? It will be out of date and you will not be able to receive the station. You could just as easily write them into your radio, e.g. on a memory card. It is known that senders, at least some, try to hide these addresses and want people to use their applications.
  • #26 21006191
    Zwierzak_PAH
    Level 28  
    And there are, for example: Radio Złote Przeboje, Rock Radio, Radio Pogoda, Radio TOK FM where they send requests to remove links to streams.
  • #28 21007979
    stomat
    Level 38  
    Everything is fine with your project, I just wanted to know how you deal with the general disadvantage of Internet radio in the form of the lack of some "official" database of links and the tendency to hide the addresses of clean streams. Well, you manually enter it into your file, it doesn`t matter where it is physically located.
    I`m old school and in the past the radio or tape recorder or turntable simply turned on and played, but today it`s a hassle with loading the system, God forbid updating, connecting to the server, logging in, connecting via Bluetooth, etc.
  • #29 21008069
    TechEkspert
    Editor
    Hmm, maybe someday ESP32 radio boards will appear in an electrode shop?
  • #30 21008246
    MAJSTER XXL
    Level 29  
    @TechEkspert All files that I have shared and will be adding to this project will be public and I do not intend to limit anything. Anyone who wants to build it should do so for some good programming fun. You can fork my repo on github and modify it as you wish, the same with the radio station stream link database. The PCB could be modified a bit, i.e. the ESP32 spacing should be reduced and repaired - I don`t know how to share the project with EasyEDA. If anyone knows, please write.

    I`m currently trying to learn Polish characters and it`s really hard for me and not very professional. When playing files, I encountered different encodings of our letters, some were single-byte, others were two-byte as ID3 tags. I managed to partially understand the table for lowercase letters, but there is still work to be done for the uppercase ones. These are font bitmaps contained in glcdfont.c
    The modified file is linked in my repo with the project:
    https://github.com/sarunia/ESP32_radio_player/blob/main/glcdfont.c

Topic summary

The discussion revolves around building an internet radio and audio file player using the ESP32-S3 microcontroller. The project includes features such as an OLED display, Wi-Fi connectivity, and audio playback capabilities. Users share their experiences with hardware setup, including issues with pin configurations, library compatibility, and troubleshooting compilation errors in the Arduino IDE. Suggestions for libraries, such as ESP32-audioI2S and WiFiManager, are provided to enhance functionality. Participants also discuss the importance of proper wiring, capacitor usage for encoders, and the potential for adding features like DLNA support and a web management interface for radio station management. Several users report on their progress, share code snippets, and offer solutions to common problems encountered during development.
Summary generated by the language model.
ADVERTISEMENT