Pages: [1] 2   Go Down
Author Topic: Humming 12v halogen bulb - PWM dimmer, Solved  (Read 5420 times)
0 Members and 1 Guest are viewing this topic.
Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Cheers,
Adrian

 
Code:
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>;




« Last Edit: August 09, 2011, 10:02:51 am by alcs2000 » Logged

www.alcs.ch - will put some arduino projects online soon!

Red Sea, Saudi Arabia
Offline Offline
God Member
*****
Karma: 12
Posts: 579
..On The Red Sea
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com

Swannanoa, New Zealand
Offline Offline
Full Member
***
Karma: 1
Posts: 202
New To Arduino (and C)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Mark
Logged

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Cheers,
Adrian

EDIT: Corrected mhz to khz
« Last Edit: May 30, 2011, 08:52:20 am by alcs2000 » Logged

www.alcs.ch - will put some arduino projects online soon!

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 29, 2011, 08:55:38 am by alcs2000 » Logged

www.alcs.ch - will put some arduino projects online soon!

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33419
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

=)

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
Logged

www.alcs.ch - will put some arduino projects online soon!

Swannanoa, New Zealand
Offline Offline
Full Member
***
Karma: 1
Posts: 202
New To Arduino (and C)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 30, 2011, 05:05:04 am by alcs2000 » Logged

www.alcs.ch - will put some arduino projects online soon!

Swannanoa, New Zealand
Offline Offline
Full Member
***
Karma: 1
Posts: 202
New To Arduino (and C)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 291
Posts: 25874
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

www.alcs.ch - will put some arduino projects online soon!

Carbondale Illinois
Offline Offline
Full Member
***
Karma: 1
Posts: 104
Making digital rivers.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Sydney
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

www.alcs.ch - will put some arduino projects online soon!

Swannanoa, New Zealand
Offline Offline
Full Member
***
Karma: 1
Posts: 202
New To Arduino (and C)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2   Go Up
Jump to: