Building a Discrete 14-Bit String DAC

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

ความคิดเห็น • 104

  • @JustAnotherAlchemist
    @JustAnotherAlchemist 2 หลายเดือนก่อน +34

    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 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      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 2 หลายเดือนก่อน +2

      @@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 2 หลายเดือนก่อน +4

      @@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 2 หลายเดือนก่อน

      @@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).

  • @hardwareful
    @hardwareful 2 หลายเดือนก่อน +49

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

    • @SineLab
      @SineLab  2 หลายเดือนก่อน +4

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

    • @hardwareful
      @hardwareful 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      @@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 2 หลายเดือนก่อน +1

      glass jar is good too.

    • @johanness6545
      @johanness6545 2 หลายเดือนก่อน +2

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

  • @Gengh13
    @Gengh13 2 หลายเดือนก่อน +18

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

  • @borissinaga
    @borissinaga 2 หลายเดือนก่อน +9

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

    • @SineLab
      @SineLab  2 หลายเดือนก่อน +1

      It took a while to finish this project. :)

  • @NNNILabs
    @NNNILabs 2 หลายเดือนก่อน +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.

  • @WarkWarbly
    @WarkWarbly 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน +1

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

  • @mikeselectricstuff
    @mikeselectricstuff 2 หลายเดือนก่อน +15

    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  2 หลายเดือนก่อน +1

      I'll take a look into getting one

    • @silverXnoise
      @silverXnoise 2 หลายเดือนก่อน

      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!

  • @FriendlyIntentions
    @FriendlyIntentions 2 หลายเดือนก่อน +78

    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  2 หลายเดือนก่อน +11

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

    • @sqeekykleen49
      @sqeekykleen49 2 หลายเดือนก่อน +2

      😂 earth and god... oh gnd

    • @Mr.Leeroy
      @Mr.Leeroy 2 หลายเดือนก่อน +2

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

    • @kiyoponnn
      @kiyoponnn หลายเดือนก่อน

      what's the difference between virtual ground and gnd?

    • @mateijordache1952
      @mateijordache1952 หลายเดือนก่อน

      @@kiyoponnna point on the circuit not attached to ground, but has a feedback loop driving to ground, so they are “virtually” the same.

  • @victorman2227
    @victorman2227 2 หลายเดือนก่อน +2

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

  • @totally_not_a_robot1342
    @totally_not_a_robot1342 2 หลายเดือนก่อน +4

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

  • @harrylenon9594
    @harrylenon9594 หลายเดือนก่อน

    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

  • @mikemironov7551
    @mikemironov7551 2 หลายเดือนก่อน +3

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

    • @opinair
      @opinair 2 หลายเดือนก่อน

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

    • @opinair
      @opinair 2 หลายเดือนก่อน

      higt frequency pwm give faster abd beter result😊

    • @opinair
      @opinair 2 หลายเดือนก่อน

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

    • @destiny_02
      @destiny_02 2 หลายเดือนก่อน

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

    • @opinair
      @opinair 2 หลายเดือนก่อน

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

  • @georgewaller7080
    @georgewaller7080 หลายเดือนก่อน +2

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

  • @yellow_noise3
    @yellow_noise3 2 หลายเดือนก่อน +2

    Well, amazing effort, but how it sound?

  • @andytroo
    @andytroo 2 หลายเดือนก่อน

    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

  • @benjaminhanke79
    @benjaminhanke79 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน +1

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

    • @benjaminhanke79
      @benjaminhanke79 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน +3

      I may make an ADC at some point.

    • @thephantompsychic
      @thephantompsychic 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      @@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?

  • @dinistor1254
    @dinistor1254 2 หลายเดือนก่อน +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:)

  • @hendriagustian7082
    @hendriagustian7082 2 หลายเดือนก่อน +1

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

  • @jenyjek5055
    @jenyjek5055 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน +2

      Thanks, it does seem much safer that way

  • @sebastian19745
    @sebastian19745 2 หลายเดือนก่อน

    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.

  • @stephenkioko4205
    @stephenkioko4205 2 หลายเดือนก่อน +2

    Another descret components circuit,thanks bro

  • @AnotherBrokenToaster
    @AnotherBrokenToaster 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน +1

      String DACs can be deceptively complex.

  • @paulstubbs7678
    @paulstubbs7678 2 หลายเดือนก่อน

    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.

  • @jarvisxiii
    @jarvisxiii 2 หลายเดือนก่อน +1

    Wow, Very cool! DACs rule!

  • @bubbasplants189
    @bubbasplants189 2 หลายเดือนก่อน

    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!

  • @supul32
    @supul32 2 หลายเดือนก่อน +4

    You can use JFETs instead of back to back MOSFETs.

    • @ivolol
      @ivolol 2 หลายเดือนก่อน +3

      Unfortunately they are way more expensive currently

    • @SineLab
      @SineLab  2 หลายเดือนก่อน +3

      I would have if the JFETs were as cheap as MOSFETs

    • @supul32
      @supul32 2 หลายเดือนก่อน

      @@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 2 หลายเดือนก่อน

      @@SineLab BTW, great video!

  • @ophello
    @ophello 2 หลายเดือนก่อน +2

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

    • @SineLab
      @SineLab  วันที่ผ่านมา

      It's easier to build a ladder, I just wanted to show a design topology that is usually only found inside of integrated circuits.

  • @KludgesFromKevinsCave
    @KludgesFromKevinsCave หลายเดือนก่อน

    Hmm... For Q7-Q10, Q14 and maybe Q11-Q12, I'd have probably used a 74xx4066 rather than all those 2N7002's. One SOIC-14 is an easier soldering job than eight SOT-26's, and those transistors are all right next to one another in the circuit. (Didn't go through the schematic in detail to look for other things like that.)
    Did it really simplify your layout that much to use all those 74LVC1G04 rather than six-packs?
    If you have only a few components on the back side of the board, you can use paste with a lower melting point and reflow with hot air. Easier than hand soldering, at least with my shaky hands.
    I've built a few mirrors recently with DMMT5401 matched pairs. They seem to work pretty well, but I don't have your measurement tools.
    The biggest single takeaway from this video is that analog IC's (and ADC's and DAC's) are amazing things that you are never going to replicate properly with discrete components. But it's fun to try - and important to learn what's going on inside those prepackaged miracles.

  • @opinair
    @opinair 2 หลายเดือนก่อน

    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

  • @ModelLights
    @ModelLights 2 หลายเดือนก่อน

    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 2 หลายเดือนก่อน

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

  • @GermanMythbuster
    @GermanMythbuster 2 หลายเดือนก่อน +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.

  • @olegpetrukhin3572
    @olegpetrukhin3572 2 หลายเดือนก่อน

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

  • @xenoxaos1
    @xenoxaos1 2 หลายเดือนก่อน

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

    • @SineLab
      @SineLab  2 หลายเดือนก่อน

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

  • @Qsderto
    @Qsderto หลายเดือนก่อน

    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.

  • @magoostus
    @magoostus 4 วันที่ผ่านมา

    i just cant see how this could ever be better than a delta-sigma modulator, but I am also dumb so idk

  • @atoomnet
    @atoomnet 2 หลายเดือนก่อน +1

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

    • @atoomnet
      @atoomnet 2 หลายเดือนก่อน +1

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

  • @KangJangkrik
    @KangJangkrik 2 หลายเดือนก่อน

    Precision resistors would fix that inaccuracy problem

  • @Baba_Kush
    @Baba_Kush 2 หลายเดือนก่อน +1

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

  • @isoslow
    @isoslow 2 หลายเดือนก่อน

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

    • @odissey2
      @odissey2 หลายเดือนก่อน

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

  • @mspeir
    @mspeir 2 หลายเดือนก่อน +1

    Where do you get the hot plate?

    • @YoutubeBorkedMyOldHandle_why
      @YoutubeBorkedMyOldHandle_why 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน +2

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

    • @SineLab
      @SineLab  2 หลายเดือนก่อน +1

      I also got my hot plate on amazon.

  • @marcinelektronik
    @marcinelektronik 2 หลายเดือนก่อน +6

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

    • @roms_jr
      @roms_jr 20 วันที่ผ่านมา

      🤥

  • @AlexanderBukh
    @AlexanderBukh 2 หลายเดือนก่อน +1

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

  • @chrisharper2658
    @chrisharper2658 2 หลายเดือนก่อน

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

    • @ivolol
      @ivolol 2 หลายเดือนก่อน +1

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

    • @SineLab
      @SineLab  2 หลายเดือนก่อน

      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 2 หลายเดือนก่อน

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

  • @Mrshutter
    @Mrshutter 2 หลายเดือนก่อน

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

    • @SineLab
      @SineLab  วันที่ผ่านมา

      It's easier to build a ladder, I just wanted to show a design topology that is usually only found inside of integrated circuits.

  • @smartups1
    @smartups1 2 หลายเดือนก่อน

    Class D next part ?

  • @smartups1
    @smartups1 2 หลายเดือนก่อน

    G.O.A.T

  • @snozking
    @snozking 2 หลายเดือนก่อน

    1:14 im sigma

  • @YoutubeBorkedMyOldHandle_why
    @YoutubeBorkedMyOldHandle_why 2 หลายเดือนก่อน +1

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

  • @unknownhuman1000
    @unknownhuman1000 2 หลายเดือนก่อน +2

    That was more complicated than necessary

  • @geekrulz1
    @geekrulz1 2 หลายเดือนก่อน +1

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