#195 DIY Internet Radio using an ESP32 (Arduino IDE)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
these days they tell us that they will close down our FM radio stations here in Switzerland time to start a new venture digitalize our radios without spending too much money I already some time ago started this venture with an esp8266 but was not successful I still have a box with a label ESP radio on my shelf today we will open it up and try to finalize this project with a bigger brother of the esp8266 or is it it's bigger sister Greta youtubers here is the guy with the Swiss accent with a new episode and fresh ideas around sensors and microcontrollers this box stayed for more than a year on the shelf let's open it and look inside it contains a module within es 9023 and an esp8266 development port if we have a close look the ESP module is d capped and I saw that a RAM chip P key pack on the flash chip this was necessary because internet radio needs two things speed and memory and the esp8266 did not have enough RAM this is why I had to add it with this trick we even find a do-it-yourself port with an es 9023 obviously I planned to build my own board before I bought one I did never finish this project because it only ran in expressives development environment and to my knowledge was never ported to Arduino a colleague even built me a complete virtual machine with a full blown Linux system and expressives development environment because I did not know Linux at this time you see these days were hard but now with the bad news for our FM stations and with a much more powerful ESP 32 I am motivated to give it a second try by the way do you hear how a Swiss sounds when he is excited the es 9023 used in the esp8266 the six radio is a premier stereo digital to analog converter it uses I square s signals as input please do not mix i square s with i square c these two protocols are not compatible while i square c is used by many of our sensors i squared s is mainly used in audio applications and because the ESP chips have a high speed i square s interface it can be misused for all sorts of experiments maybe we can still use this sport for our radio let's search for an ESP 32 radio project maybe we can stand on somebody else's shoulders and save some time and really I found a github repository for such a radio project it seems to be alive the last commit was last week the feature list is long much longer than expected who would wait to read the word MQTT in an internet radio project if I rewrite it seems to be possible to remote control our receiver from our home automation system using MQTT this must be the new age of digitalization they promise in all newspapers and everywhere else now I'm interested or how do you call the next step after excited this seems to be a full-grown project and it has all I need up to 100 preset stations it can play stations up to 320 kilobits per second and has a color display and even can be remotely controlled by infrared I must build this but it does not use the es 9023 board anymore it uses a different concept the esp8266 was also used to decode mp3 here they use a vs 1053 chip to do that the chip uses the SPI not the I square s pass fortunately I have such a board in my old project box maybe it was already then an idea to offload the ESP from Nam crunching with the displays however I'm not so sure this project uses the TFT ie Li 91 63 C library but my LCDs seem to use different chips maybe I have to change the library or order another display looking at the documentation it appears that at the developer used the same screens I have so let's start the BS 1053 port needs five walls and one of the displays can be used on three point three or five volts the backlight is only at three point three so for the moment we have to power our radio with five volts I would love to use one of these new ESP 3do ports with a big display and a battery but unfortunately they do not expose the SPI pins for our BS 1053 board and I'm also not sure if the library would work on these ports it would be cool if some of our Chinese suppliers would add a BS 1053 chip to such a board then we would have a very compact and cheap internet radio so we have to use a standard ESP 32 development port with all pins exposed the wiring is not straightforward fortunately the code is well-documented and we find the table with the needed pins it uses hardware spi to get maximum speed the SPI bus is much faster than the I square C bus and the hardware SPI is much quicker than software spi and this seems to be necessary for our today's project the SPI bus consists of up to 5 wires s CK the clock signal MOSI the signal in one direction me so the signal in the other direction these three wires can be used to connect many devices in parallel today we have the display and the BS 1053 ports in parallel and we could add also the SD card reader to the same bus but how do these devices know which data is for which device the devices on the ice we're Seabus all have addresses for that purpose to slow for the SPI bus it uses a chip select or CS signal each device has its own select signal as we can see here chip select for VBS 1053 board is GPIO 5 and for the display GPIO 15 like that the ESP 32 can choose with whom it wants to communicate for the moment we also see that the display does not need missile because it only receives data today I will not wire the SD card because I do not need an mp3 player on my radio the last pin which belongs somehow to the SPI interface is the reset pin here we wire all reset pins together if we press the button on the ESP all three devices are reset together also we can connect a rotary encoder long time us know that I like this kind of user interface for a first prototype I use 2-point cables for the one-to-one connections I use prefabricated wires if I have to connect more than one pin for example ground or VCC I cut cables wire them together and protect it with heating tubes to keep the distance is short I use the 10 centimeter variety this makes sure I do not lose too much voltage and do not create too much noise if you are interested in this topic you see now a link in the right top corner to a video about it as expected a lot of wiring is necessary I always use colors and write the color style in the documentation here you see that I am left-handed as many good American presidents but was forced to write with my right hand like President Regan and Truman so no need for comments about my handwriting such a table with the colors make it easy to check everything before switching the device on and also later for debugging I write all pins in the configuration part of the sketch so I do not need to enter them late Terron with a web interface the radio expects additional variables in non-volatile storage or nvs we can enter these values in ESP underscore radio underscore in it dot I n o it transfers all constants into NDS finally I can start the radio sketch and plug in a headset into the jack to listen remember this is my first time I listen to my internet radio I offer you the second headset for listening the display starts and it connects to my Wi-Fi network and really we hear the music cool it works and look which radio we listen to we listen to gaya radio this brings my thesis work to my mind where as a preparatory work I had to read this small book written by James Lovelock that apparently left a lasting impression on me unfortunately I have no clue how the user interface on this radio works pressing once the rotary encoder mutes the sound and pushing it again it unmutes but how to change the station let's try the web interface I connect to the address of the radio and get a friendly looking web interface to adjust the station the volume and other stuff I can also configure the device and with an enabled SD card I could use it as an mp3 player fortunately my studio monitor loudspeakers arrived yesterday and are not yet placed where they belong lucky you we can out together listen to Swiss radio [Music] let's now try the rotary encoder the manual says that I have to double click to change the station and really I can change it the interface is not very fast but it works but what happens after I click the button again the display becomes light and stays like that till I reboot the ESP not nice I have to check the issues on github such a problem should be recognized by others no I did not find any issue with this content so I have to create a new one to get help from the developer and really after a short time I got an answer not an encouraging one I'm the only one with this problem so definitely the setup works at other places maybe the power supply this could well be because I did not pay too much attention to that topic and unstable power supplies can create all sorts of unlovely effects instead of the USB cable I connect the five fault pins directly to the benched power supply and add a beefy capacitor across the power pins the device consumes around 200 milli ampere which is not a lot but this change does not help what else do you remember my video about debugging one rule was to exchange parts and check if the problem stays I replace the obvious one first the display with one of the same make and later with a similar one but of a different make no change edie suggests reducing the speed of the spi also no difference next I check if the ESP 32 board has an issue I also replace it with a different one no difference next I exchange the complete sketch with an example of the LCD library it works like a charm with two different sketches very strange it is also odd that the ESP does not crash quite often with such problems our ESP crashes and we can go from there not so here even if the screen is white I can remotely control it by a weapon to face the problem is most probably in the sketch itself maybe I am this most stupid user which is very valuable in software testing because he makes completely different mistakes as the developers by the way when I was young this role was always assigned to our boss of course nobody told him and he was always proud when he found the bug so I have to experiment more to find the problem with the display later in the meantime we can check if it sends MQTT messages yes I get messages whenever a new title is played for example and I think I could control the radio with MQTT messages for the moment I do not need that so we move on till I find the issue where the LCD I will use infrared only at an IR receiver diode and enter the pin in the configuration you find a link in the top right corner if you are interested in how I our remote controls work if you press the button on the remote the transmitted code is shown in serial just add this code to the config file and next time the IR function works nice feature by the way you might ask yourself where I got the rotary switch and the IR receiver ready on these small PCBs when I started my hobby I bought myself this sensor kit always if I need one of those parts I can take it from there of course in the finished product I will use standard parts and put these special ones back for the next usage now comes the disadvantage to be a nerd I was not able to stop this video without finding the root cause for the wide screen I had to do some research and serial print statements and indeed found a buck a simple if length bigger than one solved it if you are interested in the conversation how we search for the buck you see my issue in its project you will also see a few other issues which are still open and of course also the project files and the well prepared man I like this project it uses nearly all features of the ESP 32 if you have a close look it even uses both CPU cores including semaphores and also the touch sensors I think you can also learn a few things if you look at this code it took me maybe too long to find this bug why is that because I answered the first question in debugging wrongly did it already work somewhere else it's answer was yes it sits on my table and I use it every day and there was no issue locked for this particular error this is why I started to search the error in my setup not in the code finally we have a happy end but the beautiful 3d printed housing maybe with a small amplifier and the loudspeaker has to wait until I have time again and I'm pretty sure we can power everything from 3.3 volts then we could even do it in a portable setup maybe a project for you I hope this video was useful or at least interesting for you if true please consider supporting the channel to secure its future existence you find the links in the description thank you bye you
Info
Channel: Andreas Spiess
Views: 242,313
Rating: undefined out of 5
Keywords: ESP32, diy internet radio, internet radio, Arduino IDE, esp32 arduino, andreas spiess, esp32 project, arduino, vs1053b, radio station, vs1053, MP3, mp3 player, diy mp3 player, ESP8266, ES9023, beginners, core, diy, do-it-yourself, eevblog, electronics, arduino tutorial, arduino project, esp32 tutorial, greatscott, guide, hack, hobby, how to, internet, iot, mqtt, nodemcu, simple, smart home, things, ttgo, wemos, espressif, project, web radio, internet of things, sensors, esp8266 project, tutorial
Id: hz65vfvbXMs
Channel Id: undefined
Length: 16min 50sec (1010 seconds)
Published: Sat Apr 14 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.