I’m noodling on a secret project involving an Arduino, but realized that my understanding of the Arduino voltage outputs didn’t match reality. Since Arduino voltage outputs use PWM rather than precise values, I’ll need to use a DAC in order to set specific voltages.
My survey of DAC options have turned up a few choices used in other modular setups, notably the more expensive DAC8565 used in the Ornament and Crime and the cheaper MCP4922 used in the Euroduino and elsewhere. I’ve also seen recommendations for the WM8731.
I’ve got a few questions that I was hoping some of the wise elders here could help with. It seems both of the devices can output 0-5v directly, but a lot of the circuits I’ve seen use TL072s to boost the signal after the DAC output, which to me seems like it would mess up control voltage values, but somehow it doesn’t? Are they just expecting this scaling factor in the code and losing some resolution? Is there any reason why these are necessary (outside of synth-level audio lines, which is a whole other can of worms…)
Anyway, I guess I’m generally looking for people’s experience with DACs in audio applications. Any tips or pitfalls I should know about? Any other chips out there you’d recommend?
It really depends on what you want to do with it…
If it’s audio, you’ll need the OpAmp to convert the 0V/5V to -5V/+5V (or whatever range you want)…
If it’s CV that isn’t 1V/Oct, the PWM of the Arduino is usually “good enough”.
You can even get accurate 1V/Oct with PWM if you only want semi-tones and nothing in-between.
And so on…
You can even get accurate 1V/Oct with PWM if you only want semi-tones and nothing in-between.
This is really surprising to me! I can see why this would work for a motor or an LED, but I can’t intuitively understand how it would work for v/oct. Even for things like envelopes, it seems like the PWM would create an audible “stepping”, or even just a stuttering, square-sounding effect…
The MCP4922 doesn’t need buffering for the outputs, but it can be useful to scale and shift its 0–5 V output to some other range, hence the op amps. And yes, you’d typically write the code with that scaling and offsetting in mind. You’re not losing resolution, you still have 12 bits or whatever, just mapped to a different output range.
The trick is to keep the PWM frequency way above the audible range, e.g. the MidiMuso uses a 62 kHz PWM (fed into a simple low-pass filter).
(a well-done PWM can be more precise than your average DAC, since it’s a lot easier to generate a precise clock than it is to calibrate the resistor network inside a DAC…)
This is really interesting. It does require extremely precise calibration and matched resistors though, which would be too much for what I’ve got in mind. Thanks for sharing, learned something new today.
Okay, that sounds great. Looking more and more like that’s the guy for my business.
What about other protections on the signal paths? I assume the inputs need op-amps to prevent overvoltage to the arduino somehow, does the output path need some kind of diode protection against a hot input being plugged into the output by mistake?
Internally there are op amps on the MCP4922 output pins. Check the datasheet but I would think it could be treated like a typical op amp. Vcc is limited to 5.5 V though so if there’s a chance a 12 V CV could be plugged into the output you’d probably want protection against that.
Why the 2n3904’s coming before the “gate” outputs? Are those outputs there just because they were still available from the Arduino, but there was no more room on the DAC, so they can just do only 0/5V, or is there another reason why the Gate and CV outs need to be segregated?
Same for the Gate In
What’s the point of the chip REF02CP if there’s a 5V output coming straight from the Arduino already?
Do you actually use the 0-10v for audio range applications out of this? Or is just capability just to send more powerful gates?
Make sure to also check out the DAC MCP4728. It is not very expensive and it is addressed via i2c bus so you can add multiple devices easily to an Arduino. It also has an internal voltage reference of ~4V.
There are gate outputs and there are CV outputs. The former are off or on, 0 or 5 V, the latter are 0–10 V or ±5 V or 0–5 V. You don’t need a DAC to do the former, just a digital pin which is buffered with a transistor to protect the Arduino.
On the inputs, the gates are buffered (and inverted) again with a transistor and sent to digital pins, while the CVs need to go more or less direct to analog pins, with a current limiting resistor and a pair of Schottkys to ground and +5 V, again to protect the Arduino.
The Arduino “5 V” output is only approximately 5 V, whatever the regulator puts out; the REF02CP is a precision voltage reference that gives a more exact voltage.
In some applications one wants a 0 to 10 V CV, for instance a V/oct CV for an oscillator that puts out a low C with 0 V (as opposed to one that puts out middle C, with lower notes corresponding to negative CV). The board isn’t designed with audio output in mind although it presumably can be done.
Hi, one of the reasons for an OpAmp on the output of a DAC is to BUFFER the output.
The DAC may not have the current output capacity that you require, so a Unity Gain amplifier is added to provide the same DAC output voltage but with a better current capacity.
With a gain of one you will not loose any resolution.
The only concern is if your DAC outputs gnd to 5V swing, you will have to find what is called a “rail to rail” Opamp, as most cannot output gnd or Vcc due to their output circuitry configuration.
I’m not sure how many DAC you want to connect to your Arduino (what model?) but I2C comms would be easiest and use as little amount of wiring as possible, just check how many different I2C addresses you have available with any of the DAC.
There are solutions if you have more than one unit with the same I2C address.