Go Down

Topic: Arduino - to - Velleman K8064 DC-Controlled Dimmer (Read 3 times) previous topic - next topic

KeithB

Four years ago, on 12.06.2006 at 08:43:07 Massimo Banzi :D mentioned:
Quote
this is a voltage controlled dimmer. it can be tuned to work from the 0 to 5 v output of the arduino board. remember to place a big capacitor at the arduino output pin because the dimmer doesn't like the fast PWM pulses.

Can someone (please?) direct me towards a circuit diagram of the components I should place between the Arduino's analog 5V output and the K8064's 5V input to properly smooth the PWM signal?  I presume it's a simple RC network, but don't understand exactly how it should be connected or what value components should be used.

Many thanks!

KeithB

Okay, one day (and 20 pages of forum posts) later I stumbled upon this thread and post including several proposed schematics, one seems appropriate for my purpose:





KeithB

I'm trying to identify the default PWM frequency of the Arduino, to select proper value components for the RC low-pass filter. The two important factors for my use are:
  • retain the majority of the 0-5VDC range
  • filter the majority of PWM noise

What value components would you suggest as a starting point?

KeithB

Well, at least I can document this ;) for anyone else considering a similar effort.  Reading Ken Shirriff's blog post regarding Arduino PWM, the Arduino's default pre-scaler value of 64 and default clock speed of 16 MHz yield a PWM frequency of:
16 MHz / 64 / 256 = 976.5625 Hz

Desiring a cutoff frequency for the RC filter lower than 976 Hz, I chose an arbitrary 47 uF capacitor and 35 ohm resistor to yield a corner frequency of 97 Hz.

Does this make sense, or is that placing the cutoff frequency too low?  :-/

SteNull

Im just about to do the same thing. in some simulations i made i got best results with 35ohm and 100uF, there i get a almost smooth line 2.396V at 50%pwm, at 100% i get 4.967V and around 20ms for the capacitor to get fully loaded.
I have to say that i didn't put the pwm in the simulator at ideal arduino conditions and probably missed out some important stuff to... ::)

Go Up