3ative / PWM-Fan-controller

An ESPHome Automatic PWM Fan controller with Alarm
MIT License
26 stars 5 forks source link

Turn PWM fan off #2

Closed andrewdaviesj closed 1 year ago

andrewdaviesj commented 1 year ago

Hi, Firstly thank you for the videos and information, it’s exactly what I have been looking for.

I am using a pwm fan that is 200 to 1300rpm and I was hoping with this design it would control the fan using pwm and the turn off the fan using the mosfet. A 3 wire fan turn off and on as it should and the pwm fan scales up and down to 200rpm as it should.

What I have found so far is that when the mosfet turn off the 0v, the fan keeps running at 200rpm with just the pwm line and the 12v line. If I disconnect the pwm line when the mosfet is off the fan stops. So I think the issue is the fan is using the pwm line a a fall over 0v when it’s normal 0v has gone.

Can you think of any nice ways to switch off the fan without the use of a large clunky relay?

Many thanks

Andy

3ative commented 1 year ago

Thank you for the kind feedback. It's always nice to hear.

Of all the fans I tested, only the Noctuas stopped at flat PWM. I added the MOSFET for more 'basic' fans. However, it seems your fan is something different and it's not something I have tested on.

The first thing I would try is a pull-up resistor on the PWM line. There's not much more I can suggest, not having your fan to R&D on.

- Do let me know if you find a solution, I'll add it to the Readme for others to use.

andrewdaviesj commented 1 year ago

Hi, I have managed to solve it, I tried a few ways however the one that worked best for me was to use an opto (CNY17-2). In short I have put it the PWM signal to pin 1 via a 1k resistor and then ground to pin 2. On the other side, pin 5 i pull up to 5v and connect the fan PWM pin, pin 6 then goes to the switched ground on the STP16NF06.so that when the STP16NF06 turns off the ground the fan cant ground through the PWM pin.

Due to the PWM now being pulled high I needed to invert the PWM signal to invert the duty. The motor slowed down when it should of sped up.

output:

Attached is the schematic and a board pic. I haven't used Eagle for a while but it should be followable. I'm also using D7 for the Dallas sensor (not required).

Let me know if you see any issues. PWM Sch PWM Board

3ative commented 1 year ago

That's great news. Nice job on the PCB too. 👍

3ative commented 1 year ago

Link to this added to the main Readme.

czgif commented 6 months ago

Hi Andrew Good job, could you share the board file? I would greatly appreciate it. Thank you in advance.