Came here because I need exactly this for my modular synth DIY. Looks like a great solution for Arduino integration in that realm.
@dougzimmerman12384 жыл бұрын
Nice overview. You may want to discuss the trade offs involved between a filtered PWM and a DAC analog output.
@Ozonised4 жыл бұрын
What are the trade off teach me please?
@dougzimmerman12384 жыл бұрын
Basically, accuracy, speed, cost... A PWM output can be used to produce an an analog output with an RC filter. This basic design will have a ripple voltage at the PWM frequency and large source impedance. The source impedance can be addressed with a voltage follower. The output ripple can be addressed by changing the filter time constant or increasing the PWM frequency. Increasing the filter time constant reduces the ripple but increases the settling time for a specified accuracy. Increasing PWM frequency will reduce the output ripple for a given RC time constant but may reduce the PWM resolution depending on the uP used and clock rate. Also, the accuracy of the filtered PWM output is proportional to the supply voltage and switching levels of the uP. A DAC will provide an accurate analog volt with low source impedance. If the DAC output is ratio-metric, accuracy will be limited by the supply voltage. A DAC with an internal or external reference will address the supply-accuracy issues. The DAC refresh rate is limited by the digital interface but is typically fast. Also the DAC will require more MPU pins. All of these trade-offs (and anything I forgot) need to be considered during the design process. I have used both approaches in multiple designs.
@Ozonised4 жыл бұрын
@@dougzimmerman1238 ah! Thank you :D But what is source impedance? Edit : I know what impendance means but the source impedance is confusing me :)
@dougzimmerman12384 жыл бұрын
The filtered PWM voltage can be thought as a DC voltage in series with ‘source impedance’. The value may be calculated as the parallel combination of R&C of the RC filter. For transferring voltage between the PWM filter and load (whatever your driving), you want the source impedance to be very low and the load impedance to be very high. This will minimize the PWM filter output error. In effect, the source impedance forms a voltage divider between the source and load impedance. Hope this helps... Have fun.
@Ozonised4 жыл бұрын
@@dougzimmerman1238 thanks 👍8-)
@zpinkLondonBelow4 жыл бұрын
Great timing, releasing this video, since I were just about to look into a suitable DAC! Just got back into messing about with electronics after 20 years of (almost) purely computer development stuff and sub'd your channel a few weeks ago. Now you've earned yourself another patron, Sir! Kindly keep up the good work, good Sir. Cheers
@AndyClements4 жыл бұрын
The CS pin doesn't necessarily need to go to Arduino pin 10. The ~SS pin is only required for that purpose when the ATMEGA is the slave device. When it is the master you can use any pin. This is especially important to remember when you want to use more that one SPI device on the bus.
@BairdBanko2 жыл бұрын
Thanks for the video, quick, informative, and with nice easy to understand example. Cheers!
@opalprestonshirley17004 жыл бұрын
Sweet DAC. I like simple and easy. Thanks, Paul.
@panosd56934 жыл бұрын
You can use a low pass filter and the pwm from the arduino to get an analog output
@electronic79794 жыл бұрын
Very helpful video
@jimsouthall10854 жыл бұрын
Thank you . You made how it works very clear!
@warrenking18154 жыл бұрын
Very nice, like the simplistically approach.
@michaelpadovani95664 жыл бұрын
Cool not sure I've seen a simple DAC instruction video like this. One nice thing I've noticed about this chip/setup is that there are no passive components required (although of course you can include if your specific situation requires)...just hook up MC pins to chip. Cool!
@K2teknik.4 жыл бұрын
What about a video about how to count pulses? Something where it does with hw interrupt, and add some goodies like having three variables that constantly is updated with pulse count, pulse frequency, and distance between pulses. Many usages for this I think, water counter, electricity counter, speed counter, the list is long. If the thing can remember the pulse count in case of power failure then that will be an extra bonus.
@baldrickdaisy89824 жыл бұрын
Awesome! Love it 😊 Thanks again Paul 👍
@stephenwong97234 жыл бұрын
Am I correct that one should NOT control the brightness of an LED by voltage? So, using a DAC is a bit strange. In order to reduce flickering, increase the PWM frequency, and carefully adjust the on/off ratio/cycle should be the way to go, right?
@VictorRivarola0074 жыл бұрын
Wouldn't you achieve the same effect with a simple capacitor to ground before the LED?
@ed-jf3xh4 жыл бұрын
2 stage filter works real well. RCRC.
@friedmule54034 жыл бұрын
Yes I was thinking the same. A capacitor to act as a sort of buffer.
@varmint243davev74 жыл бұрын
HMM.... I think this may help explain why one type of monitor hurts my eyes and another doesn't. I had assumed it was due to AC vs DC but this makes more sense since they both claim to be using DC. One is probably using PWM to control the brightness and the other is using analog to control the brightness.
@naderhumood4 жыл бұрын
Thank you Sir, Super easy.... Have a good day..... ✌️
@fedinkov4 жыл бұрын
Excellent video!!! Thank you!!!
@factorpotencia4 жыл бұрын
The problem is the PWM frequency is only 500 Hz... it's too low. Are you using thre Atmega PWM registers or it's bit bang?
@PhG19614 жыл бұрын
Yeah, I enjoyed it !
@rjmendoza4 жыл бұрын
Can you add multiple lights and get the same results?
@IGaming732 жыл бұрын
Yes, but you will control all of them at the same time, or with a dual chanel chip, you can control 2 different output. Or you can use multiple chip to control multiple led separatly
@BurnerStudio4 жыл бұрын
can I put 8 of this on my arduino? :)
@alexstone6914 жыл бұрын
How is it possible that i cannot get this chip in any electronics distributer in the country
@goodwill76434 жыл бұрын
Take this one, much cheaper. www.aliexpress.com/item/4001131613868.html
@jumperdk814 жыл бұрын
why not use analog pin on the arduino
@blic-sx9ix4 жыл бұрын
Analog pins on Arduino Uno are input only. They use an ADC not a DAC. Some other MCu chips have a DAC built in.
@goodwill76434 жыл бұрын
Analgo pin giwes you PWM, it is not real analog.
@blic-sx9ix4 жыл бұрын
@@goodwill7643 PWM is available on some digital I/O pins. No such thing as an analog (out) pin on the Uno
@goodwill76434 жыл бұрын
@@blic-sx9ix yes, I ment function analogWrite, rather than Analog pins.
@goodwill76434 жыл бұрын
@@mdrew44628 thats what I've said in my first statement by talking about analogWrite function.
@sbfarmer84 жыл бұрын
my eyes are completely clothed. "lets go to the scope!"
@weerobot4 жыл бұрын
Cool...
@Noxoreos3 жыл бұрын
I don't get it. Why not just use Pins 1 through 5 with analogWrite? Sure it's nice to know how to use a DAC, but that does't seem like the fastest way to me.
@IGaming732 жыл бұрын
For some things it's helpful to have a real analog output. For example, in my case I am using an LCD display and I can't set rhe contrast with PWM because it blink too much. With this DAC, it can display nicely and smoothly
@Noxoreos2 жыл бұрын
@@IGaming73 The pins 1 through 5 are real analog pins. They output a steady voltage between 0V and 5V