Go Down

Topic: Humming 12v halogen bulb - PWM dimmer, Solved (Read 13380 times) previous topic - next topic


May 29, 2011, 08:48 am Last Edit: Aug 09, 2011, 05:02 pm by alcs2000 Reason: 1
Hi Guys

I made a simple pwm dimmer on based on the circuit that I posted a while back, reposted at the end of this post.

It works perfectly fine, the only problem is that I can not get rid of the humming. Everything from the connections to the bulp itself is humming, whilst it is ignorable its still annoying. I tried to increase the pwm frequency using the code below, and it does indeed change the pitch of the noise, but I couldn't bring it up enough so I can't hear it anymore. Basically as soon as I set the pwm frequency to 31250 the light does not dimm anymore. According to my calculations both the mosfet as well as the optocoupler should be able to handle it without problems, any idea what might cause the circuit to fail? I was thinking of adding an inductor to the circuit, thus making it a buck converter, but I'd rather stick with pwm if possible. Do you guys have any other suggestions?


Code: [Select]
TCCR1B = TCCR1B & 0b11111000 | 0x03;

 Pins 9 and 10: controlled by timer 1, pwm frequency modification...
  Setting Divisor Frequency
  0x01 1 31250
  0x02 8 3906.25
  0x03   64 488.28125
  0x04   256 122.0703125
  0x05 1024 30.517578125
  TCCR1B = TCCR1B & 0b11111000 | <setting>;


Hi, Do you have an oscilloscope to look at the FET gate waveform?? 

I bet the 10K can't pull the gate up fast enough.  Try 1K, or have the isolator drive another transistor that can pull 220 ohms down.
OR use a "Power FET Driver chip"  .

Let us know what you find...


Any chance you can identify what the frequency of the noise is.?
I'm guessing it will be a sub-harmonic of the operating frequency.

There are some suggestions I would make to the cct you have shown.
1. I found the base floated, and a resistor between the base (pin6) and emitter (pin4) of the optocoupler fixed it.
2. the 1k (R1) series resistor could be dropped to 270 ohm. (5-1.2 =3.8, 3.8/270 = 14.0mA)
This will improve the switch on time for the opto, and should square up the drive to the mosfet.
3. You are not showing any capacitors for the 12v supply. They may be in the supply itself, but may not like the high frequency the pwm is producing.
A good rule of thumb is 1000uF for every amp. Don't forget about the 0.1uF bypassing caps as well.
These should all be electrically as close to the noise source (the lamp) as possible.
4. The datasheet shows IRF10110z internal diode is 1.3v. If you put a diode across the lamp (reverse bias) this would ensure any back emf is removed.

If you have access to an oscilloscope (as suggested by Terry), you could check to see what the waveform across the fet is....it should be square with no rounding or overshooting. It might also show ripple on the supply.

Lamps also are not a resistor, the resistance changes with temperature, and hence require large amounts of current when power is first applied.



May 29, 2011, 10:04 am Last Edit: May 30, 2011, 03:52 pm by alcs2000 Reason: 1
Thanks guys, 1 second after posting I had a feeling that it was R2 and it was, thanks TK. Lowering it to 1.8k allowed me to put up the frequency to 30khz and it runs fine now. I tried 1k but the mosfet was in between on and off. The noise is gone now!

Thanks Mark for all your suggestions, I lowerd R1 and added the resistor to the base and emmitter of the optocoupler. It definitely further improved the dimmer, at least what I can tell by my subjective perception, sadly I don't have an oscilloscope, would love to see what's happening. I am however about to order the dso quad, seems to be good enough for the things i need it for and not too expensive!


EDIT: Corrected mhz to khz


May 29, 2011, 01:58 pm Last Edit: May 29, 2011, 03:55 pm by alcs2000 Reason: 1
Looking at it more precisely I realize the circuit is not running smooth yet. Doing this over my thumb, whilst the lamp dims, form 0 to 50% pwm it is off, from 50%to90%pwm it goes from 0% brightness to 50% brightness and then with pwm set to a 100% it jumps to a 100% too. So it's definitely not working well yet.

I changed the resistor R2 to 1.8k so far and R1 to 360ohm. I will try to add a transistor with 220 ohms for the gate.

The mosfet gets warm which it did not when switching at lower frequencies.

I am thinking of buying a TC4429 to drive the mosfet. It will also invert the optocoupler's signal again which makes the circuit much nicer. What do you guys think?


EDIT: The transistor didn't work either, well it somewhat worked but worse.
EDIT2: Added a 1000uf cap for the power supply, same problem


I am not sure that a 20W Halogen will respond to such a high frequency because of the thermal time constant involved. You do need a scope to find out what is happening.

Why does my circuit hum?
All together now:-
Because it doesn't know the words.

I think you might have gathered that it is the filament in the Halogen



Yeh I was thinking it could be the filament, however even the connections on the breadboard are humming, if however barely audible.

I will order a TC4429 and see how that goes. The oscillator still has to wait for a while, waiting until the dso quad becomes readily available...



Glad to see you have progress.

The fact the mosfet is getting warm is a sign that its not switching cleanly (either on or off).
You could check by seeing if it gets warm with just an ON only.

I did a similar thing way back with a single 2n3055 and a 555 IC.
I found that putting a capacitor across the series resistor to the base, squared up the drive very nicely.
It dimmed a 12v 25w normal sized lamp with no heatsink or heat at all. (Can't remember all the cct)

(mine didn't hum so it must have known the words)...very good mike

The fact that 0-50 is still off, just shows how non linear lamps are. It only requires a small drop in voltage to produce a large drop in light output.
If your supply is variable, you may be able to plot/check this, and then apply it to the pwm average.



May 30, 2011, 11:03 am Last Edit: May 30, 2011, 12:05 pm by alcs2000 Reason: 1
Yep, the mosfet is definately not switching properly. Having looked at it again I actually only get 3 states at this frequency: off, on and 30% which is when the mosfet heats up and i guess its neither on or off.

The cap didn't make a difference. It just seems that the mosfet's gate is not charged/discharged quickly enough. The mosfet driver will tell. At least the humming is gone =).



Correct if I'm wrong here...but
If the cct is operating at 31khz (the Mhz is not right), then we are talking about 32nS cycle.

The specs on the IRF1010z say its for Automotive use, (not switch mode power supply), and the rise time is 150nS.

Could Adrian's problem be its being driven too fast.??
(The opto on time is only 7.5-10uS)

By comparison looking at an IRF520 (10A) the turn on is only 4nS, which significantly less capacitance.

You could try finding a fet that is designed for switch mode supplies, and if you only want to dim a 20w lamp, something closer to 3 Amps.



Correct if I'm wrong here...but
If the cct is operating at 31khz (the Mhz is not right), then we are talking about 32nS cycle.

One correction coming right up.
1/31000 = 32 microseconds.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


Thanks, sorry that was a typo. As stated in my first post the pwm is 31250Hz. Roughly 60khz is the maximum possible with the arduino if I remember correctly, but I like my timers to work properly.

The mosfet should be way fast enough.



We've been working with native frequency PWM from Arduino and pumps, and have found that the ~500hz noise varies greatly according to the particular DC pump, and is hardly audible in certain pumps; so perhaps the mechanics of your system are important. 

Try a different bulb/socket maybe?


Thanks, I agree it could potentially ease with a different light bulb. To be honest most people haven't noticed the humming until I tell them. It seems that I feel like its much more penetrating than they do. I haven't tried a different one as of yet.

I just received a 12v led dimmer, it makes the same noise the arduino does when running it at 3906Hz which is actually even more annoying than the arduino native pwm noise. Whilst another bulb might be able to make the noise close to inaudible, I doubt it would go away fully. However a frequency of 31khz would do it for sure in my opinion as I doubt I can hear beyond 20khz.

Mark, I could potentially identify the frequency which does however change on different brightness levels. What use would it be if we knew the frequency of the sound emitted?



Oh dear...sorry the maths definately wasn't right.
150nS rise time isn't likely to have a great deal of impact.

The frequency you hear, is unlikely to be at the pwm frequency (31khz is too high).
So can a mechanical (lamp) produce energy at a frequency lower than its being driven at.?
Or is the noise caused by the 'unwanted' bits the waveform. (ringing possibly)

Unfortunately without the scope its not possible to see if you have a single waveform, and not something else.

I don't suppose you have tried a resistor instead of the lamp.??
One that aproximates the load should help identify if it is the lamp.

Maybe I'm not right here (we know my maths wasn't...and I'm blaming the late nigths.)

Go Up