DAC using R-2R resistor ladder

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 108

  • @gswright99
    @gswright99 11 років тому +20

    Awesome video. The effort you put into time lapse filming as well as etching your own circuit boards has produced a very high quality instructional lesson. This is exactly what I was looking for! Thank you!

  • @DirkIronside
    @DirkIronside 7 років тому +2

    I'm happy you put the timelapse of you manually connecting the resistors that did not show the desired result. It's very true to the scientific method.

  • @rickkrieger
    @rickkrieger 8 років тому

    The time lapse showing the voltage points getting plotted as you set each bit was VERY cool (and educational)!

  • @jeffbeck6501
    @jeffbeck6501 11 років тому

    This guy has a good education and knows what he is doing at the lowest levels, from the chip up. Thanks for the education.

  • @jeffbeck6501
    @jeffbeck6501 11 років тому

    This is a great video, with a great explanation, and a cool accent to boot.

  • @eloycalatrava153
    @eloycalatrava153 2 роки тому

    Good explanation and very good video.
    Let me please add some comments related to the signals you can get by using that configuration Arduino + R2R ladder, in special to the conclusion you mention as "Super fast". The 300ns or 3.3MHz you have got are the maximum speed at which the microcontroller can make an operation when clock is 16MHz. If clock is at 16MHz you can get one operation each 62.5ns ( = 1 / 16MHz), the 300ns are 4 times that period ( 300ns = 4 x 62.5ns). Additionally, if you read the microcontroller specs, you can find that, quoted, "The interrupt execution response for all the enabled AVR interrupts is four clock cycles minimum". So, all in all means that you can do something each 4 clocks, that means 300ns, cannot go faster than that. Then, if you would like to create a sine wave with 100 samples in each period you will need to consume 100 times 300ns giving 30us per period that correspond to 33.3KHz. But that is the maximum theoretical frequency because you will need to perform more than one operation each time you would like to change the output value. By using internal timer I could not go beyond 2 to 3 KHz.

  • @noweare1
    @noweare1 6 років тому

    I've been wanting to do this for a while now. Thanks, subscribed

  • @stewartrv
    @stewartrv 5 років тому +1

    Why not use the op amp as an active low pass filter too won't it will remove the spikes from the switching?

  • @mrunhappy008
    @mrunhappy008 10 років тому

    Great explanation of the R-2R ladder, thank you!

  • @Zidpato
    @Zidpato 9 років тому +1

    Muy buen video, tuviste la paciencia de explicar y mostrar los resultados, muchas gracias, contribuyes al conocimiento de muchas personas

  • @Nikmannet
    @Nikmannet 10 років тому

    Very good video, that is much better then just PWM.

  • @cojad
    @cojad 10 років тому +1

    This series is so inspiring!!
    Thank you!!

  • @u0000-u2x
    @u0000-u2x 3 роки тому

    great video! I like the Fallout 1 inspired soundtrack during the montages :D

  • @harishlakshmanapathi1078
    @harishlakshmanapathi1078 5 років тому

    you have gained a new subscriber amazing explanation man!!!

  • @Bertoos8
    @Bertoos8 10 років тому

    Very nice tutorial! I understood things that I coudn't in the University class! If you upload more videos would be great! Thank you very much!

  • @word2RG
    @word2RG 9 років тому +1

    Very well presented! Thanks for sharing and for the hard work.

  • @shyleshsrinivasan5092
    @shyleshsrinivasan5092 4 роки тому

    Thanks a lot for this video ! Very instructive and enlightening !

  • @renatoortega6618
    @renatoortega6618 6 років тому

    Congratulations. Your video is exactly a good work!

  • @Rastapapulus
    @Rastapapulus 3 роки тому

    6 years later I am watching this and hope to find the 16bit version in your channel. let's go search for it.

  • @hixidom2274
    @hixidom2274 6 місяців тому

    Amazing how well that works. I wonder if using tiny resistors in your 8-bit design results in better bandwidth than using normal resistors.

    • @hixidom2274
      @hixidom2274 6 місяців тому

      Haha I skipped all your equations but now that I'm making it I have to go back and watch that part to learn what the voltage ratio will be on the output (what resistance to use).

  • @RetroKafas
    @RetroKafas 3 роки тому

    When the DAC connected to the arduino we can't talk about the output voltage going from 0V to 4.5V right? Resistors still driven by the TTL-LOW voltage of more than 0V so there would definitely be a dc offset in the output signal.

  • @OswaldChisala
    @OswaldChisala 8 років тому

    Wow, you're one of my favorite UA-camrs now. :)

  • @nielsdaemen
    @nielsdaemen 6 років тому +1

    If you hook up an sd card with a 8bit mono 44.1 Khz wav file and just read every byte from the file and write it to the port (you do have to make shure it is played back at 44.1khz), it sounds really good! Who would have tought an arduino can play high quality music without any extra chips?

  • @sam-zy2dn
    @sam-zy2dn 4 роки тому +1

    Thank you so much! Could you please also explain how you made the circut board ? ( from the software, and the material that you used ) ! I am insipired by this channel and want to learn more. Thanks !

  • @4mb127
    @4mb127 8 років тому

    Great example on R2R ladder. Thanks! :)

  • @yourdiytechlife
    @yourdiytechlife 5 років тому +1

    This was a great video. it helped me to understand how digital to analogue really works. its surprisingly far simpler in function than I had imagined. The one question I still have is, with audio equipment how do they clean out all the spikes in voltage as the circuit switches. Is that all done with an analogue filter of some sort?

  • @a.b.c.d.e...
    @a.b.c.d.e... 2 роки тому

    „Lets go to the complete 8 bits“
    *Starts performing litteral witchcraft*

  • @francoisdastardly4405
    @francoisdastardly4405 6 років тому

    Very clear and educative. Thanks !

  • @teodorpetrut7784
    @teodorpetrut7784 6 років тому

    As far as I observed the 8-bit DAC showed like 100 kHz sample rate, not 3 MHz. Why?

  • @AkkaiNangi724
    @AkkaiNangi724 Рік тому

    can i use this DAC to construct a function generator by using a raspberry pi

  • @MrElectrosock
    @MrElectrosock 9 років тому +4

    Why don't you connect a small capacitor to the output of the converter 2R-R or the input of the operational, this would eliminate the jump of bits and make the best sinusoidal signal, maybe about 47 nF is Ok.

    • @bitluni
      @bitluni  8 років тому +1

      +Angel Jimenez long time ago.. not sure, why I didn't. probably because if you have very steep waveforms like square you don't really like to have the smoothing. But you can du it for sure if it fits your needs :)

  • @XLCaudio
    @XLCaudio 10 років тому +1

    is there somewhere where I can find the code you use?

  • @yoramstein
    @yoramstein 8 років тому

    Great video- zehr grundlich. I have learned a lot of it.

  • @galihtanu
    @galihtanu 3 роки тому

    How about use shift register? You can get 16 bit on mono or 8 bit on stereo

  • @THEELECTRICGUY
    @THEELECTRICGUY 2 роки тому

    What is the maximum sine-wave frequency achieved using this??

  • @kirkkirk5797
    @kirkkirk5797 4 роки тому

    Ptofessor why are you using an Arduino instead of simply an 8 bit binary counter and a square wave on its CLK?

  • @mustaphaalkhafaaf5512
    @mustaphaalkhafaaf5512 8 років тому +1

    please could you send the name of the liquid you used and the paper for the printed circuit ... every thing regarded the board from software to the end ,,, thanks

    • @caribary
      @caribary 8 років тому

      have him sent you?

    • @simonw.4587
      @simonw.4587 7 років тому

      How do this work with the paper and the liquid. I don't understand. Please make an extra video where you explain how does this work and please tell me what liquid and paper do you use.

    • @TheCarlos206
      @TheCarlos206 7 років тому

      Percloruro Férrico

  • @FakuSatu
    @FakuSatu 9 років тому

    i want to know wich value did you use to do the r2r circuit fir the 8ohms speaker

  • @yikuangchen8478
    @yikuangchen8478 5 років тому

    What is the frequency of the sine wave? Is it around 3M/256 = 11.7KHz?

  • @johnfaro9129
    @johnfaro9129 8 років тому +1

    excellent video!!! Thanks .

  • @jimadams2473
    @jimadams2473 10 років тому

    Nice instructional video. THANKS!!

  • @clackberry4388
    @clackberry4388 6 років тому

    The sin wave output from a R-2R DAC above still is a DC signal.
    How can I convert it to AC signal ? (Because I want to use it as input for amplifier).

    • @ozerik
      @ozerik 6 років тому +1

      A high-pass filter will block the DC bias. Okay..... use an op-amp like the NE5532, connect the output of the R2R array to one of the + inputs (pin 3), connect pins 1 and 2 together (connecting the - input to the output for a unity gain buffer) then connect a 470nF capacitor (mylar/poly/film is best) from 1 and 2 over to the other side of the chip to pin 5. Connect pin 5 to ground with a 100K resistor, connect pins 6 and 7 together, and that's your output!!!
      You can connect a resistor between 6 and 7, and then 6 to ground, to adjust the gain of your op amp. Keep these values below 20K to avoid adding noise, and above 2K to avoid loading the op amp too heavily. Identical resistors will double your output voltages (gain), higher resistance between pin 6 and 7 will increase the gain, higher resistance from 6 to ground will decrease the gain. Pin 4 goes to your negative voltage rail (-12V is a great choice) and pin 8 goes to positive voltage (+12V, for instance.) Oh, and put a 100nF capacitor between the power pins.

    • @clackberry4388
      @clackberry4388 6 років тому

      juanito moore : Very clearly. I will try it. Thank you very much :))

  • @enmohamedali96
    @enmohamedali96 6 років тому

    Thanks man, can i have arduino code for generating sin wave ?

  • @himeshkurera7476
    @himeshkurera7476 10 років тому +2

    Hi, I was wondering what kind of Op-Amp you used. I was looking for one as well.

    • @MultiCraftTube
      @MultiCraftTube 6 років тому +1

      You can use the widely spread LM358. It is cheap, DIP8 package (or other) and works in single supply from 3 to 32 volts.

  • @srosjose12
    @srosjose12 8 років тому

    holo tu pusiste 1024 valores en la matriz o cuantos valores colocaste?

  • @jangeox
    @jangeox 10 років тому

    Thanks! This video is awesome.

  • @irongarden8415
    @irongarden8415 5 років тому

    using pins RX and TX how then to flash?

  • @Frisky0563
    @Frisky0563 6 років тому

    Hi how do we change the frequency say 1200hz and 1800hz, which op-amp did you use?

  • @robertparenton7470
    @robertparenton7470 7 років тому

    Very impressive!

  • @SG-mp2nl
    @SG-mp2nl 10 років тому

    A very informative and helpful video, however, two questions:
    1) What voltage was used for the op-amp?
    2) What is the best way to vary frequency? I presume the rate of i will control this?

    • @bitluni
      @bitluni  10 років тому

      1) voltage is also 5V.. that's why the output is a bit lower. but you can use a higher voltage as long your ground is connected.
      2) what frequency do you mean? a waveform of a specific frequency or the sampling frequency?

    • @SG-mp2nl
      @SG-mp2nl 10 років тому

      bitluni's lab Sorry for the prolonged response:
      The waveform frequency. I imagine varying the rate of our sample, e.g. "i", will achieve this?

  • @jeffbeck6501
    @jeffbeck6501 11 років тому

    I just now got the real point to this video. I think it should say "This video explains the R-2R resistor ladder and how it can be used to ...create an A/D, or D/A converter". This video taught me that an AD or DA converter is just a resistor ladder and a micro controller chip. Yes, of course, now that you think about it. Thanks for this incredible video. What type of "crazy audio projects" were you alluding to? Thanks.

    • @dutchsailor6620
      @dutchsailor6620 5 років тому

      Good luck trying to make an AD converter from this

  • @feuerlink66
    @feuerlink66 10 років тому

    Schönes Video! Aber ein Frage hab ich ja: Was genau machst du da ab 7:47. Mir ist klar, dass das ein DA-Wandler wird, aber wie genau machst du das? 0o

    • @FloGroX
      @FloGroX 5 років тому

      Na analog zu dem, was er auf dem Breadboard gezeigt und erklärt hat. Nur eben platzsparend im SMD Platinenformat.

  • @mustafamohammed3834
    @mustafamohammed3834 9 років тому

    can we use it to convert serial data to analog , a diy xbee module

    • @bitluni
      @bitluni  8 років тому

      +Mustafa Mohammed DAC means actually Digital to Analog Converter so it's exactlly whats happening here

  • @jorgegerardoaragonvillarre2973
    @jorgegerardoaragonvillarre2973 8 років тому

    Can this be used instead of PWM for driving motors ?

    • @bitluni
      @bitluni  8 років тому

      +Jorge Gerardo Aragón Villarreal yes if you connect an opamp in between since the resistor ladder will not provide enough current. but don't for get to connect a diode backwards across the motor, otherwise the inductivity peaks could kill your ICs

  • @Nikmannet
    @Nikmannet 10 років тому

    is it possible to make 16 bit with 2 ports, and generate sinewave ?

    • @bitluni
      @bitluni  10 років тому

      sure.. but you have to take in account that this will result in two write operations each 8 bits. means that one of the bytes takes longer to change. this might be noticeable if you need the MHz frequency. otherwise I would add a filter cap

    • @Nikmannet
      @Nikmannet 10 років тому

      Ok, so if i use 8 bit i got 255 steps, if i will use 16 bits i should got 65535 steps or am i wrong ?

    • @bitluni
      @bitluni  10 років тому

      Nikmannet you are right

    • @Nikmannet
      @Nikmannet 10 років тому

      bitluni's lab Thats should be a very accuracy voltage regulator, have you ever done this before ?

  • @ValerianKapeller
    @ValerianKapeller 10 років тому +1

    Sehr schönes Ding!! Hast du zufälligerweise einen Schaltplan für das R2R 8 bit Netzwerk?
    Am lbesten wärs ne Schaltung ohne dem Voltage follower, muss alles so klein wie möglich halten. Sorry für Sonderwünsche, Thanks! :)

  • @FondueBrothers
    @FondueBrothers 6 років тому

    A good instructional video.

  • @tiagonet8794
    @tiagonet8794 9 років тому

    is possible make an inverter using the circuit?

    • @bitluni
      @bitluni  8 років тому

      +Tiago NET yes it is but it really depends what frequency you need. Usually PWM is better suited if you don't need high frequencies but high currents

    • @tiagonet8794
      @tiagonet8794 8 років тому

      60hz frequency and 1200W

    • @bitluni
      @bitluni  8 років тому

      +Tiago NET you should use PWM and drive some big chunky MOSFETS. Since you do not want the MOSFETS to burn excess current you need to operate them either fully open or fully closed. Therefore you need to stick with PWM. But I think there are some nice circuits around at the web.

    • @tiagonet8794
      @tiagonet8794 8 років тому

      good !!!! you're the man!! thanks for help

  • @SultanAlrefaei
    @SultanAlrefaei 8 років тому

    What Program Do You Use To PCB , Give Me The Link

  • @hendriagustian7082
    @hendriagustian7082 Рік тому

    Try using (some) multiplexer and opamp

  • @WatchCuriousCat
    @WatchCuriousCat 8 років тому

    Awesome man!

  • @OswaldChisala
    @OswaldChisala 8 років тому

    How did you successfully use pin's 0 and 1 (Rx, Tx)?

    • @amihartz
      @amihartz 6 років тому

      what kind of question is that

  • @yalcintufan3693
    @yalcintufan3693 Рік тому

    good. Btw if you put a little bit capacitor to the input of opamp itll be smooter. steps will dissapear.

  • @adx90210
    @adx90210 8 років тому

    Hello! Great video :D How did you calculate the sine table values?

  • @MicEib
    @MicEib 10 років тому

    wie viel Bit sind denn maximal möglich ?

    • @bitluni
      @bitluni  10 років тому +1

      16 Bit geht bestimmt, nur braucht man dann präzise widerstände. selbst 1% ist dann viel abweichung und dann bekommt man sprünge rein

  • @marcosantonio-nv9kg
    @marcosantonio-nv9kg 4 місяці тому

    Hola, buen video te felicito por tu gran aporte,recien estoy empesando con arduino y serias amable de enviar el ejemplo por favor?

  • @tiagonet8794
    @tiagonet8794 9 років тому

    how to generate sine table?

    • @bitluni
      @bitluni  8 років тому

      +Tiago NET code.bitluni.net/js if you just modify the lower code to force an update, it will generate one. you can play around with the code to generate other stuff :D

  • @reshailraza514
    @reshailraza514 8 років тому

    Can we make this without using arduino?

  • @arrshithrg5359
    @arrshithrg5359 8 років тому +1

    can we control the output voltage ??

  • @shubhishrotriya8415
    @shubhishrotriya8415 6 років тому

    Sir, is there any boundation on selecting the resistor values or we can choose any arbitrary values of the resistor keeping 1:2 ration in ckt. If no, then what are th specification to be needed to keep in mind before chosing values of it.

  • @rakka1dude184
    @rakka1dude184 7 років тому

    now thats a small circuit!!!

  • @kingcrimson234
    @kingcrimson234 9 років тому

    Did anybody else imagine Rainier Wolfcastle talking while watching this?

  • @Bell_Laboratories
    @Bell_Laboratories 10 років тому

    Grande!

  • @d.buchko4270
    @d.buchko4270 3 роки тому

    I guess everyone one is impressed with the R2R ladder and didn't question why no one can see the complete line of code for unsigned char sinTab.....? Maybe I have to join to see the rest of that code??

  • @crocellian2972
    @crocellian2972 7 років тому

    My God no Arduino?

  • @workroom-che
    @workroom-che 3 роки тому

    А на русском слабо этот ролик перезалить? Ты ж русский?

  • @FailCommando
    @FailCommando 6 років тому

    Ah DDRD = 255; My eyes are burning. I don't like this type of coding.