This R/2R DAC was my first sound card (just 8 bits) on my first PC back in the early ‘90s! I managed to fit 18 resistors and a 100nF capacitor for integration of the output signal in a DB25 plug back then, playing WAV files from the printer port of that old PC! 😊 Great video! It literally took me back to those years!
@phant0masterr
3 жыл бұрын
Covox speech thing! 😊
@mikeelmquist6620
3 жыл бұрын
Pp
@skesinis
3 жыл бұрын
@@phant0masterr Also known as “Disney Sound Source”. I found the schematics of it back then, on the text “readme” file of the “MODplay” player of Amiga music tracks. Something like a MIDI file with 8bit sampled instruments. It was supported by 1 or 2 games but I remember that I had to write the software to play the WAV files in assembly, because even Pascal wasn’t fast enough to play them at the actual speed. My 386sx/16MHz back then was even slower than an Arduino in some tasks!
@peter.s.3207
3 жыл бұрын
This is an excellent video explaining how early DACs were built and the principles behind them, nice work! One thing got me at the end however, you mentioned that the original input signal captured by the ADC could never be reconstructed exactly by the DAC. This is (mostly) incorrect though, as it ignores Nyquist-Shannon. If you band limit the input of the ADC at 1/2 your sampling frequency (idealized case) or lower (practically, 1/5 to 1/10 is sufficient for slow, non-specialty filters), then include an exact copy of this input filter on your output, you will reconstruct a mathematically identical signal to the one received! The limitation bit depth poses in this scenario is an increase in base noise floor, rather than a distortion of the signal itself. Because of this, these filters are nearly always included on off-the-shelf components designed for distortion sensitive applications.
@jacobrzeszewski6527
2 жыл бұрын
Ahhh, good old Nyquist Shannon sampling theorem.
@kennymd2488
3 жыл бұрын
Hi... I did a similar thing almost twenty years ago, through the "User-port" of my Vic 20 with 16 KBytes RAM expansion, to make a long research about PCM synthesis of percussive sounds (bass drums, snare drums, toms, claps, hi-hats etc... ). My "DAC" wasn't a R/2R type, but just eight resistors (10K-20K-40K-80K... ) from MSB to LSB, linked to a common line and "grounded" through a 10K resistor to convert the out from current to voltage levels. I created the sounds with BASIC programs that simulates sine oscillators, white and pink noise generators, "click" and "crack" A-R envelope generators, mixers and LP/HP filters (the elaboration's time was a little terrible, as you can guess!!!) and played with a simple Assembler programs, with a sample rate around 25 kHz. The result wasn't bad, it was a fun experience, but i soon discovered that 8 bit is too low as resolution for percussive sound voices (anyway some commercial drum-machines, as Korg's DDM 110/220 or DDD5 actually makes use of 8 bit samples... ). Now I'm thinking to assemble a vintage-style drum-machine with Eight sampled voice-cards triggered via MIDI by a DAW (as "Caustic 3" and the like), with a Pic and a simple cheap 16 bit DAC in any voice-card. Today a 16 bit DAC is cheaper than a bunch of 1% resistors... :-D Anyway I would like to listen to a 44/16 wav file through your home-made DAC expanded to 16 bit... Bye... :-)
@scottlarson1548
3 жыл бұрын
I also did something like that with, believe it or not, the parallel printer port on my Ohio Scientific computer (very similar to an old PET computer). I built an 8 bit DAC resistor network into a printer cable which I connected to my amplifier and I "printed" various wave forms which sounded... interesting. Random numbers made something of a rumbling white noise which could have sounded like explosions if I had known how to code envelopes. BASIC was too slow to make anything but the lowest frequency sine waves so I wrote a BASIC program to make a lookup table which then jumped into a machine language routine which "printed" values through the table, skipping values to increase the frequency. It didn't really sound like a pure sine wave but it had a flute-like sound. I could have done much more if I had known what I was doing.
@ditronix
Жыл бұрын
Although a year old now, just a quick thanks for the video. It has inspired me further, to explore the MCP4728 device on my latest IPEC ESP32 ATM90E32 IoT Power Energy Controller and Monitor board (variation on the original IPEM). So many different DACs and ADCs available v massive variations in cost and availability, it is sometimes not straight forward to choose one device for a particular design. Keep up the good work.
@dzee9481
3 жыл бұрын
These DACS are still still used in single chips since waffering Resistors is easy and produces very high tolerances. There are different kinds of DACs, and each of them have there specific requirements on their implementation.
@catthecommentbothunter6890
3 жыл бұрын
I will use this to power my stepper motor because i wanted to make a mechanical clock
@skesinis
3 жыл бұрын
You can also use as an alternative, one of the cheap stepper motors with a 64x gearbox divider which, combined with the 64 steps of the stepper gives 4096 steps for 360º, resolving better than 1/10º. I used a stepper motor like that to drive my telescope’s focuser, because I wanted the accuracy, especially for a 5x teleconverter when I’m imaging planets, and also because I wanted to focus without touching the telescope at such high magnifications.
@TheRealSneakyPlayz
3 жыл бұрын
Hi Karen, really enjoy your approach. Make it easy to understand. I want my kids to get into circuits and your approach will really help, Thanks!
@dashamm98
3 жыл бұрын
Useful for raspberry Pi GPIO also if you don't want to use any dedicated chips. If you use a standard shift register that almost any hobbyist has, you don't need many pins
@mavericklast2555
3 жыл бұрын
This is who I need to teach me arduino
@sanjaybhatikar
3 жыл бұрын
Love your clear explanations 💕
@AKONBATISTA
2 жыл бұрын
The tx and rx ports are always on due to the Serial.begin() command. This way, the first two bits are always on. To get over this problem you have two solutions, you can shift the pins by two, starting in pin 2, or just delete the Serial commands.
@ajinkyamahajan5736
3 жыл бұрын
Please next video on Delta Sigma ADC with Arduino
@RetroShare2
3 жыл бұрын
Why not using a low pass filter for the 8 bit one to see the difference to the 12 bit one?
@davidstonier-gibson5852
2 жыл бұрын
It's good to be teaching hobbyists this. But a 12 bit DAC with 1% resistors? It is likely to have some serious non-linearity issues. You would need 0.025% resistors for an honest 12 bit converter. I did one of these for a my first serious professional project back in 1968/69. AFAICR is was 6 or 7 bits. I only had 5% resistors available. But I did have a kickass DVM available. So I soldered a bunch of resistors in a long chain, applied a stable voltage and measured and noted the voltage drop across each resistor. Then I sorted them in order of relative resistance and picked an optimum combination.
@petercheung63
10 ай бұрын
great video, thanks
@bbqgiraffe3766
Жыл бұрын
3:40 oh wow, this is exactly how a 6522 VIA is programmed, I didn't realize my Arduino was so similar to my homebrew 6502 computer, cool
@MrCardeso
3 жыл бұрын
Cool! Thanks, Karen!
@jairoalexandermaldonadogon2966
3 жыл бұрын
Muchas gracias por tu tiempo.
@XanCraft21
8 ай бұрын
Thank you, this video really helped me. I have a question for you, if i were to use a controller that does not have any easy to use ports, could i use a shift register and a serial input to control the resistor ladder?
@Willow1w
3 ай бұрын
Oh snap I should watch this
@freedomisfood6966
2 ай бұрын
You are a scientist
@mikelee1906
2 жыл бұрын
Karen is the best!!!!!
@johnj596
10 ай бұрын
I love your videos! Can you make one explaining class D amplifiers and PWM?
@zvotaisvfi8678
Жыл бұрын
brilliant idea actually !!!! !!!! !!!!
@magiclay
5 ай бұрын
4 bits should show 16 different values?
@dt1133
9 ай бұрын
Awesome content. Thank you
@richgolfs
3 жыл бұрын
Well done! Good review
@hardware4200
3 жыл бұрын
Nice demo!
@element14presents
3 жыл бұрын
Glad you think so!
@U8uxa8SP
3 жыл бұрын
Thanks for the video, I enjoyed it.
@adambeedle
3 жыл бұрын
Great video 👍
@tlwbob
3 жыл бұрын
A question, the ADC on the Arduino is only 10bit, so surely the 12 bit is a bit fruitless?
@skesinis
3 жыл бұрын
Indeed the ADC of the Arduino is only 10bit, so reading back the 12bit output of the DAC will not be accurate, but it doesn’t mean that the DAC can’t be used to drive something else. After all, the redirection of the DAC’s output back to the 10bit ADC input of the Arduino was mostly to demonstrate the different bit depths ladder output on the video. On the other hand, a 12bit DAC on the 5V digital output of the Arduino, would theoretically resolve in 1.2mV per step. So using 1% resistors may give you noise higher than that in the end, assuming that your power source is also stable enough.
@Rob_III
3 жыл бұрын
@0:58: 6 bits is 64, 8 bits is 256.
@iamNaddy_
10 күн бұрын
Where can I get the source code and full review of the schematic diagram..??
@soggybottomboys2792
2 жыл бұрын
Time to see why 256 actually looks like 😂! I wouldn’t mind seeing a video on how this effects audio quality either
@jorgeaalmeida29
2 жыл бұрын
Congratulations ! Very good video. One question, please. Can I use this to audio? What is the high frequency possible? Thanks
@thebirdwatchingbloke3991
29 күн бұрын
Will this be functional with music or just test tones?
@snytty
11 ай бұрын
Does this cross 0v so it doesn't bias the audio signal by +2.5v?
@iggynub
Жыл бұрын
0:56 Isn't more bits purely the scale of assignable amplitude? Isn't 5:15 the digital version? I'd like to see the 8 bit sine on an oscilloscope after it is converted to analog.
@odissey2
2 жыл бұрын
It is not possible to achieve 12-bit resolution using R2R ladder and simple microcontroller. The problem lies in the resistors mismatch. Theoretically, even to achieve 8-bit resolution, 0.1% resistors are needed. But that is only part of the problem - the uC pins all have output resistances variation in the range of 100-200 oHms which adds to the mismatch error. Then take into consideration the pin voltage,Vdd, which is not very stable (typ 1-5% noise). There's more errors coming from the high-speed glitches due to pins risetime / falltme mismatch. In practice, 4-7 bits of resolution is achievable, depending on the update rate. What was shown here was at best 7-bit resolution in nearly static conditions. After falling into a pitfall and making few R2R DACs myself, I advise not to utilize such approach - a simple PWM DAC is more than adequate for the Arduino users, and saves a ton of digital pins on uC!
@vajskidsconsoles2005
2 жыл бұрын
Look at E-Tims 2007 R2R DAC for N64 to get digital RGB to Analogue, for a laugh. It's being commercialised. He compressed the shift register and D flip flops into a single CPLD but it's still using R2R.
@deang5622
2 жыл бұрын
It's why no one ever practically makes a discrete R/2R ladder network DAC. Covered it in a lecture at degree level in about 10 minutes. Never thought anyone would be stupid enough to make one and then try and teach people how to do it. It's pointless, it has no value, not even from a teaching perspective.
@ytubeleo
2 жыл бұрын
At 05:15, this appears to be 2-Bit (4 values) rather than 4-Bit (16 values).
@dirkgiglot912
2 жыл бұрын
I noticed this too. Serial ports Rx & Tx are the problem here. By using 2 Arduino's, one to generate and another to analogRead the signal it works correct.
@urmasjoeleht5293
3 жыл бұрын
This "zooming in" to 12 bits waveform shows pixels of screen, not 12bits DAC steps. Unless you have screen resolution with 4096 vertical lines. Nice video anyway :)!
@rezer1024
3 жыл бұрын
The jaggedness of the pixels isn't what she's referring to, but rather the slight waviness of the line that's similar to the previous stair-stepping of the output but on a scale of 4-5 pixels per step.
@005Ash
3 жыл бұрын
The delay() function pauses the program, is it still improves stability that way? 4:45
@johnmarquez7413
3 жыл бұрын
thx
@markderlo212
Жыл бұрын
nice; two notes: - when you change resolution you movevtge jumper wire, but you do nit show on schematic which one... - would be good to actually see the dac output on oscilloscope as well ; plot from serial is still ‘software’, we need real hardware signal, dont we?
@topgearIQ
2 жыл бұрын
Good
@riccardo1796
3 жыл бұрын
Will it work with my SoundRocks™ and solid gold speaker bus bar?
@jandupreez3759
2 жыл бұрын
Oh my goodness 😍😍
@TheHelp22
3 жыл бұрын
Question about the code. You step through i from 0 to 360 by 1 to calculate your sign wave. That is 360 steps. Shouldn't you have used MAX_12_BIT_NUM as the number of steps between 0 and 360? It still looks okay because you showed graphs of 8bit (255) and 12bit (4095)... I wonder if 10bit (1023) would look the same as 12bit because they both would have been truncated to 360 steps by your loop.
@maker_karen1785
3 жыл бұрын
I’m honestly not sure. Jeff wrote that part of the code and I didn’t fully understand how it worked. But since I was trying to create an arc 360 sounded right at the time.
@pracheerdeka6737
2 жыл бұрын
Why dont we use 1 resistor set at maximum loudest point
@petrbucha5762
3 жыл бұрын
super video😍👍🚂😉🍻
@Sidman723
3 жыл бұрын
Hey Karen, I met you at the Milwaukee Maker Faire a few years ago. Will you be at the one for this year? I plan to be there. Maybe I will bring my rPi mini Arcade.
@maker_karen1785
3 жыл бұрын
Yes. I’ll be working on the Powerwheels track helping run the races.
@awaazmatroko5972
3 жыл бұрын
Nice! Using any board, low budget , audio DSP 24bit 96khz, ADC- DAC, with room correction, pls if any do respond. Thanks
@stnwrd
2 жыл бұрын
Could you please demonstrate a 12 bit DAC without the use of an Arduino please?
@arnelcondino2634
3 жыл бұрын
Hi Karen
@maxpolaris99
3 жыл бұрын
Ok Teach!
@momomunsta8887
2 жыл бұрын
"Smooth and Siny" is t shirt material
@RussCottier
3 жыл бұрын
ADCs are not stairstep! 🤯 yes stairstep exists in sample hold. But it’s a bad way to explain ADC.
@freedomisfood6966
2 ай бұрын
And why 2r between r s .i dont have time think .just question for save my time😂😂😂😂
@MoebiuZ
Жыл бұрын
Pi pico pwm
@softdorothy
3 жыл бұрын
The programmer/nerd in me wants to declare the constants: MAX_4_BIT_NUM (1 >> 4) - 1 MAX_6_BIT_NUM (1 >> 6) - 1 MAX_8_BIT_NUM (1 >> 8) - 1 // etc.
@djm9937
3 жыл бұрын
So lovely, but all this is beyond my understanding
Пікірлер: 76