Using the ESP32 DAC - Voltages, Waveforms & Sounds

  Переглядів 74,569

DroneBot Workshop

DroneBot Workshop

День тому

Oscilloscope Art, Musical Fruit - just a few of the things we’ll build with the ESP32’s built-in DAC (Digital to Analog Converter)!
Article with code: dronebotworkshop.com/esp32-dac
More articles and tutorials: dronebotworkshop.com
Join the conversation on the forum: forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
One of the lesser known features of the ESP32 is that it has two Digital to Analog Converters, or DAC’s, as part of its architecture. Today we will see how to use them.
The ESP32 DACs are not audio-quality by any means (use I2S for that) but still very useful for producing DC voltages and complex waveforms. We’ll see how they work and how they can be used in three different modes.
We’ll do several experiments using a multimeter, an oscilloscope, and an audio amplifier. If you have the test equipment, you can follow along; everything we are doing today will work on just about any ESP32 module.
After we see how to program the DAC, we'll have a bit of fun with it!
First, we will create some “Oscilloscope Art.” Calling this "art" is a bit of a stretch; it’s an ellipse rotating on the scope screen, but you can use it as the basis of something much more artistic!
Then we will get creative and build a musical instrument that you can also eat for dessert! We’ll use the DAC and touch switch features of the ESP32 to make music with some apples and oranges!
Here is the Table of Contents for today's video:
00:00 - Introduction
01:50 - ESP32 DAC
05:59 - Hookup and DC Voltages
10:14 - Waveform Hookup and Sine Wave (Basic)
13:20 - Waveform using a Table
15:46 - Cosine Wave using a Library
19:59 - Oscilloscope Art
25:09 - Musical Fruit
32:09 - Conclusion
33:43 - Bonus - Mozart!
Hope you enjoy the video! For those who are willing to stick it out until the end, there is a second musical serenade at the conclusion of the video.

КОМЕНТАРІ: 99
@Dronebotworkshop
@Dronebotworkshop 3 місяці тому
Hi everyone - It's come to my attention that there has been someone masquerading as myself, responding to some comments here with a link to a Telegram chat to win a prize from me. THIS IS A SCAM, I am not holding a contest, nor do I have a Telegram account. PLEASE DO NOT RESPOND TO THESE MESSAGES!! It's happening on a lot of my videos, I'm taking steps to remove them manually, but as I have 162 videos, it will take some time. If you do run across a suspicious comment, I would appreciate you letting me know at info@dronebotworkshop.com. Thanks! Bill (The real one!)
@collinb5524
@collinb5524 Рік тому
Its always a good day when Bill releases a new video. Hey Bill! Hope you're doing well sir
@frutt5k
@frutt5k Рік тому
He ate his synth
@sobertillnoon
@sobertillnoon Рік тому
The miscommunication line was the funniest thing I had heard all day. Granted my day is less than 2 hours old.
@gepetotube
@gepetotube Рік тому
I'm still amazed by the quality of these videos. As usual, excellent work.
@EsotericArctos
@EsotericArctos Рік тому
I hope you had a great "holiday season" and that the new year is being good to you so far. Stay happy and healthy! Look forward to seeing more this year.
@stefano.a
@stefano.a Рік тому
Excellent video. A little note: the speaker (before the use of potentiometer) is always in saturaton, so the emitted sound is that of a sinusoid clipped
@jj74qformerlyjailbreak3
@jj74qformerlyjailbreak3 Рік тому
We’re on the same wavelength today! I’m welcome in your workshop! Just about to fire mine up and play along at home.
@gpTeacher
@gpTeacher Рік тому
Terrific tutorial! Thanks for the insights to the DAC! Best wishes!
@1_HighDuke
@1_HighDuke Рік тому
Hi Bill, hope you had an excellent holiday season! Thank you for this in depth look at the ESP32 DACs
@anurasenarathna1703
@anurasenarathna1703 Рік тому
As always, an excellent tutorial video. Thank you very much.
@rjinnh3933
@rjinnh3933 Рік тому
As always, an excellent presentation of hi-value info. The Applesauce comment had me chuckling for several seconds.
@colormaker5070
@colormaker5070 Рік тому
I found your channel and from the few videos I have viewed on ESP32 I am impressed with the easy to follow. I manufacture wireless radio controlled LED fixtures. My goto processor is the PIC and its a great platform but I want to share our technology with the DIY community and the ESP32 looks like a better fit for most DIY. my products use radios, sd card, flash, ram and OLED display all of which I will have to learn to use with the ESP32. Thank you
@youssubernfissi5559
@youssubernfissi5559 Рік тому
What a lucky day, I have been waiting for a new vide,plus I'm interested in the esp32 more than anything these days and I have been looking for a use of it's DAC , so this is by definition the perfect video for me
@tseckwr3783
@tseckwr3783 Рік тому
thanks for putting all the hard work into your presentation.
@ethzero
@ethzero Рік тому
Excellent video on the not well exploited DAC feature, thanks!
@electronics.unmessed
@electronics.unmessed Рік тому
Thanks you very much for another great tutorial! Happy 2023 to you and your followers!
@sreekumarss
@sreekumarss 9 місяців тому
@32:07 Informative and joyful at the same time.. keep going Bill.. your videos are amazingly good.. 👏👍😍
@catchulater7483
@catchulater7483 Рік тому
Hope you had a good holiday Bill. Thanks for the new video- very useful.
@brianchen1163
@brianchen1163 7 місяців тому
Fantastic video! Can you do one demonstrating TDM?
@kylereed3577
@kylereed3577 Рік тому
Thanks Bill, another great video
@paulblock1367
@paulblock1367 Рік тому
Just one thing, the art forms or patterns on the oscilloscope are called Lisajou Patterns. Look them up online. They were also used for teletype mark/space alignment.
@warrenking1815
@warrenking1815 Рік тому
Great video about the esp32 thanks for the information
@TheUnofficialMaker
@TheUnofficialMaker Рік тому
very good, love the fruit piano!
@jeremyjedynak
@jeremyjedynak 8 місяців тому
Great video! You mentioned that a DAC can be used as a digital potentiometer. Where can one find more details on how to do that?
@Tony770jr
@Tony770jr Рік тому
Great esp32 dac video!
@DeStoreholmskeBaner
@DeStoreholmskeBaner Рік тому
That oscilloscope art makes me creazy. Looking at it, it sometimes turns left and a blink later, it turns right. It makes me crazy!!! :)
@thisoldjeepcj5
@thisoldjeepcj5 Рік тому
Very good one. Informative, educational and entertaining.
@tommieedwardberry
@tommieedwardberry 4 місяці тому
Very well done
@SaucemanSauceman
@SaucemanSauceman Рік тому
New vid! I have some of those boards but have not delved into them yet.
@armansotude1474
@armansotude1474 Рік тому
Sir, I have been waiting for you ❤
@jaroslawpiotrowski210
@jaroslawpiotrowski210 Рік тому
Nice project!
@sandrocavali9810
@sandrocavali9810 2 місяці тому
amazing channel, here working on music and uCs
@benbil100
@benbil100 11 місяців тому
Great, really very helpful videos, thank's
@vincentsteinmetz3726
@vincentsteinmetz3726 Рік тому
very nice présentation ! very well done and cover every aspect.
@warrenking1815
@warrenking1815 11 місяців тому
Very good video , as usual.
@alankinsella2948
@alankinsella2948 6 місяців тому
You are so sweet. Thank you for your outstanding performances.❤
@akashaadi4533
@akashaadi4533 Рік тому
Superb video 😍
@Yuehanlad
@Yuehanlad 5 місяців тому
Great video. Can you do a video of how to control the DAC voltage output with a rotary encoder.
@t1d100
@t1d100 Рік тому
Good information = thank you.
@OcenaSoft
@OcenaSoft Рік тому
Wow, this is a great video Bill, thanks for the time and energy you put into teaching. The ESP32 is an amazing little board and I love it. Q) have you ever done any work with the maple board? I purchased 20 of them some years back and not much luck with them and my Linux home! Thanks again ❤
@tin2001
@tin2001 Рік тому
The DAC on the ESP32 might not be high end audio quality, but I used it just over a year ago to create a little device as a joke for my new electric car.... I stuck the ESP32 inside an old set of USB powered (but analog input) computer speakers, and had it play the old clip from The Simpsons where they saw the electric cars or tomorrow... "Hello. I'm an electric car. I can't go very fast, or very far. And if you drive me, people will think you're gayyyy". Shoved the speakers into the glovebox, ran the USB power cable out to a standard USB phone charger cigarette lighter socket adaptor, and it would play the clip when you start the car up.... Several hours of fiddling with electronics and libraries and stuff for a 20 second joke for when my brother visited for Christmas 🤣
@esmink32
@esmink32 Рік тому
Again an amazing video, I will probably try to make this fruity keyboard myself in the future 😀
@buddhimaamarasinghe9997
@buddhimaamarasinghe9997 Рік тому
Excellent video sir.Thanks you very much for another great tutorial.If possible, make a video on how to make an MPPT solar charger using ESP32. Thanks.
@inductr
@inductr Рік тому
Today I got "shocked" by the electricity bill - but the same day another Bill video! Thanks!
@retgo
@retgo Рік тому
Good ideas 💡
@oldarchillies163
@oldarchillies163 Рік тому
Good fun, thanks! Now I love fruity music. :)
@tubeDude48
@tubeDude48 Рік тому
Bill, how about doing a video on the various ESP32's, since it's so confusing on which one to purchase!
@tin2001
@tin2001 Рік тому
Do you mean the chips now that there's different flavours, or do you mean the different types of development boards?
@tubeDude48
@tubeDude48 Рік тому
@@tin2001 - Which chip does what?
@geethabharathi2019
@geethabharathi2019 11 місяців тому
hey bill very nice .... god bless u..
@Firefox991gaming
@Firefox991gaming Рік тому
Commenting for the algorithm, cheers!
@drmosfet
@drmosfet Рік тому
If you ever want to see a mechanical version of a DAC just find a video on how a IBM Selectric Typewriter works, it's the DAC that rotate and tilt's the ball with the letters on it.
@TediumGenius
@TediumGenius Рік тому
Due to a miscommunication the McIntosh were cut from the video LOL! I have a lot of evil musician ideas now! Another great video!!
@user-xq9li4qx8l
@user-xq9li4qx8l Рік тому
Like this from Kenya
@ezzeldin101
@ezzeldin101 Рік тому
we missed you Bill
@dot_dot_pwn2650
@dot_dot_pwn2650 7 місяців тому
could you use a microphone as an adc input ,record the outputs from the microphone, and replay it thru the speakers via dac?
@bertbrecht7540
@bertbrecht7540 Рік тому
Excellent tutorial on what the ESP32 DAC can do, however, I have been looking everywhere for a way to build a high quality music player without I2S (your I2S video was awesome) considering the ESP32 is the only hobbyist microcontroller with I2S support. They have been building great sounding CD players, for example, since the early 80s and since modern microcontrollers are so much better than what they had available then, there must be a way to do this.
@mc.the_machine
@mc.the_machine Рік тому
The RP2040 also has I2S support with PIO, RE: hobbyist microcontrollers. In fact, you could even do a bunch of channels on one if you wanted to.
@coricorgi2801
@coricorgi2801 Рік тому
At 9:13 into the video, you mention not using an external reference. I was hoping the esp32 would allow that but the datasheet says the reference can only be the power supply voltage. That is regrettable. I was hoping you were right since I need an 8 volt reference. Nice video nonetheless. You put a lot effort into it. It is appreciated!
@gamingdevils216
@gamingdevils216 Рік тому
Sir please release video on remote sensing using aurduino....means how we can drive motor through remote.......Your videos are very informative sir. LOVE FROM INDIA
@venkatyalamati3285
@venkatyalamati3285 5 місяців тому
Great work as always.... I wish you need to make videos without having even a little amount of tension in your face... Be happy and confident about yourself... Don't try to be 100% perfect... That makes you to be more tensed 😊
@taham6757
@taham6757 Рік тому
so is the fruit project can be done with the development board version of the esp 32 cause i m confused
@jlucasound
@jlucasound Рік тому
I'll never see my Candy Apple Red Gibson Guitar the same! I'll have to be careful when I am plucking the strings with my teeth! 🤣 🍏🎸 At the end I had my lighter lit and in the air and I was swaying back and forth! Bravo! 🍎🟠 🤘😂
@summerfun6114
@summerfun6114 Рік тому
good job! my compiling for ESP32 S3 got ERROR: undefined reference to `dacWrite' , how can fix that? thanks.
@tpobrienjr
@tpobrienjr Рік тому
Enjoyed the applesauce
@omnianti0
@omnianti0 Рік тому
is possible the dac was destroyed or something interfere because i canot more get variable output using dacwrite(17,150); strangely it randomly vary from 3.4v to 4v instead of 3.3v i tryed to get a 1.450V for adc potentiometer as recommanded for best accuracy
@fnot804
@fnot804 Рік тому
Funny, I was just thinking about using esp32 for vinyl player repairs.
@thang19o9
@thang19o9 Рік тому
I have a question. Does the Musical Fruits also need an oscilloscope? Thanks!
@NLGeebee
@NLGeebee Рік тому
Ironically, no Adafruit libraries were used in the DroneBot Workshop Orchestra project ;)
@IceMetalPunk
@IceMetalPunk Рік тому
Interesting how when you play the sinusoidal waves through the speaker in the first experiments, it still sounds sawtoothy. Is that a limitation of the speaker, the amp, or the signal generated from the ESP32?
@TheOleHermit
@TheOleHermit Рік тому
Yes. Sounds to me as though it is clipping.
@BlondieSL
@BlondieSL Рік тому
Hmmmm.... As I watched this and got to the sine wave experiment, I wondered if an ESP32 could be used to convert a "modified sine wave" inverter (12V to 120VAC) to a "Pure sine wave" inverter (12V to 120VAC) I've seen some videos of this conversion, but they've usually built a circuit to produce a true sine wave. For those who are unfamiliar with inverters, they come in 2 types (basically). A "modified" sine and pure sine wave. The "Modified" sine is actually a very messy square wave that tries to appear like a stair step square wave. The Pure sine wave inverter produces a very stable, solid and true sine wave. This is what one needs to power most equipment. Sadly, many if not most people get fooled by "modified sine" thinking that it's a sine wave and ok for sensitive equipment. IT IS NOT! So there have been those out there who have come up with modifications to these cheap ModSine devices to remove the garbage wave generator and replace it with a pure, proper, 60Hz sine wave. So now, seeing this ESP32 in action and producing such a clean sine wave, I wonder how difficult it would be to use these to mod one of those inverters. I have several inverters. My 2 main ones are pure sine, while one that I keep in the car for emergencies, is a modified sine. I actually don't use it due to the damage it can cause to electronics. Hmmm...
@gunaseelamanikandanv2319
@gunaseelamanikandanv2319 Рік тому
HI SIR WE NEED TO HAVE OUTPUT OF 2 DAC OUTPUT TO ACTIVATE 25 &26 PIN OF ESP32 TO PLAY THE TWO DIFF AUDIO SIGNALS PLEASE HELP ME IN THIS SEGANEL
@Pippo.Langstrumpf
@Pippo.Langstrumpf Рік тому
Haven't heard from Music by Moose-Art before.
@deveshshevde-cp8xq
@deveshshevde-cp8xq Рік тому
SIR PLS MAKE A VIDEO ON AS5600 MAGNETIC ENCODER WITHOUT USING THE LIBRARY
@lokergames7058
@lokergames7058 Рік тому
cool one question( Now) background music i hear so many in youtube. i notice different. with your voice. NOw now now XD software? where come from.
@lokergames7058
@lokergames7058 Рік тому
Gpo pin how work over 20 to 30 . which object can swap in apple? bio cell and electron mate sensor or fiber can touch?
@mhavock
@mhavock Рік тому
Orange you glad you watched this video? He took a byte out of his project! That was a real Apple computer! 🤣🤣🤣
@dvhx
@dvhx Рік тому
DAC doesn't work when wifi is on (at least on my esp32-cam)
@AJB2K3
@AJB2K3 2 місяці тому
Musical fruit and no baked beans!
@MahBor
@MahBor Рік тому
Where's DB1? We miss her :(
@Ajaykrishna97_
@Ajaykrishna97_ Рік тому
13:00 at 86hz it sounds like a trimmer 🤣. If anyone wants to simulate trimmer sound just play a sine wave at 86 hz.
@dhultgren1
@dhultgren1 Рік тому
Probably could have used beans for the "Musical Fruit" segment 🤭
@chitlitlah
@chitlitlah Рік тому
I stopped playing piano because I always get hungry after a session. Now I know I just need to trade in the Yamaha for a Granny Smith.
@JosSSMr
@JosSSMr Рік тому
…and eat at last, hahaha
@mikejones-vd3fg
@mikejones-vd3fg Рік тому
mmm edible instrument
@labandrick9240
@labandrick9240 Рік тому
Third 🥉
@d.athegreat3947
@d.athegreat3947 Рік тому
Second
@BwsboyPlayGames
@BwsboyPlayGames Рік тому
First 😀
@kellydon2294
@kellydon2294 Рік тому
I see you removed part of my comment so I removed the entire thing and unsubscribed.... all the info I need is on the website I linked to so I won't be needing the help of your haphazard videos after all.
@procactus9109
@procactus9109 Рік тому
Omg, still using that embarrassing music
@chrisw1462
@chrisw1462 Рік тому
Synchronous. Sin-kron-us. There is no 'i' or 'i' sound in there.
Op-Amps  - Using Operational Amplifiers
44:21
DroneBot Workshop
Переглядів 261 тис.
McDonald’s MCNUGGET PURSE?! #shorts
00:11
Lauren Godwin
Переглядів 29 млн
КТО СМОГ ПОБЕДИТЬ?😳
00:36
МЯТНАЯ ФАНТА
Переглядів 732 тис.
ESP32 Audio: I2S & Built-In DACs Explained
6:06
atomic14
Переглядів 42 тис.
Build Your First Synth - Complete Workshop For Musicians and Artists
1:21:40
Synthux Academy
Переглядів 21 тис.
How to Run Linux on an ESP32
18:53
element14 presents
Переглядів 143 тис.
451 Which Processor can kill the ESP32?
11:24
Andreas Spiess
Переглядів 331 тис.
#419 ESP32 Audio Tutorial with lots of examples
13:48
Andreas Spiess
Переглядів 221 тис.
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Переглядів 510 тис.
ESP32 Guide 2024 | Choosing and Using an ESP32 Board
41:06
DroneBot Workshop
Переглядів 202 тис.
Как перестать есть сладкое!
0:11
Victoria Portfolio
Переглядів 1,4 млн
Невероятное дерево! 😰🩸
0:22
Взрывная История
Переглядів 5 млн
Картошка по-турецки
1:01
Mama_Gotovit61
Переглядів 8 млн
Правильний ШАШЛИК на Великдень👌👌👌
0:27
Igor Shpigunov
Переглядів 184 тис.