Pages: 1 [2]   Go Down
Author Topic: PWM to analog... is this just too Rube Goldberg?  (Read 1206 times)
0 Members and 1 Guest are viewing this topic.
Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4837
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 819
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

PWM driven led coupled with a 'slow' photocell?


THANK YOU! You made my day!
Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Washington
Offline Offline
God Member
*****
Karma: 39
Posts: 808
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
TCCR1B = TCCR1B & 0b11111000 | 2;[/quote]
Will bring the PWM frequency on pins 9 and 10 to about 3.9KHz.
Logged

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!

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4837
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.

Logged

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

Pages: 1 [2]   Go Up
Jump to: