Playing with R2R ladders - Page 1
Forum section: electronics / beginners

author: jgalak
author_rank: Regular Contributor
timestamp: February 03, 2018, 05:50:48 pm
content: So I built a poor-man's 4-bit DAC by using some resistors to form an R2R ladder. Worked well - I could create something that looked like a stair-step sine wave which, after being buffered with an op-amp and fed through a low-pass filter, gave me a decent sine wave.I kind of arbitrarily chose 12k and 24k resistors (1%) for the ladder, and it worked well. Whole thing was built up on a solderless breadboard, but since the speeds were low (under 3kHz) the breadboard capacitances and resistances, and the lead inductances, didn't really matter.I then got to thinking - the actual resistor values don't matter, and higher resistor values would mean lower current draw, right? So I swapped out for some 1.8M and 910k resistors. The resultant waveform went all over the place. Jagged, not resembling any reasonable sinewave, etc.I'm wondering why. I can see two possibilities: 1) with resistances that high, the poor connections of the solderless breadboard are enough to throw the tolerances all over the place or 2) the very low currents through these resistors (microamps) aren't enough to drive the op amp in a stable fashion (or even the scope probe when I probe upstream of the amp).I'm tending towards #1, in which case a properly built up PCB should resolve the issue, but before I start soldering I was hoping for a sanity check. Thoughts?

author: Benta
author_rank: Super Contributor
timestamp: February 03, 2018, 06:27:15 pm
content: Think about bias current and offset current for the opamp inputs. Contact resistance is quite certainly not an issue.

author: rstofer
author_rank: Super Contributor
timestamp: February 03, 2018, 06:42:54 pm
content: Post a scope image!Besides the problem of non-ideal op amps, consider just the high impedance of the revised circuit and the amount of electric field surrounding everything. Can a fluorescent lamp with an electronic ballast influence a high impedance circuit? Sure! To try it, just touch one of the resistor junctions and see what happens to the trace.Are you using x10 on your scope probes? x1 will be a problem because it is only has about 1 Mohm of input impedance and that's lower than the 2R value.

author: Damianos
author_rank: Frequent Contributor
timestamp: February 03, 2018, 07:35:56 pm
content: Quote from: jgalak on February 03, 2018, 05:50:48 pmThis thought is wrong for real circuits. With increasing resistance values, any effect of leakage and bias currents becomes significant.QuoteThis is the opposite: with hight higher values of the resistors, the resistance of the contacts becomes less important (it is a less percentage of the total value.QuoteThese both have their roles to produce difficulties. I don't know which op-amp you use, so I can't say more about it. For the oscilloscope probe think what is the percentage of the error due to the resistance, even if it is a 10X one.Also keep in mind that high resistance circuits are more susceptible to interference.QuoteYou had a good start, so I think that is better to analyse what is going on, before proceeding to the "final product".

author: David Hess
author_rank: Super Contributor
timestamp: February 03, 2018, 07:40:57 pm
content: Higher values of resistance make the effects from capacitance, leakage, and bias current greater. You can certainly build a working high resistance R2R ladder but extra consideration needs to be given to these issues.

author: jgalak
author_rank: Regular Contributor
timestamp: February 03, 2018, 09:24:54 pm
content: Even ignoring the opamp currents (which you are right, I didn't consider), it's not working right - I've disconnected the amp and filter, and used a 10x passive scope probe.Don't have a photo of this with the smaller resistors, but it looked like a well behaved "stairstep sine wave" with 3.3Vpp and offset so as to fit between ground and 3.3V.So assuming this is the high impedance output picking up various leakages, stray capacitances/inductances, noise, etc - Is there a way to estimate what the highest value resistors will be that will give me a clean output? I can just try different values until I'm happy, but wondering if there's a more scientific way...As to the opamp, I'm using an LMC6482 (http://www.ti.com/lit/ds/symlink/lmc6482.pdf) in a DIP package. Only using one half of it atm, may use the other half to do an active filter instead of the plain RC filter I am using now.