PWM mosfet and peltier... Noisy switch

Hi everyone, I am working on a solution to regulate the cooling power of a peltier. I am using PWM to control mosfet IRF540 through 2n2222 as shown in the figure below. The peltier is Tec1-12706. The problem is that my switching power supply makes a funny high pitched noise everytime the peltier is connected... When I replace the peltier for a led plus resistor, the noise is no longer there. Another test I did is disconecting the PWM, in that case the peltier remains fully on nd the font does not make any noise.
I also try adding a 0.1uf cap to make an RC filter on the PWM going to 2n2222 and the noise remains.
Does anybody knows how to solve this? The font is 12V 20 ampere.
Thanks

(mod edit)
oxZ8JDs.png

oxZ8JDs.png

Pretty sure the peltier is drawing more current through the mosfet than the mosfet is designed for.
You may need to find an alternative mosfet ( logic level type) and maybe even heat sink it too.

A single or even a few leds would not draw much current.

Your PSU @ 12 V x 20 A is probably not the issue as you noticed by your test.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

NicoH007:
Hi everyone, I am working on a solution to regulate the cooling power of a peltier. I am using PWM to control mosfet IRF540 through 2n2222 as shown in the figure below. The peltier is Tec1-12706.

That's a 92W 12V peltier, so 8A or so, the MOSFET has 77 milliohms on-resistance so will need a reasonably
large heatsink as it will dissipate upto 5W, ignoring switching losses. Change that 10k to 1k or even less
so switching losses aren't huge (10k will be very slow).

The problem is that my switching power supply makes a funny high pitched noise everytime the peltier is connected...

Yes, its a switching supply, it switches... That makes noise under load, especially if the load is varying with PWM.

When I replace the peltier for a led plus resistor, the noise is no longer there.

No significant load, no work for the supply...

Another test I did is disconecting the PWM, in that case the peltier remains fully on nd the font does not make any noise.
I also try adding a 0.1uf cap to make an RC filter on the PWM going to 2n2222 and the noise remains.
Does anybody knows how to solve this? The font is 12V 20 ampere.
Thanks

(mod edit)
oxZ8JDs.png

I'm not sure about PWM with Peltiers, I'm not sure they like it, or its efficient compared to analog voltage.
An adjustable output SMPS is perhaps a better approach - not sure about this though.

Why not try "slow" PWM, like every 15 seconds or so. There is a lot of thermal mass, switching at 488 or 960 Hz will make no difference in the long run. Turn on the MOSFET hard, leave it on for a while. Turn it off, leave it off.

I'd also look at a MOSFET with lower on resistance, like AOD508
0.0045 ohm with 5V Vgs, so P=I^2 * R = just 0.288W to dissipate for the device.

PWM and ON/OFF control of Peltier devices both work, and are easy for hobbyists to implement, but have significant drawbacks and are generally disfavored by manufacturers and professional engineers.

Smooth, voltage controlled DC power is preferred and is much more efficient that the other two options. Peltier elements have a longer lifetime if not subjected to rapidly changing thermal stresses.

A summary, from a professional engineering group, of the advantages and disadvantages of various power control strategies for Peltier elements can be found here: Peltier Element Efficiency.

CrossRoads:
Why not try "slow" PWM, like every 15 seconds or so. There is a lot of thermal mass, switching at 488 or 960 Hz will make no difference in the long run. Turn on the MOSFET hard, leave it on for a while. Turn it off, leave it off.

The problem with that is that when a peltier element isn't powered it conducts heat efficiently, draining
back the heat you were just pumping across it...