can't reach 5v with R2R DAC

Hello. I’m testing a R2R 7bit dac. The problem I have is when I write all the output HIGH the max voltage after the dac is 4,5v.
The code is only this:

void setup(){
  
  for(int i = 0; i < 7; i++){
    pinMode(i, OUTPUT);
  }

}


void loop(){
  
  for(int output = 0; output < 7; output++){
    
    digitalWrite(output, HIGH);
    
    
  }
}

and this is the schematic i followed
http://cdn.instructables.com/FKG/RU1U/H74326MJ/FKGRU1UH74326MJ.MEDIUM.jpg
I measured each digital out invididually and they are at 5,05v or so.
But instead of using 10k-20k I used 100k-200k. I don’t know if this would be the problem…

thanks

This
output = 0; output < 7; output++
only goes 0-1-2-3-4-5-6

Your schematic shows 8 inputs:
output = 0; output < 8; output++

You only have 7 tho? And with all high you only see 4.5V at the top pin?
You have 200K every where there is 20K, and 100K everythere is 10k? Didnt get any swapped by accident?

Yes I have only 7. I followed that tutorial but then I realised i'm fine with 7bit. I was checking again but they're all in order. I measured the total of the 100k resistors plus de 200k to ground, and I got 800k. Also I checked the resistance of each output. I was hoping that my eyes tricked me. Red and Brown are very similar on metalfilm resistors. I'll check again though. I can post a pic of my protoboard is needed, thanks

Yes, please do.

The red cable goes to gnd. White to dvm probe and at the other side the crocodile goes to the other probe

Hi, with 200K resistors is the output impedance of the R-2R to high and the DMM loading is causing a problem. I'd say use 10k and 20k and see what happens.

Tom..... :)

Hmm, don't see anything obviously wrong.

. I'll check if I have 10k-20k resistors thanks

5V output with No resistors can be read as 5V with a meter - with 800K that’s practically no resistors.

Check your code - is pinMode set to output for all 7 outputs?

I measured each output from D0 to D6 and they're at around 5,07v

And at the other side of the resistor its 4.5V? I would guess voltage divider effect. Ex top output voltage if the lower 6 were set to inputs would be: 5V*(10K+10K+10K+10K+10K+10K+20K)/(20K + (10K+10K+10K+10K+10K+10K+20K)) = 5*80000/(1000000) = 0.4V, do the math on the others, add them up, and you will be under 5V.

The voltage at the output(last resistor) is 4,57. AT the other side of this resistor it’s 4,66v

You said the output pins were 5.07, "left side" of the top 200K resistor- and "right side" going to part "922" is 4.5. Where is the 4.66 from?

Oh sorry. I meant at one side of the 100k resistor at the output of the dac.
Yes it’s 5,07v on the node between the output pin and resistor. ANd on the other side of this 200k resistor is 4,57v.
it’s 4,66

Not gonna get much better.

Hi, when you took the measurements in reply #13, were ALL the outputs high? All outputs need to be high for highest output on output node. Please check.

Tom...... :)

The voltages you cite suggest that the op-amp is drawing 34 microamps from the network. That would not be unusual for a transistor-based op-amp, but surprising for a CMOS device as the 922 is described.

I have a suspicion that it is in fact your multimeter that is pulling down the voltages.

Of course, if you are merely using this to drive an audio amplifier, how closely it approaches 5V is quite irrelevant. It would seem to be working just fine.

Yes they were all high. Actually, I just built the R2R dac, without op-amps. I wanted to test this part first. Anyhow, I really need to have a range from 0-5v. It's not for audio. I generate DC signals and control analog synthesizers. Each volt is an octave, so to have 5 octaves i need 5v

As suggested, your meter is pulling the voltage down. Go with 10k/20k.

Gerry

That's not realistic. There will always be at least 1 transistor drop between the output and 5V. If you want 5V, you need Vcc to be > 5V.