Using the ESP32 DAC - Voltages, Waveforms & Sounds

Поділитися
Вставка
  • Опубліковано 29 тра 2024
  • 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.
  • Навчання та стиль

КОМЕНТАРІ • 100

  • @Dronebotworkshop
    @Dronebotworkshop  4 місяці тому +1

    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 Рік тому +38

    Its always a good day when Bill releases a new video. Hey Bill! Hope you're doing well sir

    • @frutt5k
      @frutt5k Рік тому +2

      He ate his synth

  • @sobertillnoon
    @sobertillnoon Рік тому +1

    The miscommunication line was the funniest thing I had heard all day. Granted my day is less than 2 hours old.

  • @gepetotube
    @gepetotube Рік тому +5

    I'm still amazed by the quality of these videos. As usual, excellent work.

  • @gpTeacher
    @gpTeacher Рік тому +10

    Terrific tutorial! Thanks for the insights to the DAC! Best wishes!

  • @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.

  • @anurasenarathna1703
    @anurasenarathna1703 Рік тому +2

    As always, an excellent tutorial video. Thank you very much.

  • @electronics.unmessed
    @electronics.unmessed Рік тому

    Thanks you very much for another great tutorial! Happy 2023 to you and your followers!

  • @1_HighDuke
    @1_HighDuke Рік тому

    Hi Bill, hope you had an excellent holiday season! Thank you for this in depth look at the ESP32 DACs

  • @catchulater7483
    @catchulater7483 Рік тому +1

    Hope you had a good holiday Bill. Thanks for the new video- very useful.

  • @stefano.a
    @stefano.a Рік тому +4

    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

  • @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

  • @rjinnh3933
    @rjinnh3933 Рік тому +1

    As always, an excellent presentation of hi-value info.
    The Applesauce comment had me chuckling for several seconds.

  • @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.

  • @tseckwr3783
    @tseckwr3783 Рік тому

    thanks for putting all the hard work into your presentation.

  • @ethzero
    @ethzero Рік тому

    Excellent video on the not well exploited DAC feature, thanks!

  • @sreekumarss
    @sreekumarss 10 місяців тому

    @32:07 Informative and joyful at the same time.. keep going Bill.. your videos are amazingly good.. 👏👍😍

  • @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

  • @thisoldjeepcj5
    @thisoldjeepcj5 Рік тому

    Very good one. Informative, educational and entertaining.

  • @kylereed3577
    @kylereed3577 Рік тому +1

    Thanks Bill, another great video

  • @paulblock1367
    @paulblock1367 Рік тому +1

    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.

  • @TheUnofficialMaker
    @TheUnofficialMaker Рік тому

    very good, love the fruit piano!

  • @warrenking1815
    @warrenking1815 Рік тому

    Great video about the esp32 thanks for the information

  • @Tony770jr
    @Tony770jr Рік тому +1

    Great esp32 dac video!

  • @benbil100
    @benbil100 Рік тому

    Great, really very helpful videos, thank's

  • @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!!! :)

  • @vincentsteinmetz3726
    @vincentsteinmetz3726 Рік тому

    very nice présentation ! very well done and cover every aspect.

  • @warrenking1815
    @warrenking1815 Рік тому

    Very good video , as usual.

  • @SaucemanSauceman
    @SaucemanSauceman Рік тому

    New vid! I have some of those boards but have not delved into them yet.

  • @tin2001
    @tin2001 Рік тому +3

    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 🤣

  • @t1d100
    @t1d100 Рік тому +2

    Good information = thank you.

  • @akashaadi4533
    @akashaadi4533 Рік тому +1

    Superb video 😍

  • @tommieedwardberry
    @tommieedwardberry 5 місяців тому

    Very well done

  • @alankinsella2948
    @alankinsella2948 7 місяців тому

    You are so sweet. Thank you for your outstanding performances.❤

  • @OcenaSoft
    @OcenaSoft Рік тому +3

    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 ❤

  • @inductr
    @inductr Рік тому

    Today I got "shocked" by the electricity bill - but the same day another Bill video! Thanks!

  • @jaroslawpiotrowski210
    @jaroslawpiotrowski210 Рік тому +1

    Nice project!

  • @sandrocavali9810
    @sandrocavali9810 2 місяці тому

    amazing channel, here working on music and uCs

  • @esmink32
    @esmink32 Рік тому

    Again an amazing video, I will probably try to make this fruity keyboard myself in the future 😀

  • @armansotude1474
    @armansotude1474 Рік тому +1

    Sir, I have been waiting for you ❤

  • @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!!

  • @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.

  • @oldarchillies163
    @oldarchillies163 Рік тому +1

    Good fun, thanks! Now I love fruity music. :)

  • @retgo
    @retgo Рік тому +1

    Good ideas 💡

  • @brianchen1163
    @brianchen1163 8 місяців тому

    Fantastic video! Can you do one demonstrating TDM?

  • @geethabharathi2019
    @geethabharathi2019 Рік тому

    hey bill very nice .... god bless u..

  • @jlucasound
    @jlucasound Рік тому +1

    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! 🍎🟠 🤘😂

  • @Yuehanlad
    @Yuehanlad 6 місяців тому

    Great video. Can you do a video of how to control the DAC voltage output with a rotary encoder.

  • @tubeDude48
    @tubeDude48 Рік тому +6

    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?

  • @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.

  • @user-xq9li4qx8l
    @user-xq9li4qx8l Рік тому

    Like this from Kenya

  • @Firefox991gaming
    @Firefox991gaming Рік тому

    Commenting for the algorithm, cheers!

  • @jeremyjedynak
    @jeremyjedynak 9 місяців тому

    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?

  • @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 😊

  • @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 Рік тому +1

      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.

  • @taham6757
    @taham6757 Рік тому +1

    so is the fruit project can be done with the development board version of the esp 32 cause i m confused

  • @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

  • @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!

  • @tpobrienjr
    @tpobrienjr Рік тому +1

    Enjoyed the applesauce

  • @shakuntalaharnale8110
    @shakuntalaharnale8110 11 днів тому

    At 12:13 What is the logic behind the int value of 128 + 64*sin(deg*(pi/180)). I mean what is the significance of 128 and 64? Is 128 the base value of sine wave and 128+64 the max value. So 64 is the amplitude. If that is the case can we not start at 0?

  • @thang19o9
    @thang19o9 Рік тому

    I have a question. Does the Musical Fruits also need an oscilloscope? Thanks!

  • @summerfun6114
    @summerfun6114 Рік тому

    good job! my compiling for ESP32 S3 got ERROR: undefined reference to `dacWrite' , how can fix that? thanks.

  • @ezzeldin101
    @ezzeldin101 Рік тому

    we missed you Bill

  • @mhavock
    @mhavock Рік тому +1

    Orange you glad you watched this video? He took a byte out of his project! That was a real Apple computer! 🤣🤣🤣

  • @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 Рік тому +1

      Yes. Sounds to me as though it is clipping.

  • @fnot804
    @fnot804 Рік тому +1

    Funny, I was just thinking about using esp32 for vinyl player repairs.

  • @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

  • @NLGeebee
    @NLGeebee Рік тому +1

    Ironically, no Adafruit libraries were used in the DroneBot Workshop Orchestra project ;)

  • @Pippo.Langstrumpf
    @Pippo.Langstrumpf Рік тому +1

    Haven't heard from Music by Moose-Art before.

  • @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

  • @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...

  • @AJB2K3
    @AJB2K3 3 місяці тому

    Musical fruit and no baked beans!

  • @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?

  • @deveshshevde-cp8xq
    @deveshshevde-cp8xq Рік тому

    SIR PLS MAKE A VIDEO ON AS5600 MAGNETIC ENCODER WITHOUT USING THE LIBRARY

  • @chitlitlah
    @chitlitlah Рік тому +1

    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.

  • @dhultgren1
    @dhultgren1 Рік тому

    Probably could have used beans for the "Musical Fruit" segment 🤭

  • @dvhx
    @dvhx Рік тому

    DAC doesn't work when wifi is on (at least on my esp32-cam)

  • @MahBor
    @MahBor Рік тому

    Where's DB1? We miss her :(

  • @JosSSMr
    @JosSSMr Рік тому +1

    …and eat at last, hahaha

  • @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.

  • @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 Рік тому +2

    Synchronous. Sin-kron-us. There is no 'i' or 'i' sound in there.