Humming 12v halogen bulb - PWM dimmer, Solved

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?

Cheers,
Adrian

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

Cheers
Adrain

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

Mark

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

Cheers,
Adrian

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

mark

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.

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.

Cheers,
Adrian

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?

Cheers
Adrian

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

Adrian
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.)
Mark

So can a mechanical (lamp) produce energy at a frequency lower than its being driven at.?

Yes it could. It could be vibrating at it's natural mechanical resonant frequency. The fact that the excitation frequency is higher would not stop it. This is known as sub harmonic resonance. and it happens with planetary / moon orbits in some cases.

Aha, thats interesting. Alright I will find out the frequency the lamp is making. My feeling tells me it's actually the frequency it is driven at. As I mentioned I can't hear it at 31khz, but that might also be because the mosfet is not switching at all atm. Will report back.

Alright, for those interested, I made three recordings with an Edirol R-09.

The results:

Arduino running at standard pwm frequency:

15/255pwm
35/255pwm
47/255pwm

As for the frequency, well it's not that simple, analyzing it it with the Audition Frequency Analyzer visualizes much better what I hear:

15/255pwm:

35/255pwm:

47/255pwm:

I ultimately perceive a pitch of about 3200Hz which seems to increase with increasing the pwm speed as well become more quiet which can also be seen on the screenshots.

Running the pwm frequency at 3900Hz gives me a perceived pitch of about 8000Hz. This is the reason why I'm quite certain that If I manage to switch the mosfet at 31khz it will become inaudible. I ordered the driver and it will hopefully be here in a week.

The cheap dimmer I bought results in the same pitched noise the arduino makes when running it with a pwm frequency of 3900. Looking at the design it also does not incorporate a driver but a resistor just like mine. I guess it's the limitations of the design that do not allow for faster switching. Trying to minimize costs they also decided to leave out the driver and stuck with the maximum pwm frequency they where able to drive the mosfet using this circuit.

Just using a resistor such as some hookup wire of course does not make any noise. The noise mainly comes from the and is certainly because of the lamp. It can also be heard from wires when held together by hand.

Cheers,
Adrian

Mike
Thanks for the lesson.
I realised afterwards that a true square wave contains all the odd frequencies, and hence it could easily be related to that.

Adrian
Nice piece of recording gear. In this case proving very useful.
Interesting that there is nothing below about 3kHz.

You test with the resistor shows it is definately from the lamp.
I can only imagine that will either get louder or quieter when its mounted....

Mark

Just thought I should check how it looks at 3000Hz PWM frequency.

Looks less noisy, but louder and higher pitched:

64/255pwm at 3900Hz (recorded to wav instead of mp3 thus the increased range on the high end)

Interestingly enough the lamp would no longer light up at 16/255pwm which it did at the lower pwm frequency.

Looking at the Spectrum analyzer shows the annoyance quite beautifully:

64/255pwm at 3900Hz
![](http://www.alcs.ch/webdata/arduino/Adobe Audition64spec.jpg)

The audible noises are clearly 7800Hz and 11700Hz! They are all multiples of the pwm frequency! Beautiful.

Any theories why exactly this is the case?

I have great hopes for 31khz now!

35/255pwm at 488Hz for comparison
![](http://www.alcs.ch/webdata/arduino/Adobe Audition35pwms1.jpg)

And now of course I realize that what I see here is that its all multiples of 488Hz...

It seems like the pitch did not change at all with the increased pwm frequency but it got louder, so my hope to shift the noise into the ultrasound spectrum is diminishing. It kind of concentrated the noise frequencies resulting in a higher amplitude. However, because the noises are all multiples of the pwm frequency I am hoping that the lowest will be 31khz with the mosfet driver. We shall see when what happens when I get it. Will also play around with some ceramic caps when I get some time.

Cheers,
Adrian

Hey Guys

The mosfet driver arrived and I had finally time to try it out. It works exactly as predicted. The Mosfet driver can charge and ground the mosfet much quicker, 31khz is not a problem. As predicted, the first frequency emitted by the bulb is 31khz, the less loud 62khz and I guess further multiples of 31khz that I can not detect anymore. I can no longer hear the humming anymore of course, so that's fantastic!

Cheers,
Adrian

1 Like

Switching 2A on and off will make two wires move, certainly will move filament in Earth magnetic field. When you PWM it's down, spices of current become higher, as resistance of bulb goes down, with cold state (PWM < 5%) I'd expect current up to 12-14 A.
I wonder how much RF interference this circuitry generate, is your radio still working? :~
BTW, where 12V coming from, can you just use "dimmable" driver for your halogen and regulated voltage produce by driver?

edited: There is more to use "dimmable" driver, the wiring to bulb how long is it?
It would explain, why brightness jump between 50% and 100%. With PWM 100% you have a DC, and no voltage losses on wire inductivity. And it's also good indicator for EMI, whatever break you have in linearity (50% or so) all this energy is radiating in RF or dissipating in a heat.

Actually, the dimmer works perfectly now, it doesn't jump anymore from on to a semi on to off. No heat is generated anywhere and the 31khz ultrasound emitted is also of very low amplitude, and of course not audible.

The reason why it didn't work was that at a higher frequency the circuit could not charge / discharge the gate of the mosfet fast enough which left it in a semi on state (and of course getting really hot). PWM less than 5% doesnt really work for halogens, I think they only start to give a shimmer of light at about 20% if i remember correctly.

12V is comming from a standard 12v laptop power supply, rated 3A.

Cheers,
Adrian

Interesting analysis all, thanks for sharing.