Go Down

Topic: PWM to analog... is this just too Rube Goldberg? (Read 1 time) previous topic - next topic

retrolefty


I play guitar so that helps me understand what you are getting at. You've got some sort of voltage-controlled analog effect box circuit that you'd like to put under digital Arduino control by using PWM and an R/C filter to generate the control voltage for the effect. I've thought of that before, and it would seem to be fine in theory (if your circuit is happy with 0-5V for your analog control, and doesn't take too much current); otherwise as mentioned you'll want an op amp to get a different range.


Yes, certainly that is a viable application. And even the 0-5 vdc restriction is easy to overcome with simple op-amp with the gain set to whatever DC voltage range desired after the R/C filtering is done.

Lefty

GoForSmoke

It's a simple oscillator circuit I have to re-dig-up. It used a resistor and capacitor and a pot to control the tone, could have added volume control. I could replace the pot with a transistor couldn't I?  As a valve?

Finished reading the Simple filter piece.

Increase in C lowers both Xc and F,  
Increase in F lowers Xc and RC

And I think that making Xc small compared to R is desired.
So that lets low frequencies pass hence the moniker.

Suppose I want to change the duty cycle of the PWM from 10% to 90% smoothly in 1/100th or 1/1000th of a second? Would this filter have trouble following that? Again: the audio frequency is generated on a different circuit, *not* the PWM frequency being converted to analog DC to control a transistor.

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Krupski


PWM driven led coupled with a 'slow' photocell?



THANK YOU! You made my day!
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

smeezekitty

If you want to use PWM for clean audio, I suggest you reprogram the registers to crank the PWM frequency up. It will make filtering ALOT easier while keeping the audio intact.
Code: [Select]

TCCR1B = TCCR1B & 0b11111000 | 2;[/quote]
Will bring the PWM frequency on pins 9 and 10 to about 3.9KHz.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

GoForSmoke


If you want to use PWM for clean audio, I suggest you reprogram the registers to crank the PWM frequency up. It will make filtering ALOT easier while keeping the audio intact.
Code: [Select]

TCCR1B = TCCR1B & 0b11111000 | 2;[/quote]
Will bring the PWM frequency on pins 9 and 10 to about 3.9KHz.



I have an AC oscillator making the wave. Not using PWM frequency for the wave. Wanting to use PWM to affect the external sound circuit in two ways, maybe find a third.

It's like being able to control the slide of a trombone when something -else- vibrates the air.
I'm trying to control the slide with PWM, not vibrate the air, move the bow not be the string.
And I wonder how fast I'll be able to move the bow smoothly.

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Go Up