Using the ESP32 DAC – Voltages, Waveforms & Sounds

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: https://dronebotworkshop.com/esp32-dac
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch: https://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.

source

You might be interested in