View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

In this exciting video, we're making progress on our miniature television project, having perfected sound and making strides with vision. We delve into the audio aspect, utilizing Mini esp32 S3 boards with 3-watt class D amplifiers based on the versatile max 98357ic. Fascinating features like class D amplifiers' efficiency and the easy PWM signal creation process are explored. We also play around with speakers of varying sizes, check out the temperature of the amplifier, and fiddle with animated gifs on our square display. Lots to come in future videos, including Version 2 of our boards and potential video playing methods!

Related Content
Transcript

[0:00] we鈥檙e getting closer to making our tiny
[0:02] TV we鈥檝e now got sound and we鈥檝e almost
[0:04] got Vision there are still a couple of
[0:07] challenges to solve but in this video I
[0:09] want to focus on the audio side of
[0:10] things I鈥檓 using my Mini esp32 S3 boards
[0:14] and one of the features of the boards is
[0:15] a 3 watt class D amplifier this is based
[0:18] around the max
[0:19] 98357ic I got the boards manufactured by
[0:22] PCB way and I also got them to do the
[0:24] SMD assembly which saves me a lot of
[0:27] fiddly work there are some improvements
[0:29] I鈥檇 like to make watch out for a future
[0:31] video on that where we鈥檒l be designing
[0:32] version 2 but if you need a PCB go and
[0:35] check out PCB way now the max 98357 is a
[0:39] pretty versatile IC and it can be
[0:41] powered from 2.5 to 5.5 volts so I have
[0:44] set up the circuit so it can be driven
[0:46] directly from the USB fire Port Supply
[0:48] or from the battery if there鈥檚 no USB
[0:50] connection
[0:51] class D amplifiers are pretty
[0:53] interesting they鈥檙e also known as
[0:55] switching amplifiers as they are
[0:57] basically switching the output between
[0:58] the two power rails this makes them very
[1:00] efficient as you are only using the
[1:02] power during the switching you can
[1:04] connect the output of the max 98357
[1:06] directly to a speaker as this will act
[1:09] as a low pass filter and reconstruct the
[1:11] audio signal I鈥檝e shown a little
[1:12] animation on the screen that shows how
[1:14] this works we鈥檝e got a sine wave on the
[1:17] top trace and in the middle Trace we鈥檝e
[1:19] got a pwm version of the sine wave the
[1:21] bottom Trace is a low pass filtered
[1:23] version of the pwm signal and you can
[1:26] see that we鈥檝e managed to reconstruct
[1:27] our original sine wave it鈥檚 not great
[1:29] quality as my pwm signal is very low
[1:32] frequency the max 98357 uses around 330
[1:36] kilohertz so it鈥檚 much higher quality
[1:38] it鈥檚 also got a whole bunch of clever
[1:40] algorithms to reduce noise it鈥檚
[1:42] definitely worth reading the datasheet
[1:44] to learn how it works we can see this
[1:46] working in real life by just low pass
[1:48] filtering the output of the amplifier
[1:50] I鈥檝e captured the signal from the
[1:52] amplifier and I鈥檝e low pass filtered it
[1:53] using a simple RC filter the amplifier
[1:56] is being driven with a 10khz sine wave
[1:58] and we can recover it quite easily it is
[2:01] surprisingly easy to create a pwm signal
[2:03] from an analog signal you just compare
[2:05] the input with a high frequency triangle
[2:07] wave at where it鈥檚 higher your output of
[2:09] 1 and when it鈥檚 lower your output is
[2:11] zero is pretty simple they are obviously
[2:13] the algorithm used in the max 98357 is a
[2:16] lot more sophisticated but this does
[2:18] give you a general idea of how it鈥檚
[2:20] working what I really like about the max
[2:22] 98375 is that it uses an i squared s
[2:25] interface so we can drive it really
[2:26] easily from the USB 32 we just need
[2:29] three connections the serial clock a
[2:31] word select which selects left or right
[2:33] Channel and the serial data the esp32
[2:36] has an i squared S driver built in and
[2:38] we鈥檝e covered this in a bunch of
[2:39] previous videos I鈥檝e got a grab of the
[2:41] signals here we鈥檝e got our word select
[2:43] the serial clock and we鈥檝e got the
[2:45] serial data I鈥檓 just outputting 16 bits
[2:48] here to make it easier to see the data
[2:50] on my board I鈥檝e configured the
[2:52] amplifier to mix the left and right
[2:53] channels together if we wanted stereo
[2:55] output we鈥檇 need two ICS and from my
[2:57] project that鈥檚 probably Overkill I just
[3:00] need mono output I鈥檝e left the gain pin
[3:02] floating which should give us 9 DB of
[3:05] gain but I am wondering if I should have
[3:06] configured it for maximum gain and
[3:08] controlled the volume in software but
[3:10] let鈥檚 see what it sounds like I鈥檝e wired
[3:13] up one of these big chunky speakers and
[3:15] it sounds pretty good
[3:17] foreign
[3:26] [Music]
[3:32] plan was to use these really tiny
[3:35] speakers
[3:42] and as you can hear they aren鈥檛 really
[3:44] very effective you need to have quite
[3:46] carefully designed speaker enclosures to
[3:48] get the most from these and my attempts
[3:50] don鈥檛 really work very well
[4:04] so if anyone knows how to get the most
[4:06] from these tiny speakers let me know in
[4:08] the comments so I鈥檝e ended up
[4:10] compromising and I鈥檓 using these pretty
[4:12] compact speakers that produce a pretty
[4:13] good output and once these are in the
[4:15] Box I think they will sound really good
[4:17] [Music]
[4:29] [Laughter]
[4:34] now one thing I was really interested in
[4:36] was how hot the amplifier was getting
[4:38] it鈥檚 supposed to be very efficient but
[4:40] it鈥檚 always worth checking these things
[4:41] out so I鈥檝e left it running for about
[4:43] half an hour and interestingly the
[4:45] amplifier IFC is not warm at all but
[4:47] what鈥檚 interesting to me is the low
[4:49] Dropout regulator is the warmest
[4:51] component on the board at about 46 or so
[4:53] degrees it does seem to be pretty stable
[4:55] at that temperature so probably not
[4:57] something we need to worry about right
[4:58] now but definitely something to keep an
[5:00] eye on when we really start pushing the
[5:01] esp32 to do more work
[5:04] the other really interesting thing is
[5:06] this shock key diode the pulses of
[5:08] temperature coincide pretty accurately
[5:10] with the heavy base parts of the music
[5:11] that鈥檚 pretty fascinating and it does
[5:13] kind of make sense we鈥檒l be drawing a
[5:15] lot more current to drive the speaker at
[5:17] those points pretty cool and fascinating
[5:19] to see but I didn鈥檛 think anything like
[5:21] that would show up on the camera now I
[5:23] did promise you some Vision I found a
[5:26] very nice YouTube video by the last
[5:28] outpost Workshop showing how to play
[5:30] animated gifs he鈥檚 using a round display
[5:32] but the code he鈥檚 provided Works nicely
[5:34] on my Square display there鈥檚 a whole
[5:37] bunch of nice gifs in his project
[5:38] definitely worth taking a look and in
[5:41] honor of the title of this video sound
[5:43] and vision he is the great man himself
[5:45] David Bowie now it would have been nice
[5:48] to play some of his music but the
[5:49] copyright police would be down on me
[5:51] like a ton of bricks I am still debating
[5:54] how to play video I can鈥檛 decide between
[5:56] hooking up an SD card and playing video
[5:57] from there or streaming the video over
[6:00] Wi-Fi let me know in the comments what
[6:02] you think


HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts