mariuste / Fan_Temp_Control

Temperature Controlled 4-Pin Fan /w Arduino Nano
45 stars 4 forks source link

Off State Not Functioning #1

Open aaronfield33 opened 2 years ago

aaronfield33 commented 2 years ago

I have built this circuit and while testing, I have run into an issue. When my state is supposed to be off, with 0% duty, my fan still functions. It is definitely at its minimum running state, but if it is stopped manually it will spin back up. I do not want to have any additional power draw or unnecessary circulation as this is definitely a time-dependent project (cooling a PS4 in an enclosure). I believe it is a power leak from the PWM to 12V as I can unplug the ground and still have the fan spin at this minimum speed. Any suggestions?

mariuste commented 2 years ago

Interesting; I reviewed the circuit I have drawn and can't see an obvious potential for such a faut.

Let's start with the most simple possibility: how do you ensure that your duty cycle is 0%. Does the fan stop if you unplug the PWM connection. Can you hard code a 0% output duty cycle into the code and test it?

Secondly and a bit more complicated: which fan do you use. Is it possible that it is incompatible (e.g. the minimum RPM is not zero?)

The fact that it still runs if you unplug GND is concerning because this means that the MCU may receive 12V at its PWM pin. To fully understand what is happening I would have to know the internal electronics of your fan. If you have a resistor (maybe 1k) lying around you could place it on the PWM line just to be safe.

aaronfield33 commented 2 years ago

PXL_20220109_065626424 PXL_20220109_065645856 Capture222

The top two pictures are of my wiring. The last is of my Serial Monitor used to observe the 0% duty and OFF state. I tried to code a 0% duty into the code with an "if" statement but nothing changed. I am unsure if the statement worked but I can try some more code changes. I am definitely not an expert though.

The fan used is the following: https://www.amazon.com/dp/B06XP1KVGY?psc=1&ref=ppx_yo2_dt_b_product_details I plan to use two of them in parallel with the circuit to provide extra circulation.

My only thought with the ground triggering it is that the PWM is grounded at 0% duty. I believe this is true based on an article I read before posting here. I'm unsure of fans internal electronics but I would think this would be prevented somehow. Perhaps a diode on the PWM line so current cannot flow to ground through it?

mariuste commented 2 years ago

Just to make sure the the fan is compatible: connect the fan only to 12v and GND (the fan will probably spin). Then connect the PWM pin of the fan to GND an see if the fan spins (no Arduino involved)

aaronfield33 commented 2 years ago

The fan does spin up when connected with 12V in the 12V socket and ground in the ground socket. It is the maximum fan speed.

The fan does spin up when connected with 12V in the 12V socket and ground in the PWM socket. It is the minimum fan speed.

The fan still reacts normally to the arduinos PWM output. Temp sensor gets hot, fan speeds up. The PWM to ground loop is an odd one though. I wouldn't think this is the case with most fans. I have tested one other fan (https://www.amazon.com/Cougar-Vortex-Cooling-CF-V12HB-Black/dp/B008N2ZVOW/ref=sr_1_2?crid=2A41ZE1OR3NZY&keywords=cougar+hdb+fan&qid=1641764327&s=electronics&sprefix=cougar+hdb+fan%2Celectronics%2C101&sr=1-2 and it reacts the exact same. Max speed as expected when hooked up normally. Minimum speed when hooked up with ground through PWM.

As a side note, both of these fans have hydrodynamic bearings, but I doubt that would have anything to do with it.

mariuste commented 2 years ago

Not all fans implement the feature to turn off via PWM. I believe most CPU-fans do but most Case-Fans do not.

I have admittedly only tested the fan control with my Noctua CPU fan which has this feature.

But we can still solve this. If you have one pnp and one npn Transistor you can build a switch whichs turns off the fan completely (high side switch). I can help with the circuit design (2 resistors + 1 NPN + 1 PNP or alternatively 2 resistors + 1 NMOS + 1 PMOS) and arduino software modification if you want

aaronfield33 commented 2 years ago

I do not have those but I think if the feature gets too annoying/consumptive, I will relay the 12V using a separate digital pin. I think I should be able to modify the code to do so with my limited coding knowledge. To be honest, I didn't know there were multiple versions of PWM fans. For now, I will test the existing circuit. I'll hit you up back here if I have any more issues! Thanks for the base code, I would have never figured out the timers!

mariuste commented 2 years ago

I extended the code with a digital pin but haven't tested it. You can give it a try (newest commit)

dnicolalde commented 2 years ago

Do you have the design for the NPN + PNP high side switch. Also any idea what PNP transistor should work? I have some PN2222 NPN transistors. I am using a couple of 12V case fan. When I put the PWM pin to ground my fan still turns slowly but turns.

mariuste commented 2 years ago

Do you have the design for the NPN + PNP high side switch. Also any idea what PNP transistor should work? I have some PN2222 NPN transistors. I am using a couple of 12V case fan. When I put the PWM pin to ground my fan still turns slowly but turns.

On Sunday I will be back from vacation and might find the time to look into designing a circuit. The short version is that most generic pnp transistors will work as long as their rated voltage is higher than 12V and their maximum current is higher than the maximum fan current (I would say at least 150mA rating). Wenn you have a suggestion for a pnp transistor I can calculate the necessary resistors for you.

mariuste commented 2 years ago

Hi @dnicolalde,

I attached an example schematic for a high side switch: High-side-Switch

The two resistor values can be adjusted for different transistor models