Building a Discrete 14-Bit String DAC

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 99

  • @hardwareful
    @hardwareful 26 дней назад +45

    ultrasonic bath trick:
    fill with water, put IPA in a Ziploc bag
    PCB goes in the bag

    • @SineLab
      @SineLab  25 дней назад +3

      Thanks, I'll keep that in mind for next time

    • @hardwareful
      @hardwareful 25 дней назад +3

      @@SineLab Enjoy! On that note though, I've had the Ziploc bags come apart after leaving the solvent in them for a few weeks - so it's not really suitable for prolonged storage between uses.

    • @grozaadrian4134
      @grozaadrian4134 22 дня назад

      @@hardwareful ideea sounds good .. to not waste IPA but i have a question, did you had plastic depositions on PCBA ?
      also great work done by @SineLab

    • @FrainFreeze
      @FrainFreeze 20 дней назад +1

      glass jar is good too.

    • @johanness6545
      @johanness6545 16 дней назад +2

      ​@@hardwareful You can use a glass jar as well, it transfers the ultrasound even better than the plastic

  • @JustAnotherAlchemist
    @JustAnotherAlchemist 25 дней назад +28

    I've built discrete DAC's for fun before. More practically, I tend to build ad-hoc DAC's using a few free uC GPIO pins. I can say with certainty, give discrete R-2R DACs a try! The advantage of a discrete R-2R resistor ladder network DAC is that you can bulk buy resistors and use a good measurement method to "bin" the resisters to better than the precision/tolerance on the tin. That is, you can buy 1,000 units of 1% or better resistors, and build a 12~24 bit DAC with cherry picked / matched resistors. Furthermore, you can buy resistors with 10x higher resistance as parallel "trim resistors," or resistors with 10x lower resistance as serial trim resistors. You can also go completely nuts and stack trim resistors, thus trimming the trim resistors. Every order-of-magnitude trim resistor you provision for will give you a corresponding order of magnitude increase in precision. It's simple why; a 1% precision on a resistor that has 1/10th the affect on the output behaves like a 0.1% resistor that has full authority over the output. Finally, to be totally ludicrous, you can get resistors with matching/balanced temperature coefficient so that it has better thermal stability.
    You *CAN* build a work of art grade DAC using discreet components... but, to be fair, a great DAC IC is only a few bucks too... so.... :/

    • @dinistor1254
      @dinistor1254 24 дня назад +4

      also there's a plenty chineese 0.1% resistors on sites like aliexpress. They go higher in price but those 20pcs that i bought really fitted into 0.1% tolerance (measured with HP34401A whose last calibration was done in 1996, so take this information with a grain of salt). They also promise 25ppm/c TCR but i did not measure it, because i have no proper thermal chamber

    • @sc0or
      @sc0or 24 дня назад

      Instead of buying boxes with resistors, you can use some Python script and draw wire resistors just on a PCB. With having the smallest resistor as 0.2mm by 10cm 1oz (if I'm not mistaken, its resistance is 22 Ohms), you can place an entire weighted 16-bits DAC on a 30x10cm of 8 layers PCB (make sure you select a same oz for outer and inner layers). I think this is the cheapest 0.0000...1% resistor in the world (as cheap as 15 euros for one weighted string). Then you have to feed it with a current source, add 16 more same PCBs as a summing network, and 16 precise commutators (like a cmos on/off with a an OpAmp for a full compensation)
      PS You can use yet more 0.2x10x1oz wire on the same PCB in the current source to compensate a temperature while the wires become hotter

    • @dinistor1254
      @dinistor1254 23 дня назад +1

      @@sc0or Did you know why copper is a bad resistor material? It got huge TCR. And your copper traces will get temperature gradient, so "equal TCR will create equal offsets" argument is not applicable here. For 8+ bits DAC it's better to just buy IC, or use some old R2R resistor matrix (like soviet 312NR6, 10bit R2R resistor matrix), if you're able to find one. They got difference in TCR at ppm's range.

    • @victorman2227
      @victorman2227 22 дня назад +3

      @@sc0or Even ignoring the copper TCR problem, PCB manufacturing processes aren't perfectly uniform, somewhere there will be over-etching, in other places it will be under-eteched a bit. And 0.2 mm 100mm 1oz trace will be about 0.38 Ohm.

    • @ArneChristianRosenfeldt
      @ArneChristianRosenfeldt 21 день назад

      @@dinistor1254what if I buy special wire and wind it around a (ceramic) frame? Like a piano forte . I could even adjust the taps.
      Why do we care about temperature in a R2R ladder?
      How low is the noise of a power supply? How low is the resistance of the mosfets in front of the Rs of the ladder?
      1mV relative to 5V ! So this is not even good enough for CD audio (invented 1981).

  • @Gengh13
    @Gengh13 26 дней назад +14

    Making discrete versions of ICs is an excellent way to learn. Great job.

  • @georgewaller7080
    @georgewaller7080 6 дней назад +2

    Mate, with soldering skills like that, just get the PCBs assembled at JLCPCB!

  • @WarkWarbly
    @WarkWarbly 26 дней назад +11

    Just so you know, this video was more awesome than you think.
    Really insightful. It also seems like you upgraded the camera and audio a few times over.
    I say keep at it and before you know it there'll be more comments than you can read in a single lifetime.

    • @SineLab
      @SineLab  25 дней назад +1

      Thanks, this video took quite a while to make. I'm glad you enjoyed it!

  • @NNNILabs
    @NNNILabs 26 дней назад +12

    Loved the video! Building discrete ADCs and DACs is something I really like, and testing linearity using a Python script and a Keithley bench DMM is very reminiscent of the sort of stuff I do.
    By the way, the K2010's input impedance in the 0.1V, 1V and 10V ranges is supposed to be greater than 10GΩ, so I don't think it was loading the DAC significantly.

  • @borissinaga
    @borissinaga 26 дней назад +9

    This is amazing. I can't start to imagine the amount of effort you put into this video.

    • @SineLab
      @SineLab  25 дней назад +1

      It took a while to finish this project. :)

  • @FriendlyIntentions
    @FriendlyIntentions 26 дней назад +70

    You really should not be using "Earth" and "Gnd" interchangeably in circuits. Earth is usually mean to signify Protective Earth from a AC source. So using "Earth" as "Ground" although technically correct is not the right way to do it since. "Gnd" in a PCB refers to the V0 reference plane and NOT "protective earth" since the GND plane can be floating in a isolated AC to DC converter (which most AC to DC converters are and should be)

    • @SineLab
      @SineLab  25 дней назад +9

      I'll make sure to better distinguish earth from ground in future projects.

    • @sqeekykleen49
      @sqeekykleen49 25 дней назад +2

      😂 earth and god... oh gnd

    • @Mr.Leeroy
      @Mr.Leeroy 24 дня назад +2

      Everything following the first sentence is incorrect or really bad wording either.

    • @kiyoponnn
      @kiyoponnn 7 дней назад

      what's the difference between virtual ground and gnd?

  • @jenyjek5055
    @jenyjek5055 26 дней назад +16

    awesome work! only one major thing yu done wrong - dont use Isopropanol directly in the ultrasonic cleaner, some chinese cleaners may be incrorrectly grounded and having an open solvent is a huge fire hazard - especially if there is 3/4 Litres. i recommend having a plastic container with a lid where you put your isopropanol and stuff, and put this container into water in the ultrasonic cleaner. This has two advantages - mainly uou use less isopropanol and have it insulated

    • @SineLab
      @SineLab  25 дней назад +2

      Thanks, it does seem much safer that way

  • @totally_not_a_robot1342
    @totally_not_a_robot1342 26 дней назад +4

    Cool stuff, I just finished up a project at work using VISA commands.

  • @victorman2227
    @victorman2227 26 дней назад +2

    Cool! The idea of cascaded string DACs looks similar to a Kelvin-Varley divider.

  • @mikeselectricstuff
    @mikeselectricstuff 26 дней назад +14

    Tweezers are such a slow and painful way to hand-place large numbers of parts - get foot-operated vacuum pickup tool & pick from tape - not only is it way faster, the orientation is always right.

    • @SineLab
      @SineLab  25 дней назад +1

      I'll take a look into getting one

    • @silverXnoise
      @silverXnoise 25 дней назад

      Would it be feasible to use resistor arrays in this design?
      @mikeselectricstuff Your lighting and display installations are the thing of legend, I have learned a *ton* from your videos, thanks for sharing your knowledge and experience!

  • @dinistor1254
    @dinistor1254 24 дня назад +2

    100LSB INL error makes this no better than 8bit R2R DAC build from 0.1% resistors, unfortunatly... But you can make software correction for INL graph by calculating error function of output voltage (excel can do best fit polynomial).
    As mentioned in other comments, you should try R2R DACs, they give good results with resistors like 0.1% if you measure them and find best fit for nominal value. Of course, this is up to a certain point - when TCR difference of resistors, difference in switch resistance and many other effects will become noticable.
    There's reason, why in DAC8831 first 12 bits are done R2R, and last 4 are done with 15 separate resistors (Fig.44 at TI datasheet). I think this is for laser trimming.
    Also, your circuit reminded me of Kelvin-Varley Divider at first - maybe check it out.
    Anyway, this is good video demonstration! subbed:)

  • @mikemironov7551
    @mikemironov7551 25 дней назад +2

    I've made 1pin DAC once.
    It consisted of single capacitor and was driven by PWM:)

    • @opinair
      @opinair 25 дней назад

      if u dont need speed ..yes ..that what i do all the time 😊

    • @opinair
      @opinair 25 дней назад

      higt frequency pwm give faster abd beter result😊

    • @opinair
      @opinair 25 дней назад

      i discribe a beter aproche using resistors in comment. take a look.

    • @destiny_02
      @destiny_02 25 дней назад

      i made the same thing, but it was noisy even with 300khz pwm

    • @opinair
      @opinair 25 дней назад

      @@destiny_02 with 300kh abd 5v pwm use 3.3kohm and 0.47 uf

  • @harrylenon9594
    @harrylenon9594 2 дня назад

    in modern silicon processes, transistors are so small they are essentially free. Resistors on the other hand, can take up lots of space so replacing a resistor stage with a diff pair stage is very worth while. matching is also easier to accomplish with inter-digitated fets

  • @benjaminhanke79
    @benjaminhanke79 26 дней назад +3

    I misread the title and thought it's an discrete ADC. I would love to see that because I can't imagine how these things work.
    I've no problem understanding a DAC I've seen a simple resistor ladder DAC.

    • @antonf.9278
      @antonf.9278 26 дней назад +1

      From tha datasheet of a MC I used a while back:
      input -> buffer -v
      DAC -> comparator -v
      ^- control circuit

    • @benjaminhanke79
      @benjaminhanke79 26 дней назад +2

      @antonf.9278 I'm not that deep into microelectronics but as I understand this would require a lot of switches (transistors) to put the right voltage in the comparator and has to be much faster than the sampling rate you want to achieve.

    • @SineLab
      @SineLab  25 дней назад +1

      I may make an ADC at some point.

    • @thephantompsychic
      @thephantompsychic 25 дней назад +1

      Would appreciate it if you did! High precision and speed ADCs are something currently reserved for high price ICs (for good reason) but I'd greatly appreciate watching you get down to the basics on that!

    • @ArneChristianRosenfeldt
      @ArneChristianRosenfeldt 21 день назад

      @@thephantompsychicADCs are made of OpAmps. OpAmps seem to contain two magic parts. In both cases two transistors are monolithically integrated. On part (or circuit) is the long-tailed differential amplifier, which is a little immune to supply voltage bias and noise. The other one is the current mirror.
      Now I do wonder if a microcontroller could manage these circuits and some MOSfet transfer gates. Throw in capacitors and inductivities. I imaginen that capacitor and inductivity form a damped oscillator. We calibrate for zero crossing and get the precise result whereas otherwise we would need to wait forever.
      A flash ADC has a string of these amplifiers supplied by voltage from a string of resistors. I like the analog nature of a single stage amplifier. Maybe we can mix their output to get better linearity?

  • @marcinelektronik
    @marcinelektronik 22 дня назад +4

    Ultrasonic + heat + 99% IPA = FIRE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @jarvisxiii
    @jarvisxiii 20 дней назад +1

    Wow, Very cool! DACs rule!

  • @AnotherBrokenToaster
    @AnotherBrokenToaster 26 дней назад +1

    It's funny how simple a string DAC seems vs what a nightmare it is to actually make hahaha. Great video BTW.

    • @SineLab
      @SineLab  25 дней назад +1

      String DACs can be deceptively complex.

  • @ModelLights
    @ModelLights 25 дней назад

    While you're at it, note something does work that you will just about never see. Take a look at the DAC R-2R, and note that just a 374 latch or similar would drive it for 8 bits.
    So 8 bit digital pattern, directly driving and converted into an analog output value.
    You can do the opposite. Long ago looking at that, it hit me to do the reverse, analog in value directly to a digital output pattern. Comparator for first bit, high low set at the middle point. Next bit is set for 3/4, but if the high bit is low, that same low output pulls another resistor low that cuts the reference to the 1/4 level. So the second bit can determine either the high second bit or low second bit transition, with the first bit selecting which one. And work on down the line.
    Easy enough to do 4 bits and have fun testing it, gets hairy of course if you go further.
    Of course there are race and hysteresis type issues, but it is a fun idea. Even back then there was some small amount of prior art, but it's only barely used for 2 or 3 bits. You're better off using more comparators or going to a real ADC.

    • @ArneChristianRosenfeldt
      @ArneChristianRosenfeldt 21 день назад

      Atari ST and Jaguar connect a R2R network to CMOS output pins of the purely digital GPU to create RGB analog video out.

  • @stephenkioko4205
    @stephenkioko4205 26 дней назад +2

    Another descret components circuit,thanks bro

  • @bubbasplants189
    @bubbasplants189 25 дней назад

    Nice video lol I'm working on something similar, but made a 4 bit r2r ladder dac. It's so awesome to use math to generate analog signals!

  • @hendriagustian7082
    @hendriagustian7082 21 день назад +1

    Multiplexer/demultiplexer plus opamp, can be base 2 or 10 (ten).

  • @opinair
    @opinair 25 дней назад

    to create a digital-to-analog (DA) converter. For example, consider a 3-bit setup where each bit is connected to a resistor. The first resistor has a value of, say, 1 kiloohm. The second resistor is double the value of the first, meaning 2 kiloohms, and the third is also double the previous one, thus 4 kiloohms. All output points are then connected to a single point, which serves as the output....easy😊isnt

  • @sebastian19745
    @sebastian19745 25 дней назад

    There are transistors pairs in the same case that are well matched and also multiple transistors arrays that are very well paired and with nearly identical parameters. I know that those are more expensive, but for your specific case, you may try them. Also, can reduce component count.

  • @yellow_noise3
    @yellow_noise3 19 дней назад +1

    Well, amazing effort, but how it sound?

  • @isoslow
    @isoslow 20 дней назад

    Shoud've done R2R honestly.
    R2R is superior AND simpler than your contraption at the same time.

    • @odissey2
      @odissey2 5 дней назад

      The string DAC has superior INL. With 8-bit R2R, the INL>1 is common

  • @supul32
    @supul32 26 дней назад +4

    You can use JFETs instead of back to back MOSFETs.

    • @ivolol
      @ivolol 26 дней назад +3

      Unfortunately they are way more expensive currently

    • @SineLab
      @SineLab  25 дней назад +2

      I would have if the JFETs were as cheap as MOSFETs

    • @supul32
      @supul32 25 дней назад

      @@SineLab You can find many MPNs for cheaper prices at LCSC, I often get JFETs from them. :) There is a JFET sub category under the Transistors/Thyristors.
      for an example
      You can get J109 for around 20 cents. they also have hundreds of SMD MPNs as well. All in stock.
      Also, most of them available at JLC assembly library as well.

    • @supul32
      @supul32 25 дней назад

      @@SineLab BTW, great video!

  • @andytroo
    @andytroo 20 дней назад

    could you have a couple of micro adjustable resistors on the inner string - you'd only need 4 perhaps even 2 to tweak the values there to bring them into linearity

  • @paulstubbs7678
    @paulstubbs7678 25 дней назад

    Interesting, I was watching to see you get a signal (I assumed audio, as when I saw DAC in the title I assumed...) from a PC to your DAC, but you didn't go there.
    I have this ancient HP 'DAC' that I thought would be interesting to try and feed some audio into it to see what happens (it was intended to drive chart recorders). However getting a PC to route audio out a serial port where an Arduino etc can grab that data and feed it into my DAC is a problem.

  • @Baba_Kush
    @Baba_Kush 26 дней назад +1

    I am fine with my 1-Bit DAC outputs :D

  • @Qsderto
    @Qsderto 15 дней назад

    It’s better to try assembling a microwave ADC using discrete elements. Because they are actually almost unavailable for purchase. I would like to build a homemade oscilloscope.

  • @ophello
    @ophello 16 дней назад +1

    What’s wrong with a ladder DAC though? If the resistors are accurate enough, it seems like the simplest and most elegant solution.

  • @KangJangkrik
    @KangJangkrik 25 дней назад

    Precision resistors would fix that inaccuracy problem

  • @atoomnet
    @atoomnet 21 день назад +1

    At 13:10 please be careful with your combustible cloud generator.😲

    • @atoomnet
      @atoomnet 21 день назад +1

      Wait, I changed my mind: do NOT use any combustible liquid in an ultrasonic clear.

  • @olegpetrukhin3572
    @olegpetrukhin3572 25 дней назад

    In one device I saw the following signal conversion chain: photodiode -> amplifier -> ADC -> DAC -> ADC. Why do you think the developer chose this scheme?

  • @GermanMythbuster
    @GermanMythbuster 25 дней назад +1

    😖😖12:37 - Please get your self some flux, will make your life a lot easier :)
    13:20 - Also you don't have to fill your whole Ultrasonic cleaner, just fill it with water, take a smaller container (plastic bags work too) where your item barley fits in and fill that with as much solvent/cleaner as you need to cover it, then put the smaller container in the Ultrasonic cleaner with water.
    Saves you a lot of money and you contaminate less solvent, at some point the whole board would just get a little sticky.
    IDK what you pay for solvents but I bought a cheap glas still and every one or two years I distill my dirty solvents. Even with the first run I broke even.

  • @smartups1
    @smartups1 25 дней назад

    G.O.A.T

  • @xenoxaos1
    @xenoxaos1 25 дней назад

    Could you use the internal RDSon of the mosfets to make a dac?

    • @SineLab
      @SineLab  25 дней назад

      It would be very difficult to match RDSon for each MOSFET, but I guess it might be techincally possible.

  • @AlexanderBukh
    @AlexanderBukh 19 дней назад +1

    No comparison of off the shelf and diy on same screen? Sad. 😢

  • @Mrshutter
    @Mrshutter 22 дня назад

    Dude, use a R-2R resistor ladder network to create your DAC. I'm so confused

  • @mspeir
    @mspeir 27 дней назад +1

    Where do you get the hot plate?

    • @YoutubeBorkedMyOldHandle_why
      @YoutubeBorkedMyOldHandle_why 26 дней назад +3

      I bought one like this on amazon. They're cheap, only around $60. However, I'm not happy with putting PCBs directly on the plate. I put mine on a thick piece of aluminum for more even heating. First I suspend this about an inch above the hot plate to pre-heat the plate and PCB for a few minutes, then I move it onto the hotplate to finish the job. Another guy I know uses a square fry pan in the same way.

    • @mspeir
      @mspeir 26 дней назад +2

      @@RUclipsBorkedMyOldHandle_why Hmmm... Maybe I'll go the DIY reflow oven route. Thank you! I appreciate the response.

    • @SineLab
      @SineLab  25 дней назад +1

      I also got my hot plate on amazon.

  • @smartups1
    @smartups1 25 дней назад

    Class D next part ?

  • @chrisharper2658
    @chrisharper2658 26 дней назад

    If one LSB is 175uV then wouldn't 3 LSB be 2^3 * 175uV or 1.4mV?

    • @ivolol
      @ivolol 26 дней назад +1

      Depends if you are counting by the bit/code, or the value

    • @SineLab
      @SineLab  25 дней назад

      In this case, an LSB refers to the amount of voltage in just the first bit. 3 LSBs here means that increasing the code by 1 caused the code to increase by 3x what was expected.

    • @chrisharper2658
      @chrisharper2658 25 дней назад

      @@SineLab That would be 2 LSBs since the B stands for bits not counts.

  • @snozking
    @snozking 25 дней назад

    1:14 im sigma

  • @YoutubeBorkedMyOldHandle_why
    @YoutubeBorkedMyOldHandle_why 26 дней назад +1

    I've never understood why DACs always seem to be so damned expensive. Now ... I think I know.

  • @unknownhuman1000
    @unknownhuman1000 26 дней назад +2

    That was more complicated than necessary

  • @geekrulz1
    @geekrulz1 27 дней назад +1

    please learn how to pronounce scpi (The Standard Commands for Programmable Instruments (SCPI; often pronounced "skippy") )