Help with creating proportional DC output circuit for CV/LFO

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Hi. While I can contribute to this community in other ways, I have no skill with circuit design. That said, I'm looking for help designing a simple circuit that will take a 0.55 V to 2.75 V DC signal and proportionally map it to 0-10V DC @ 500mA max load. Available rail voltages are +12, -12, and +5 V DC.

My interest is in creating complex waveforms via Arduino DUE (the programming I've got covered!) to drive CV inputs to various modular synth modules. This is not for pitch, rather I'm more interested in Low Freq Oscillator (LFO) functions. The DUE has built-in D/A converter output of 0.55 V to 2.75 V.

I think a decent start could be the output section of this thread "need-help-on-converting-0-5v-signal-to-0-10v-signal" but obviously my input voltages are different.

Thank you in advance!
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
5oomA is a fair amount of current, why so much?

How fast does this signal change?
Hi Crutschow. You're right, it is a lot of current, just playing it safe. I searched the internet high and low to no avail for info about typical load on these circuits. I guess 50mA would be plenty of juice.

As far as the rate, for my purposes, I would program the frequency not to exceed ~20Hz.

This is my first experiment integrating Arduino with analog synth circuits, so these parameters are not super important to me at the moment. Once I have a basic working circuit, I'll undoubtedly play around with it.
 

ebeowulf17

Joined Aug 12, 2014
2,945
Hi Crutschow. You're right, it is a lot of current, just playing it safe. I searched the internet high and low to no avail for info about typical load on these circuits. I guess 50mA would be plenty of juice.

As far as the rate, for my purposes, I would program the frequency not to exceed ~20Hz.

This is my first experiment integrating Arduino with analog synth circuits, so these parameters are not super important to me at the moment. Once I have a basic working circuit, I'll undoubtedly play around with it.
Do you have anything that works well with the CV inputs at the moment? I'm wondering if you might be able to stick a multi meter inline and get a current reading on what is typically used to control this circuit. With a little luck, a simple measurement might be easier and more useful than web searches and guesswork.

I'm sure crutschow can come up with an effective circuit for whatever requirements you have, but I imagine it'll be a lot easier if the current turns out to be much lower.
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Do you have anything that works well with the CV inputs at the moment? I'm wondering if you might be able to stick a multi meter inline and get a current reading on what is typically used to control this circuit. With a little luck, a simple measurement might be easier and more useful than web searches and guesswork.

I'm sure crutschow can come up with an effective circuit for whatever requirements you have, but I imagine it'll be a lot easier if the current turns out to be much lower.
@ebewulf17 You're so right! I metered the LFO output of a module in my system and measured a maximum of 0.1mA @ 9V – seems hard to believe, but that's what the meter said. I triple checked it. Waiting to hear back from a DIY synth builder named Leon VanBokhorst in The Netherlands to see what he thinks about the current question. I'll post what he replies. In the meanwhile, I have to assume my measurements are fairly accurate.
 

ebeowulf17

Joined Aug 12, 2014
2,945
@ebewulf17 You're so right! I metered the LFO output of a module in my system and measured a maximum of 0.1mA @ 9V – seems hard to believe, but that's what the meter said. I triple checked it. Waiting to hear back from a DIY synth builder named Leon VanBokhorst in The Netherlands to see what he thinks about the current question. I'll post what he replies. In the meanwhile, I have to assume my measurements are fairly accurate.
Well, this is not my area of expertise at all, but that number seems reasonable to me to me, at least if your VCO is anything like the "typical" VCO circuit here:
https://www.allaboutcircuits.com/projects/diy-synth-series-vco/

Running the numbers on that one, I come up with roughly 0.14mA for a 9V input, right in the same general range as your reading.
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Well, this is not my area of expertise at all, but that number seems reasonable to me to me, at least if your VCO is anything like the "typical" VCO circuit here:
https://www.allaboutcircuits.com/projects/diy-synth-series-vco/

Running the numbers on that one, I come up with roughly 0.14mA for a 9V input, right in the same general range as your reading.
I heard back from Leon who also confirmed my measurements, he reported ~0.05mA for his system. So I think we can confirm a max of ~0.2mA for current draw. @crutschow – there are you answers: 20Hz freq and 0.2mA load. Is this information you can use to sketch-up a wee circuit? :)
 

crutschow

Joined Mar 14, 2008
23,526
Below is the LTspice simulation of a common opamp summer circuit to perform the signal gain and shift.
It could be done with one opamp, but two allow independent adjustment of the offset (R5) and gain (R1).

If you may need to tweak these values you can use a 500kΩ pot for R5 and a 20kΩ pot in series with a 10kΩ resistor for R1. The offset depends upon the actual voltage of the -12V supply.
If that voltage is not accurate/stable enough, a simple voltage reference can be added, such as a TL431.

The opamp can be just about any common available with a ≥30V supply voltage rating.

upload_2018-3-14_11-5-28.png
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
WOW! That's awesome!! Thank you SO much!!

In addition to the resistors (I'm pretty sure I have all the specified values), I happen to have a pair of LF356's on hand (how lucky is that?!?). By the data sheet the Vmax is 36V so they should work in place of the LM358.

Regarding the link to the VCO you included. To answer your question, yes these circuits would ideally be compatible. That said, it now comes to mind that a buffer is typical on the output. Would I add a third op amp following your OUTPUT, or is that essentially what the second op amp is in your circuit?

Thanks again crutschow! I'm off to bread this up and will report back promptly – stay tuned!

 
Last edited:

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Oops, correction: Regarding the link to the VCO that ebeowulf17 included in his post. The question remains: do I add another op amp to buffer the output?

Thanks!
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
First, thank's again crutschow. Very kind of you to take your time on my behalf.

Second, my disclaimer: It is late, I worked a long day, and I'm tired (when I'm tired, my eyesight isn't 100%). Oh, and I have a toddler in the house which impacts my attention to detail – haha!

That said, I patched the circuit together on the breadboard and the circuit worked. Mostly. I'll preface my observations with the fact that I have no expectation that you will spend another second on this, just providing feedback that is well deserved.

What the meter said:
I ran the LOW signal (0) from the Arduino, the meter reads -2.25 V.
I ran a HIGH signal (255) from the Arduino, the meter reads +10.35 V.

There's no change to any reading when I adjust R1 or R5. So something isn't right with the gain and offset. Very possibly I might have made an error on the hookup which I'll double check tomorrow. What did have a major impact on the output was adjusting R4. That's the quantitative feedback. Now for the qualitative observations. . .

What it sounds like: (setup: I adjusted the code's digital LOW as 45 and HIGH as 245 which calibrated the voltage from 0 - 10 V as read on the meter)
Sweeping the VCO: Going in I had no expectation that this would accurately track pitch (driving a VCO) due to the low bit depth of the Arduino I'm using. (I might add a 12 bit DAC tomorrow). I did run a slow triangle wave sweep from LOW to HIGH. When I plug our circuit (outputting a triangle wave) into the VCO input, the pitch immediately jumps several octaves (even when the signal is set to the LOW 0V which should force the oscillator to the low end of the pitch scale). Oddly, though, as the cycle sweeps, the pitch doesn't change even though the meter is reading a perfect 0-10 V sweep. What does seem to change is the pulse width. I'll hook it up to a scope tomorrow to confirm.
Sweeping the VCF: This is where it's REALLY weird – the same effect; that is, the cutoff freq doesn't sweep, but it does sound like the pulse width is sweeping. That's really weird. I wonder of this all has something to do with an output buffer (or lack there of??).

So, those are my first pass observations. Again, I'm very grateful for what you've done for me, so I'm not asking for any more of your time. I need to spend some time on it tomorrow with fresh and rested eyes and also hook up the scope.

Overall, I'm very excited about this as a base that I can learn and grow my knowledge from. So, thank you again!!
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
2,945
First, thank's again crutschow. Very kind of you to take your time on my behalf.

Second, my disclaimer: It is late, I worked a long day, and I'm tired (when I'm tired, my eyesight isn't 100%). Oh, and I have a toddler in the house which impacts my attention to detail – haha!

That said, I patched the circuit together on the breadboard and the circuit worked. Mostly. I'll preface my observations with the fact that I have no expectation that you will spend another second on this, just providing feedback that is well deserved.

What the meter said:
I ran the LOW signal (0) from the Arduino, the meter reads -2.25 V.
I ran a HIGH signal (255) from the Arduino, the meter reads +10.35 V.

There's no change to any reading when I adjust R1 or R5. So something isn't right with the gain and offset. Very possibly I might have made an error on the hookup which I'll double check tomorrow. What did have a major impact on the output was adjusting R4. That's the quantitative feedback. Now for the qualitative observations. . .

What it sounds like: (setup: I adjusted the code's digital LOW as 45 and HIGH as 245 which calibrated the voltage from 0 - 10 V as read on the meter)
Sweeping the VCO: Going in I had no expectation that this would accurately track pitch (driving a VCO), but I did run a slow triangle wave sweep from LOW to HIGH. When I plug our circuit (outputting a triangle wave) into the VCO input, the pitch immediately jumps several octaves (even when the signal is set to the LOW 0V). Oddly, though, as the cycle sweeps, the pitch doesn't change even though the meter is reading a perfect 0-10 V sweep. What does seem to change is the pulse width. I'll hook it up to a scope tomorrow to confirm.
Sweeping the VCF: This is where it's REALLY weird – the same effect; that is, the cutoff freq doesn't sweep, but it does sound like the pulse width is sweeping. That's really weird. I wonder of this all has something to do with an output buffer (or lack there of??).

So, those are my first pass observations. Again, I'm very grateful for what you've done for me, so I'm not asking for any more of your time. I need to spend some time on it tomorrow with fresh and rested eyes and also hook up the scope.

Overall, I'm very excited about this as a base that I can learn and grow my knowledge from. So, thank you again!!
Among the things you double check tomorrow, could you confirm what the DAC voltage outputs are when you set 0 and 255 outputs which result in -2.25 and 10.35V readings?

I'm wondering if the DAC output isn't getting pulled around by the input stage of this circuit? I have a sneaking suspicion that the Arduino DAC has very little current sourcing capability... Although that's just a guess - I haven't looked up data sheets to figure it out. If it is being changed, an op amp configured as a voltage follower to buffer the DAC output might help.

Either way, confirming input voltages is always a good idea when examining output voltages from a circuit.
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Will check that. In fact, your question made me realized a small error I made. When I originally specified the output voltages of the Arduino, I was referencing a different microprocessor that has built-in DAC (the Arduino "Due") with an output range of 0.55 V to 2.75 V DC. I'm not using that model currently (the Due is on order). I'm using an "Uno", which has a different output characteristic. In fact, this is predictably most if not all of my issue. That said, It's still weird that there's no change when I vary the R! and R5 values.

From the datasheet for the Uno: DC Current per I/O Pin 40 mA, and output is 8bit PWM. I'll confirm output voltages.

OK, off to the day job, will get back to this in about 12 hours.

Thanks!!
 

ebeowulf17

Joined Aug 12, 2014
2,945
Will check that. In fact, your question made me realized a small error I made. When I originally specified the output voltages of the Arduino, I was referencing a different microprocessor that has built-in DAC (the Arduino "Due") with an output range of 0.55 V to 2.75 V DC. I'm not using that model currently (the Due is on order). I'm using an "Uno", which has a different output characteristic. In fact, this is predictably most if not all of my issue. That said, It's still weird that there's no change when I vary the R! and R5 values.

From the datasheet for the Uno: DC Current per I/O Pin 40 mA, and output is 8bit PWM. I'll confirm output voltages.

OK, off to the day job, will get back to this in about 12 hours.

Thanks!!
Yeah, the Uno GPIO pins can definitely source enough current that the input stage of this circuit shouldn't effect them... but since they're PWM, not actual DAC pins, they're not going to do what you want at all.

With the Uno PWM output, there's never an output voltage other than off or on (roughly 0 & 5V) so the circuit crutschow provided is (presumably) perfectly recreating the square wave from the Arduino, but scaled to your specs. Since the spec required 0.55 and 2.75 to be mapped to the total range of 0-10V output, it's not surprising that values beyond the expected input range (0-5 instead of 0.55-2.75) are mapped outside of the intended output range. This is probably also why the trim adjustments seem to have no effect. Certainly on the high side of the range you're spending a lot of time with the op amp output saturated. I'm less certain what I'd expect on the low side, but it doesn't really matter. You just need to feed it analog DC instead of PWM before evaluating its performance.

If you want to play around with the Uno before your Due arrives, you can vaguely approximate analog DC output by adding an RC filter (probably followed by an op amp buffer) between the Uno PWM pin and the new circuit. It's far from perfect - lower RC values will mean more ripple remains, and higher RC values will mean slower step changes between notes (glissando, I think? I've forgotten a lot of the music terminology I once knew!) Still, it would at least give you a vague idea of whether or not things are working until the Due arrives.

Without some sort of filter I don't think you can do anything useful with PWM feeding through crutschow's circuit.
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Yeah, the Uno GPIO pins can definitely source enough current that the input stage of this circuit shouldn't effect them... but since they're PWM, not actual DAC pins, they're not going to do what you want at all.

With the Uno PWM output, there's never an output voltage other than off or on (roughly 0 & 5V) so the circuit crutschow provided is (presumably) perfectly recreating the square wave from the Arduino, but scaled to your specs. Since the spec required 0.55 and 2.75 to be mapped to the total range of 0-10V output, it's not surprising that values beyond the expected input range (0-5 instead of 0.55-2.75) are mapped outside of the intended output range. This is probably also why the trim adjustments seem to have no effect. Certainly on the high side of the range you're spending a lot of time with the op amp output saturated. I'm less certain what I'd expect on the low side, but it doesn't really matter. You just need to feed it analog DC instead of PWM before evaluating its performance.

If you want to play around with the Uno before your Due arrives, you can vaguely approximate analog DC output by adding an RC filter (probably followed by an op amp buffer) between the Uno PWM pin and the new circuit. It's far from perfect - lower RC values will mean more ripple remains, and higher RC values will mean slower step changes between notes (glissando, I think? I've forgotten a lot of the music terminology I once knew!) Still, it would at least give you a vague idea of whether or not things are working until the Due arrives.

Without some sort of filter I don't think you can do anything useful with PWM feeding through crutschow's circuit.
Yep, you got it: Glissando, though synths tend to use the term Portamento. The difference being wether or not the notes are connected for a continuous tone (glissando), or independently slid into or out of (portamento).

That's exactly what I was thinking the issue is. I'm in no rush on this, so I'll wait until the Due, arrives. Thanks for your observations and speculations!! Will report back when the Due arrives. Cheers!
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
Alright! I finally got the Adruino DUE, threw a slow triangle wave program together to output the full 12bit range (0-4096), measured the output from the DAC which was 0.55 - 2.75V. Plugged that output into the CRUTSCHOW CONVERTER and got a sweet 0-10V. Awesome!!

OK, that's ALMOST true. I received the DUE a few days ago, but it's a much more complicated animal than the UNO, so I was kind of dead in the water getting the code to output through the DAC. The programming of the DAC was a bit beyond my grasp currently. :(

However, while waiting for the DUE processor to arrive, I realized I could add a separate DAC board to a standard Arduino UNO. (duh!). The DAC arrived today, I hooked it up to the UNO, wrote a bit of code to create a slow triangle wave counting digitally from 0-4096 digital which output 0-5V. Hmm. That's way off from the 0.55 - 2.75 that the DUE outputs. (and that crutschow designed for). So I adjusted my code to output 0.55V (448 digital) to 2.75V (2280 digital), confirmed the voltages, plugged that output into the CRUTSCHOW CONVERTER and Wah La!! 0-10V at the output of the converter circuit. So sweet! And even though it's an abbreviated count (448-2280 = 1832 steps) it still outputs a very smooth ramp. It even works to control pitch (VCO) without any noticeable stair-stepping. This REALLY surprised me. I had heard that you can't use an Arduino to drive pitch, but with the DAC, that's not a problem at all. So my functional options are expanded beyond the original intent.

Since Crutschow added gain and offset adjustments, I"m going to try to recalibrate the converter circuit with the pots to output 0-10V proportional to the full digital bit count of 4096 for a higher resolution output. Ultimately, though it doesn't matter if it will adjust that much or not, as I have exactly what I was hoping to achieve.

I will followup with a post about the Arduino side of things for any other folks who trip onto this thread and want to introduce an Arduino into their modular synth setup.

Thank you very much to @crutschow and @ebeowulf17!! You guys rock!!
 

Thread Starter

VirtualMo

Joined Mar 13, 2018
11
A reference for the Arduino side of the CRUTSCHOW CONVERTER.
Just a reminder of what this is: an Arduino based CV generator for modular synthesizers that utilize a +/- 12VDC power buss (eg Eurorack)

Start with an Arduino UNO and a 12bit DAC shield (such as the MCP4725 Breakout Board - 12-Bit DAC w/I2C Interface from Adafruit).
If you've never used the MCP4725 or a DAC with your Arduino before, you'll want to follow this tutorial on hooking it up and downloading and installing the necessary DAC library for the Arduino.

Connect the Vout from the the DAC to the INPUT on CRUTSCHOW's CONVERTER (schematic near top of this thread). You can power both the converter circuit and the Arduino from the 12V power and ground rails of your system's power. Unless you've got dozens of modules connected to one power supply, the current draw for these two circuits is inconsequential for just about any modular power capacity – IMO. The Arduino will require only the +12 V and GND, the converter circuit will require both the + and - 12V busses as well as the GND. That means 2 wires for the Arduino power (+12V and GND to the Vin and GND pins on the Arduino respectively), and 3 wires to the converter (+12V and GND and -12V) (Pinout attached) The OUTPUT from the Crutschow Converter will produce a near practically perfect 0-10V.
upload_2018-3-24_22-48-57.png

To test it, you can use the Trianglewave sketch. Within the Arduino IDE environment, find this sketch in the folder created when you download the DAC library. NOTE: Crutschow's converter is designed to amplify a range of 0.55V to 2.75V. Putting the full 0-5V from the DAC might overdrive the output and damage other modules. Probably not, but just be conservative when DIYing your modular system. The range that I find to work with the converter is digital 448 = 0.55V and digital 2280 = 2.75V. This will produce a 0 to +10V CV signal from the Crutschow Converter output. I was really surprise by the resolution of the signal. I could not detect any stair-stepping when applying the CV signal to a VCO pitch input. From subsonic to near ultra sonic, the pitch change was smooth. And the solid stability of the pitch when held at one value indicates a lack of noise. (If I haven't thanked him enough already, I'll do it again: Thank you @CRUTSCOW!)

Once that all works, the possibilities for complex LFOs and/or pitch control is limited only by your imagination and ability to code in the Arduino IDE. If you're fairly new to Arduino, just do a websearch for "Arduino waveform generator" and you'll find lots of code you can experiment with. It also works as a gate - though I haven't measured response time to determine latency that might be found in the execution speed of the code, the microprocessor, and their associated processes. It's doubtful that there's enough latency to be problematic for musical applications.

A logical next step would be to chain a pair of DACs using the I2C buss. To both, add some adjust pots for control over speed, amplitude and offset (these would be added and connected to the Arduino, I'm not referring to the calibation pots R1 and R5 in Crutschow's converter) also add to each a cycle reset (via manual switch or trigger input), and maybe an LED for visual feedback and you could have a really powerful dual programmable CV generator module in a 4HP unit – maybe even 3HP.

Sounds like something I should get crankin' On!
 
Last edited:
Top