The FASTEST way to get analog output from an Arduino

  Рет қаралды 14,993

learnelectronics

learnelectronics

Күн бұрын

Пікірлер: 43
@redwoodword
@redwoodword Жыл бұрын
Came here because I need exactly this for my modular synth DIY. Looks like a great solution for Arduino integration in that realm.
@dougzimmerman1238
@dougzimmerman1238 4 жыл бұрын
Nice overview. You may want to discuss the trade offs involved between a filtered PWM and a DAC analog output.
@Ozonised
@Ozonised 4 жыл бұрын
What are the trade off teach me please?
@dougzimmerman1238
@dougzimmerman1238 4 жыл бұрын
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.
@Ozonised
@Ozonised 4 жыл бұрын
@@dougzimmerman1238 ah! Thank you :D But what is source impedance? Edit : I know what impendance means but the source impedance is confusing me :)
@dougzimmerman1238
@dougzimmerman1238 4 жыл бұрын
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.
@Ozonised
@Ozonised 4 жыл бұрын
@@dougzimmerman1238 thanks 👍8-)
@zpinkLondonBelow
@zpinkLondonBelow 4 жыл бұрын
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
@BairdBanko
@BairdBanko Жыл бұрын
Thanks for the video, quick, informative, and with nice easy to understand example. Cheers!
@opalprestonshirley1700
@opalprestonshirley1700 4 жыл бұрын
Sweet DAC. I like simple and easy. Thanks, Paul.
@AndyClements
@AndyClements 4 жыл бұрын
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.
@electronic7979
@electronic7979 4 жыл бұрын
Very helpful video
@jimsouthall1085
@jimsouthall1085 4 жыл бұрын
Thank you . You made how it works very clear!
@warrenking1815
@warrenking1815 4 жыл бұрын
Very nice, like the simplistically approach.
@panosd5693
@panosd5693 4 жыл бұрын
You can use a low pass filter and the pwm from the arduino to get an analog output
@michaelpadovani9566
@michaelpadovani9566 4 жыл бұрын
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!
@baldrickdaisy8982
@baldrickdaisy8982 4 жыл бұрын
Awesome! Love it 😊 Thanks again Paul 👍
@stephenwong9723
@stephenwong9723 4 жыл бұрын
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?
@naderhumood1199
@naderhumood1199 4 жыл бұрын
Thank you Sir, Super easy.... Have a good day..... ✌️
@K2teknik.
@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.
@varmint243davev7
@varmint243davev7 4 жыл бұрын
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.
@fedinkov
@fedinkov 4 жыл бұрын
Excellent video!!! Thank you!!!
@PhG1961
@PhG1961 4 жыл бұрын
Yeah, I enjoyed it !
@VictorRivarola007
@VictorRivarola007 4 жыл бұрын
Wouldn't you achieve the same effect with a simple capacitor to ground before the LED?
@ed-jf3xh
@ed-jf3xh 4 жыл бұрын
2 stage filter works real well. RCRC.
@friedmule5403
@friedmule5403 4 жыл бұрын
Yes I was thinking the same. A capacitor to act as a sort of buffer.
@factorpotencia
@factorpotencia 3 жыл бұрын
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?
@BurnerStudio
@BurnerStudio 4 жыл бұрын
can I put 8 of this on my arduino? :)
@weerobot
@weerobot 4 жыл бұрын
Cool...
@rjmendoza
@rjmendoza 4 жыл бұрын
Can you add multiple lights and get the same results?
@IGaming73
@IGaming73 2 жыл бұрын
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
@sbfarmer8
@sbfarmer8 4 жыл бұрын
my eyes are completely clothed. "lets go to the scope!"
@Noxoreos
@Noxoreos 3 жыл бұрын
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.
@IGaming73
@IGaming73 2 жыл бұрын
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
@Noxoreos
@Noxoreos 2 жыл бұрын
@@IGaming73 The pins 1 through 5 are real analog pins. They output a steady voltage between 0V and 5V
@alexstone691
@alexstone691 4 жыл бұрын
How is it possible that i cannot get this chip in any electronics distributer in the country
@goodwill7643
@goodwill7643 4 жыл бұрын
Take this one, much cheaper. www.aliexpress.com/item/4001131613868.html
@jumperdk81
@jumperdk81 4 жыл бұрын
why not use analog pin on the arduino
@blic-sx9ix
@blic-sx9ix 4 жыл бұрын
Analog pins on Arduino Uno are input only. They use an ADC not a DAC. Some other MCu chips have a DAC built in.
@goodwill7643
@goodwill7643 4 жыл бұрын
Analgo pin giwes you PWM, it is not real analog.
@blic-sx9ix
@blic-sx9ix 4 жыл бұрын
@@goodwill7643 PWM is available on some digital I/O pins. No such thing as an analog (out) pin on the Uno
@goodwill7643
@goodwill7643 4 жыл бұрын
@@blic-sx9ix yes, I ment function analogWrite, rather than Analog pins.
@goodwill7643
@goodwill7643 4 жыл бұрын
@@mdrew44628 thats what I've said in my first statement by talking about analogWrite function.
Arduino Nano Analog Breakout Board DIY
10:54
learnelectronics
Рет қаралды 3,4 М.
2 Ways to make a Larsen Scanner - DIY Electronics for Beginners
22:37
learnelectronics
Рет қаралды 8 М.
НАШЛА ДЕНЬГИ🙀@VERONIKAborsch
00:38
МишАня
Рет қаралды 2,6 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 42 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 12 МЛН
Using MOSFETs with an Arduino
8:01
learnelectronics
Рет қаралды 28 М.
Top 5 Arduino Tips for Beginners
12:16
learnelectronics
Рет қаралды 137 М.
Easy DIY Analog Look Thermometer with Arduino
22:12
learnelectronics
Рет қаралды 5 М.
Arduino - Analogue Outputs
12:25
The Machine Shop
Рет қаралды 10 М.
Arduino Nano Every Setup and Testing
16:37
learnelectronics
Рет қаралды 39 М.
MP3 CDs: a hybrid "format" that never existed, yet was surprisingly common
34:18
Technology Connections
Рет қаралды 862 М.
НАШЛА ДЕНЬГИ🙀@VERONIKAborsch
00:38
МишАня
Рет қаралды 2,6 МЛН