Тёмный

The FASTEST way to get analog output from an Arduino 

learnelectronics
Подписаться 169 тыс.
Просмотров 15 тыс.
50% 1

Опубликовано:

 

17 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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.
@BairdBanko
@BairdBanko Год назад
Thanks for the video, quick, informative, and with nice easy to understand example. Cheers!
@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
@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.
@warrenking1815
@warrenking1815 4 года назад
Very nice, like the simplistically approach.
@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?
@jimsouthall1085
@jimsouthall1085 4 года назад
Thank you . You made how it works very clear!
@electronic7979
@electronic7979 4 года назад
Very helpful video
@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?
@panosd5693
@panosd5693 4 года назад
You can use a low pass filter and the pwm from the arduino to get an analog output
@baldrickdaisy8982
@baldrickdaisy8982 4 года назад
Awesome! Love it 😊 Thanks again Paul 👍
@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!
@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.
@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!!!
@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
@PhG1961
@PhG1961 4 года назад
Yeah, I enjoyed it !
@BurnerStudio
@BurnerStudio 4 года назад
can I put 8 of this on my arduino? :)
@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
@weerobot
@weerobot 4 года назад
Cool...
@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
Просмотров 3,4 тыс.
Silent Hill 2 - Мульт Обзор
07:26
Просмотров 448 тыс.
Using MOSFETs with an Arduino
8:01
Просмотров 28 тыс.
Arduino - Analogue Outputs
12:25
Просмотров 10 тыс.
Using EEPROM with Arduino - Internal & External
31:54
Просмотров 197 тыс.
Silent Hill 2 - Мульт Обзор
07:26
Просмотров 448 тыс.