I'm looking for perfect audio DAC for ESP8266/ESP32
To make the experience fit your profile, pick a username and tell us what interests you.
To support my Crowd Supply launch I've decided to promote ESP8266 version of the board via Tindie store. This board is a baby version of ESP32 design, lacking some features and having much smaller power house. I consider it 'just enough' for smaller projects, like talking gadgets or sound boxes, left alone speechless visual projects that can start talking with this board.
All funds received will go for ESP32 version development, which I hope will see the daylight, as long as the project pre-launch will receive enough subscriptions. Having that said I'd like to ask again everyone to subscribe to Crowd Supply campaign, I'm really keen to release it to backers and see the projects it can host.
Just wanted to mention that I'm starting preparations for Crowd Supply campaign. Actually some work already performed and pre-launch page is live now. Currently I'm collecting subscribers that would be the basis for price and volume calculations, and if there is an interest for the board in the first place.
I'd appreciate if everyone interested in this board to see daylight would subscribe, mainly because only high enough volumes would allow to keep the price reasonably low.
I've decided to run funding campaign for this project with Crowd Supply. I did it before with another project of mine and it went well. This means among other things a huge to do list for me, including finalizing design (and feature list accordingly) and working on thorough testing and validation.
Closing feature list is the most complicated for me, since it is always so tempting to add few more bells and whistles here and there. Good method in that case is implement something myself and check what is missing and what is not used along the way. Following that path I've came to conclusion that I need mini board - this designed to be placed inside all kind of smart speakers and therefore has no screen and generally take considerably less space.
I introduce to you ESP Audio Development Board Mini
And the second project would be more sophisticated speaker based on ESP32 version of the board and great cspot repo which implements Spotify speaker on ESP32 chip.
To house this project I've bought Logitech iPod speaker (that what we've called smart before). It has no use in today's standards and anyway it is sold as broken and I couldn't care less if it was possible to fix it.
First I need to disassemble it and I did a monkey job of it and broke a couple of parts on the way, but in the end it is showing it's internals
Here is the original PCB, it goes to spare parts box
When I've tested MAX98357A module before in this project, I came to conclusion that it is only capable to produce moderate quality audio for non-demading projects. Funny enough I couldn't be more wrong about it.
While performing audio tests with the development board shared in the previous post I got the same scores, quite disappointing audio quality with hearable distortions. Datashees was much more optimistic on the chip's performance, so I sit to play around with some components to see if I can make it play better. Since there are not so many components to play around with, I started poking around output filters.
Originally I put output LC-filters similar to Adafruit's module as on the picture above. Not very happy with the result I revisited MAX98357 datasheet and found that it does not require any output filters apart from the speaker itself service as LR filter
So out of curiosity I've removed the filters altogether and funny enough DAC started to produce clear audio! Below is waveform with no filters (taken from toy-oscilloscope, sorry again)
Based in the investigation done in this project I've decided to build series of development boards with audio capable DAC, starting from the ones with built-in amp. Since I already have in mind a kind of project I'd like to implement (no spoilers) i also planned some advanced peripheral on the board to support those projects.
To be fair I've done both ESP8266 and ESP32, since in my opinion they are both great chips and being similar on the paper, they are in a quite different league if it comes to power reserves, therefore they are not really competing. For smaller projects I prefer simplicity of ESP8266, for larger projects - spacier ESP32.
I'm using them both quite regularly, so why not to have 2 development boards instead of one.
With that said, here they are.
ESP8266 closer look
ESP32 closer look
So commonly they have
- Stereo DAC with built in amp (2x MAX98357)
- Power circuit with backup Li-Ion battery (using built-in battery holder or external using battery socket)
- Battery charging IC and battery overcurrent protection IC
- Battery voltage measurement with built-in ADC
- Boost converter to keep the music going when battery voltage is too low
- TFT screen (with touch support on the ESP32)
- USB-serial bridge for normal flashing and serial debugging, with auto-flashing circuit
- IR reciever to support IR remotes
- Micro SD-CARD socket
Given the extra pins on the ESP32 is exclusively has
- RGB led on the board and connector for the external RGB LED strip
- Joystick OR rotary encoder
- Few HW touch pads
- JTAG header for real debugging
Currently I'm testing all the peripherals and doing some small improvements. Also I've adopted cspot repo to play Spotify as a smart speaker, and looking into adding visual feedback to above project. I want to put it into the case, for that purpose I've bough broken smart speaker and planning to replace internals with my dev board. More details in the next post (hopefully).
At one point I've decided to create ESP-32 based web-radio in the case of old classic radio.
This one I've bought for around 50 euros, it wasn't working obviously, and frankly didn't bother to fix it. From one point I'm not a big fan of AM, from the other it has a very peculiar schematics, it runs from mains directly without input transformer of any kind. If you push the socket in the "right" direction all metal parts will be live, so decided I wouln't want to have that anywhere in the house near children playing with screwdrivers.
Going back to the project. I've forked Ka-Radio32 repo, which is a ready to use wifi radio project. What I needed to do is to add HW definition of my board, and more importantly add TAS5805 amp support, since this is the amp I have on the board.
With that done it is relatively easy to fins some space within the box for new board and remote control receiver. Also I've connected power-on switch from the radio itself, and put IR receiver under the front panel
And the final result is below.
- It have high power stage, producing up to 23W per each of 2 channels (yeah!)
- obviously it requires more than 5V over USB, so i had to redesign power circuitry completely.
- it requires I2C additional to I2S to communicate and few GPIOs to report it's status.
Because power stage took a lot of PCB space, screen went other side of the board for now. On the bright side, i could take a larger screen, since i have plenty of space now.
So all together it is quite a different beast and I'm trying to find time to write firmware to get it started even. I get Ka-Radio32 firmware working on both prototypes and it works brilliantly on PCM5102 version. Currently working on TAS5805M addon to jump start the big thing.
To play more with best DAC found so far i preapred and ordered custom PCB. This uncludes ESP32 module socket, power converter for PCM5102, and DAC itself. Just for fun also added 8 sensor buttons, IR reciever and OLEd screen. For now no specific plans, just made audio part produce sound and looking for specific project to drop in
And yes, i switched to ESP32 now. Having experimented a little, i see that single core ESP-8266 is not capable to handle wifi and mp3 audio decoding on single core. One way to go around that is to use external mp3 decoder, another it to use more cores. Second option looks more fun to me.
For now flashed great ESP32_MP3_Decoder to start with. It plays internet stream smoothly, and audio quality is great, as far as i can tell.
And last note. For this one i used 10uF ceramic caps instead of tantal ones. Normally they are not recommended for audio applications due to piezoelectric effects, but as far as i can tell, they are just good enough. I can't tell a difference, that is all that matters to me
Next to test was 2 classic budget ICs: TDA1543A and TDA1545A. Unfortunately, despite the time spent i failed to make them work properly. I suspect that they could be fakes, since i got them from chinese platform for a price of € 1,6 per 5 pieces, giving € 0,30 a piece. I have no plans to buy them from trusted supplier, since then price leaven no senso of using them in low-budget projects.
Data format: left justified, stereo output
Ouput: high-impedance, biased, requires output driver
Price: ~€0.30 per unit
So lets call them replicas of TDA154X and see how output looks like. I've connected both according to original's datasheet, input still the same: mono wav file generated by esp8266 module using ESP8266Audio library modified for LJ format, industry standard 44.1Khz sampling rate.
TDA1545A, no output filters, 2KHz
TDA1545A, no output filters, 10KHz
Input signal is visible, so i guess data format is OK. However waveform is so messed up, i can't be bothered to connect it to amp and speakers.
TDA1543A, no output filters, any signal
I failed to make it work really, it looks like input format is wrong, even it is ok for TDA1545, and they suppose to have same input format. So nothing I really could say about that.
I tried few different ICs, from same seller however, so makes not much sense to expect a difference.
Next to test is bare naked I2C DAC from unknown to me chinese manufacturer. It is advertized as (not really) direct replacement of TDA1311 DAC ond partially its successors TDA154X series. It requires output driver and i added one using 4558D opamp according to dtasheet application circuit
Data format: left justified, stereo output
Ouput: high-impedance, biased, requires output driver
Price: ~€0.10-0.20 per unit
Clearly it is here because the price, and it is not expected to have hifi performance, but rather support low-cost audio driver in projects.
Here is the setup.
Only element added to above is output 1uF cap to filter out DC.
Again, I only have toy oscilloscope, therefore results will be eye measured:)
Test signal is mono wav file generated by esp8266 module using ESP8266Audio library modified for LJ format, industry standard 44.1Khz sampling rate.
1KHz on the output, after driver
2KHz after driver
10KHz on the output, after driver
20KHz on the output, after driver
As you can be seen, already at 10Khz distortions are huge, and 20Khz is a mess. However up till 20Khz there is no fading out of signal, and despite harmonic distortions i expect it to sound quite nice (for the price). As i said before, this is bad candidate for Hi-Fi sound, but very promisiong chip for less demanding audio applications. I keen to see it in action.
Become a member to follow this project and never miss any updates