Go Down

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


Four years ago, on 12.06.2006 at 08:43:07 Massimo Banzi :D mentioned:
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!


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:


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?


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?  :-/


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


Thank you VERY MUCH for the courtesy of your reply.  I was wondering if this was just too simple for others to comment  :'(


NP KeithB  :D, what are u building? Me are gonna control the temperature in a box  :P
btw isn't cutoff frequency only for AC?


Feb 17, 2010, 01:37 pm Last Edit: Feb 17, 2010, 01:46 pm by PinkFreud Reason: 1
Sanguino (644P) controlled multi-zone AC lighting for a media room.  Lutron and DMX systems are ridiculously expensive, and I only have three circuits to control.  

I'll be using GRomain's code from this post as a starting point.  He monitors the Arduino's serial port for commands, and adjusts the output voltages appropriately.  Using the Velleman dimmer kit provides a proven/tested dimmer circuit and minimizes worry about mains voltage risks.  It also greatly simplifies using GRomain's code. :D


yo KeithB.
Did u try some electrical engineering yesterday?
I hope I get some time over this weekend to try the RC circuit.


Feb 18, 2010, 12:03 pm Last Edit: Feb 18, 2010, 01:38 pm by PinkFreud Reason: 1
Tuesday evening I built the Sanguino, and I'm waiting for the Sanguino breakout board to arrive.  Then I'll begin bread boarding the RC filter and testing results with the Velleman dimmers and a 60W lamp.

I also began adapting GRomain's code for my purposes.  First, I wrote a conversion for the 0-100% to 0-255 values, then learned the map() function would convert this using only integer math :)  Then I remembered Murphy's Law, that nothing is ever as simple as it first appears.  Due to the non-linear behavior of so many factors (especially the K8064 kit) I'll need to code a lookup table.  It also appears the Velleman kit is more responsive from 1.5 to 10.0 VDC, therefore I should probably add an op-amp circuit between the Sanguino's output and the K8064 input.

I guess it really depends how this works with my individual lighting loads, but reading the Velleman forums for the K8064 kit was not terribly encouraging.  :P


Darnit! so a load under 40W won't work that well  :'(
and we have to putt zero at around 1.7V to not get any dead time.
maybe this dimmer wasn't that good for me as it looked like....
Must start testing this shit really soon...


I'm thinking of using a TLO82 dual-op-amp IC to boost the output voltage signal, but everything I read employs equal/opposite +n and -n DC voltages to supply the op-amp's.  If I use a 12V power supply with +12 VDC and 0 VDC ground to feed the op-amp, that would only result in approximately a 6VDC maximum output, not much of an improvement. :(  Using a 19V laptop supply would get closer to 9VDC maximum, but still not be high enough.

Would some other voltage doubler circuit be more practical for boosting the Arduino's 5 VDC signal output, especially since high current isn't needed?  :question


Feb 27, 2010, 01:27 am Last Edit: Feb 27, 2010, 01:27 am by PinkFreud Reason: 1
Can one of the more senior members and frequent posters with more Arduino experience offer comments and suggestions regarding my project?  I'm attempting to research things myself and document my efforts, but a few simple nudges would do wonders for my confidence here.  I'm not an EE by any means, but have a decent understanding of most things electrical.  I develop software for a living, so the coding effort doesn't concern me terribly.  Burning up the house (or even the Arduino) do concern me greatly.

Comments, suggestions, and constructive criticism will be greatly appreciated.

Thanks in advance.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131