Monday, December 29, 2008

First revision: Arduino Control Voltage

The recent holiday brought into my possession a shiny new Arduino Duemilanove board, my first real project with it? Control Voltage output to control my self titled Uranus synthesizer (based on the Voice of Saturn synth). In any case, after a couple long nights I cam up with the sketch bellow, I've tested it and it seems to work with a little adjustment from the pot on the output.

I have yet to attempt at getting the thing tuned, but by runing the PWM output of the Fading sketch (a steady ramp up and down from 1 to 255) i was able to verify that it does indeed control my rather excentric synth. Thoughts, suggestions and critics welcome.

NOTE: The capacitor in the lowpass filter at the bottom is 470 uF, apologies for not adding the value.


Creative Commons License
Arduino Control Voltage by Dana Simmons is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Based on a work at code.google.com.

4 comments:

Anonymous said...

Hi,
Can you explain in detail why the circutry is needed? Doesn't the Arduino PWM output just provide Signals from 0 to 5v?

dcsimon said...

The arduino does indeed output a PWM signal from 0-5v. however, PWM stands for Pulse Width Modulation, this means that the actually output is a simple square wave (the actually frequency is documented in the arduino website) with 0V on the bottom and +5V on the top. This wave is useful because by modulating the "pulse width" or the time spent at +5 (or the duty cycle). The low pass filter (470uF cap and 100 Ohm resister) filters out the alternating square wave, and outputs a steady, constant voltage when input to a higher impedance.The other stuff (transistor and pots) are for additional adjustment and amplification of the voltage to a higher scale (0-12v for example).

Ivo Francx said...

Thank you for your explanation. I did a little bit of research myself and I think I understand it now.
If I need to output a Maximum of +5V (e.g. for a Doepfer Eurorack Module), do I only need the RC filter circutry?
And is there any kind of side effect? I read something about the RC filter creating an unwanted portamento...

dcsimon said...

You are absolutely right, if the maximum voltage you want is just 5v then all you need is the RC filter. Due to the nature of RC combos there is a time delay between a change in PWM value and the output of the RC filter. This delay will appear as a portamento if used as a CV signal because the voltage ramps up to the new voltage. This ramp is the effect of the capacitor charging and can be measured by calculating the RC constant for the filter.