fab64
July 22, 2023, 7:03am
1
I would like to use the DAC for its basic purpose: getting a CC voltage.
I have configured the DAC to 8-bit resolution.
Setting the DAC's value to 255 I get an output voltage of ~2.76/2.77 V (5V = ~4.85V).
Is the DAC using an internal reference instead of the 5V? Can I change it? Which is the DAC's max output voltage and current?
Thx
int value = 0;
void setup() {
Serial.begin(115200);
analogWriteResolution(8);
analogWrite(DAC, value);
}
void loop() {
if (Serial.available() > 0) {
value = Serial.parseInt();
Serial.println("DAC Value " + String(value));
analogWrite(DAC, value);
}
delay(500);
}
b707
July 22, 2023, 7:04am
2
Please change the title - ADC and DAC is not the same....
ADC doesn't have "output voltage"
fab64
July 22, 2023, 7:48am
3
Thank you for reporting the typo. I am aware of the difference between ADC and DAC.
jim-p
July 22, 2023, 8:16am
5
Do you know what the reference voltage is?
1 Like
fab64,
Using your sketch, I get a value of 4.66V.
For me the "5V" is 4.68V.
fab64
July 22, 2023, 2:16pm
7
Hi John,
You are right. I have tried again and I now get the right values (4.79V @5V=4.81V).
In my previous test, I connected a LED to the DAC output trough a too low resistor (330 ohm, instead of 10k) by mistake. I hardly see the colors so I use marked boxes to keep resistors and clearly that resistor was in the wrong box.
Thx
I'm color blind (red green) so I always check the value with a dmm.
You didnt mention you had something already conected to the DAC output!