Is switch needed or not

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Is switch needed or not

Post by ajocius » Sat Jan 18, 2020 9:47 am

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.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Is switch needed or not

Post by jimmo » Sat Jan 18, 2020 10:07 am

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.

ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Re: Is switch needed or not

Post by ajocius » Sat Jan 18, 2020 1:31 pm

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?

ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Re: Is switch needed or not

Post by ajocius » Sat Jan 18, 2020 10:29 pm

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

Post Reply