0

I'd like to build a LED lighting for my house. I've made preliminary tests and I've realized that my 12V transformer emits a considerable electric hum at the Arduino's PWM frequency range (PWM signal from Arduino gets amplified by external amplifier powered by the transformer).

I know, that I can reduce the audible noise if I will drive the PWM at higher frequency, beyond the human ear's audible range.

AFAIK Arduino itself is not able to give me 8-bit PWM at the >20kHz range. Do you know any feasible hardware high frequency PWMs that will work with the Arduino?

  • 1
    An "amplifier" for a PWM signal need not be more than an nFET, and the PWM signal should not couple into the power the nFET switches. Ie, there may be some problem with your design other than the PWM frequency. Perhaps ask on electronics SE about the circuit design – James Waldby - jwpat7 Nov 5 '15 at 16:24
  • 1
    "AFAIK Arduino itself is not able to give me 8-bit PWM at the >20kHz range." Yes it is. 16MHz / 256 = 62.5kHz – Ignacio Vazquez-Abrams Nov 5 '15 at 18:36
1

I am not into hardware but the way we handle it was by using a external PWM designed for LEDs and control that, using an Arduino. The LED driver we used was a TLC5940, see TLC5940 16-Channel LED Driver With DOT Correction and Grayscale PWM Control. This one is controllable using the SPI bus.

There are several libaries implementing the protocol, i.e PaulStoffregen/Tlc5940.

See Playground from Arduino - TLC5940 for more information.

  • Actually this is the one, I settled to use. I got one from China for ca. $10. – Adam Ryczkowski Apr 27 '16 at 10:49
2

Just change the timer prescaler to a lower value.

E.g. timer2 (PWM pins 3 and 11) has the prescaler set to clock/64 and runs at around 500Hz. So changing it to clock/8 will result in 4kHz. (Sorry, no clock/16 available).

TCCR2 &= ~_BV(CS22);//clear CS22 bit
TCCR2 |= _BV(CS21);//set CS21 bit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.