Electronic Basics #10: Digital to Analog Converter (DAC)

The Output Voltage Stability When Connecting Load

Output voltage stability is an essential aspect of any electronic circuit, and when connecting a load to an Arduino, it's crucial to consider this factor. In our experiment, we observed that the output voltage stability was compromised when the load was connected, but not when it wasn't. This phenomenon can be attributed to the inherent characteristics of the Arduino board and its limitations in handling high current draw.

When we disconnected the load from the circuit, the output voltage remained stable at 3.8 volts, which is an average value between the minimum and maximum voltages of 4.88 volts and 2.12 volts. However, when we reconnected the load, the output voltage stability was compromised, and the average value decreased to 2.96 volts.

To understand why this happens, let's examine the characteristics of a load connected to an Arduino pin. When a load is connected, it draws current from the Arduino, which can cause the output voltage to fluctuate. In our experiment, we used a 500 Hz sine wave at 5 kΩ, which resulted in a duty cycle of 78.4%. This high duty cycle contributed to the instability of the output voltage.

One possible explanation for this phenomenon is the presence of capacitance in the circuit. When a load is connected, it can introduce capacitance into the circuit, which can cause the output voltage to oscillate. In our experiment, we observed that adding a capacitor to the circuit helped stabilize the output voltage. The magic ingredient that makes this happen is the LC low-pass filter, which is created by connecting a resistor and capacitor in series.

The use of an LC low-pass filter is a common technique used in electronic circuits to filter out high-frequency components. In our experiment, we observed that adding an LC low-pass filter helped stabilize the output voltage, even when the load was connected. The capacitance value of 100 nF helped to reduce the high-frequency components and stabilize the output voltage.

Arduino Serial Data and Clock

In addition to dealing with loads, another challenge in working with Arduino is its serial data and clock signals. The serial data pin on an Arduino is typically used to transmit data from a microcontroller to an external device. When sending data over a long distance or at high speeds, it's essential to ensure that the serial clock signal is stable.

In our experiment, we observed that the Arduino serial clock signal connects pins A4 and A5. This means that when you want to send analog values over the serial interface, you need to ensure that the clock signal is stable and accurate.

One possible solution to this problem is to use a digital-to-analog converter (DAC) chip, such as the PCF 8591 or MCP 4725, which can be used to generate an accurate analog output. These DAC chips are commonly used in electronic circuits to convert digital signals to analog outputs.

For example, if you want to send a digital value of 200 over the serial interface, you need to ensure that the clock signal is stable and accurate. When we used the PCF 8591 DAC chip, we observed that it produced an accurate analog output with a duty cycle of 78.4%. This high duty cycle resulted in an average output voltage of 3.8 volts, which was stable when connected to a load.

Future Developments

As we continue to explore the capabilities and limitations of Arduino boards, we're constantly looking for ways to improve their performance and stability. One area of focus is the use of advanced DAC chips, such as the PCF 8591 or MCP 4725, which can be used to generate accurate analog outputs.

In our experiment, we observed that these DAC chips produced stable output voltages even when connected to loads. This has significant implications for applications where accurate analog output is critical, such as in audio processing or video frequency generation.

As always, thank you for watching! Don't forget to like, share, and subscribe to stay up-to-date with our latest experiments and tutorials.

WEBVTTKind: captionsLanguage: enwho doesn't love to listen to favoritewho doesn't love to listen to favoritewho doesn't love to listen to favoritemusic all the time look s Sound my Smartmusic all the time look s Sound my Smartmusic all the time look s Sound my Smartcancancanmakees digital device work digital Logicmakees digital device work digital Logicmakees digital device work digital Logiclevel that means States on and off highlevel that means States on and off highlevel that means States on and off highand low or Z and one doesand low or Z and one doesand low or Z and one doesmatter analog signalcome Signal would be a S Wave orcome Signal would be a S Wave orcome Signal would be a S Wave ortriangle Wave or ramp function so intriangle Wave or ramp function so intriangle Wave or ramp function so inthis video I will tell you all about athis video I will tell you all about athis video I will tell you all about adigital to analog Converter or DAC fordigital to analog Converter or DAC fordigital to analog Converter or DAC forshort let's getstarted there are many techniques on howstarted there are many techniques on howstarted there are many techniques on howto convert digital to analogto convert digital to analogto convert digital to analogR res ladR res ladR res ladmethoditmethoditmethoditRC but what does bit actually mean itRC but what does bit actually mean itRC but what does bit actually mean itjust means thatjust means thatjust means thatwe56 voltage values ​​between 4.8 volwe56 voltage values ​​between 4.8 volwe56 voltage values ​​between 4.8 volwe could also resolution of DAC you canwe could also resolution of DAC you canwe could also resolution of DAC you canalso see that resistorsH res basic compc voltage divider on theH res basic compc voltage divider on theH res basic compc voltage divider on theleft we Inputs which digital PIN of theleft we Inputs which digital PIN of theleft we Inputs which digital PIN of theArduino Nano hence bits and for betterArduino Nano hence bits and for betterArduino Nano hence bits and for betterexplanation I will now build this DACexplanation I will now build this DACexplanation I will now build this DAChere with 10k resistors and 20khere with 10k resistors and 20khere with 10k resistors and 20kresistors now let's Experiment I put Pinresistors now let's Experiment I put Pinresistors now let's Experiment I put Pin7 high and all the other Pins low here7 high and all the other Pins low here7 high and all the other Pins low hereI'm using theand set the voltage outputI'm using theand set the voltage outputI'm using theand set the voltage outputlevel it faster this and we2.2.2.number numbernumber numbernumber number12 which is exactly the half of12 which is exactly the half of12 which is exactly the half of256 and 2.3 vol half of the max voltage256 and 2.3 vol half of the max voltage256 and 2.3 vol half of the max voltage4.8 vol not precise because4.8 vol not precise because4.8 vol not precise becauseresistors% tolerance let try the numberresistors% tolerance let try the numberresistors% tolerance let try the number200 andwe7.we7.we7.vol256 get works knowledge we can easily256 get works knowledge we can easily256 get works knowledge we can easilymake ramp function by slowly increasingmake ramp function by slowly increasingmake ramp function by slowly increasingthe port D value upthe port D value upthe port D value up255 and then going back zero triangle255 and then going back zero triangle255 and then going back zero trianglefunction increasing P Dfunction increasing P Dfunction increasing P D255 and then decreasing it Backer ifwe let's have some fun with s Wave nowwe let's have some fun with s Wave nowwe let's have some fun with s Wave nowif we want to hear the signal we couldif we want to hear the signal we couldif we want to hear the signal we couldconnect Speaker right well you cannotconnect Speaker right well you cannotconnect Speaker right well you cannotconnect this directly to the resistorconnect this directly to the resistorconnect this directly to the resistorLadder because the voltage will collapseLadder because the voltage will collapseLadder because the voltage will collapseor change form completely so we have toor change form completely so we have toor change form completely so we have touse anamp as a voltage Follower it doesuse anamp as a voltage Follower it doesuse anamp as a voltage Follower it doesnot amplify the signal it just keeps thenot amplify the signal it just keeps thenot amplify the signal it just keeps theoutput voltage stable when we connectoutput voltage stable when we connectoutput voltage stable when we connectload but not hload but not hload but not hload now let 500 Herz s Wave kohz sineload now let 500 Herz s Wave kohz sineload now let 500 Herz s Wave kohz sinewave let's just go crazy and he fastwave let's just go crazy and he fastwave let's just go crazy and he fastchanging s Wave between 200 Herz and 3changing s Wave between 200 Herz and 3changing s Wave between 200 Herz and 3kHz i don't know why but it kind ofkHz i don't know why but it kind ofkHz i don't know why but it kind ofsounds like an atau 2600 sound effect ifsounds like an atau 2600 sound effect ifsounds like an atau 2600 sound effect ifyou want a more precise and small DACyou want a more precise and small DACyou want a more precise and small DACwhich works the same way then you canwhich works the same way then you canwhich works the same way then you canlook for ICS which do that like thislook for ICS which do that like thislook for ICS which do that like thisdac0800 but some of you might already Fdac0800 but some of you might already Fdac0800 but some of you might already Fwhy all this crap the Arduino has anwhy all this crap the Arduino has anwhy all this crap the Arduino has ananalog right function is that the sameanalog right function is that the sameanalog right function is that the samewell kind of it also Bits so let's trywell kind of it also Bits so let's trywell kind of it also Bits so let's tryit with a value of 200 again and we seeit with a value of 200 again and we seeit with a value of 200 again and we seea PWM Signal between 4.88 vols and volsa PWM Signal between 4.88 vols and volsa PWM Signal between 4.88 vols and volsduty cycle ofduty cycle ofduty cycle of78.4% which is an average of 3.8 vol78.4% which is an average of 3.8 vol78.4% which is an average of 3.8 volwhich makes sense when we enter 200 butwhich makes sense when we enter 200 butwhich makes sense when we enter 200 butthe magic ingredient which makes intothe magic ingredient which makes intothe magic ingredient which makes intoa LC low fila LC low fila LC low filrescreascreascreascapacit voltage ST let trycapacit voltage ST let trycapacit voltage ST let trywavec Filter even tell whatwavec Filter even tell whatwavec Filter even tell whatsupposed volage Filter pry aome GU notsupposed volage Filter pry aome GU notsupposed volage Filter pry aome GU notsoeasyic PS of Arduino serial data andeasyic PS of Arduino serial data andeasyic PS of Arduino serial data andserial clock which connects PIN A4 andserial clock which connects PIN A4 andserial clock which connects PIN A4 andA5 then all you have to do is sendA5 then all you have to do is sendA5 then all you have to do is sendanalog value over to them and do all theanalog value over to them and do all theanalog value over to them and do all thework by themselves I have PCF 8591 bitwork by themselves I have PCF 8591 bitwork by themselves I have PCF 8591 bitDAC from China and it works great and ifDAC from China and it works great and ifDAC from China and it works great and ifyou an even betterc you can take a lookyou an even betterc you can take a lookyou an even betterc you can take a lookat fruits MCP 4725 12 Bit DACat fruits MCP 4725 12 Bit DACat fruits MCP 4725 12 Bit DACalsoorial GUalsoorial GUalsoorial GUuse anal audiouse anal audiouse anal audiovideo frequency generatorest audio Filtersvideo frequency generatorest audio Filtersvideo frequency generatorest audio Filterslet see what I will imagine them in thelet see what I will imagine them in thelet see what I will imagine them in thefuture as always thanks for watchingfuture as always thanks for watchingfuture as always thanks for watchingdon't forget like share subscribe staydon't forget like share subscribe staydon't forget like share subscribe staycreative and will see you nexttime