I do control PC FAN based on temperature sensor. My routine was to measure temp continuously, once it exceeds threshold, then start the fan, where fan speed depends on temp as well. PC FAN is connected to 12 V power supply via switch. So when temp exceeds set value I send signal to switch to turn it on and then send separate signal through another ESP32 PIN to PC FAN to set PWM value (speed of fan).
I am not sure if switch is necessary here. Is it ok to have PC FAN connected constantly to 12 V power supply and just control PWM value? Setting it to zero would turn off fan, changing it's value to anything between 1 and 1023 would control fans speed.
Is switch needed or not
Re: Is switch needed or not
No, it probably isn't required.
Note that the PWM input on the fan is open collector, and likely has a pull-up inside the fan to 5V or 3.3V. Be aware that the ESP32 pins are not 5V tolerant.
Note that the PWM input on the fan is open collector, and likely has a pull-up inside the fan to 5V or 3.3V. Be aware that the ESP32 pins are not 5V tolerant.
Re: Is switch needed or not
thanks for response, what does that mean "inside pull up to 5v or 3,3V". I understand that if PC fan draws 5V, then it is not good for ESP32 ? I can't find datasheed for my pc fan online. What is worst case scenario, destroying ESP32 ? I have alraedy used this fan via swithch and PWM output from ESP32, tested all speeds from 0 to 1023, didn't have any problems. Does that mean it is safe?
Re: Is switch needed or not
Have played with pc fan quite a bit today, but could not make it stop completely. I have put both frequency and duty to zero , but fan still spins. I have then found in wikipedia following statement about pwm control:
So it does not seem possible to avoid switch in this set up. As I want to be able to stop fans under certain temp conditions.Typically a fan can be driven between about 30% and 100% of the rated fan speed, using a signal with up to 100% duty cycle.