Using ESP to drive a computer 4pin fan

Thanks. The base emitter values are strangely low. The collector - emitter values are really too high. Should be some 0.2 volt. That's the reason for the poor fan action.
Can You run Your multimeter in Amp mode? If so, disable the transistor from conducting and let the DVM shorten the fan PWM pin to GND. What current flow does the fan need to run at full speed?

A last question. Can You post a wiring diagram showing the current setup? Something is tricking us.

Maybe you need a 74HCT14? :grinning:

Here is the wiring diagram. I'll take the measures now and will share shortly.

Thanks! Magnifying the diagram to 500% I could read the pin designations.

I don't se anything wrong there in this moment.
As I wrote earlier, investigating what current the fan consumes from the PWM pin should be checked up. Use an ampere meter between the PWM pin and +5.

Check solderings etc.....

Put a simple HIGH signal out of pin 2 to the base.
Put a multimeter on pin 3 of the fan. At the fan.

If you're not getting 5 volts then you need to do something to get 5 volts.

Railroader:
Thanks! Magnifying the diagram to 500% I could read the pin designations.

I don't se anything wrong there in this moment.
As I wrote earlier, investigating what current the fan consumes from the PWM pin should be checked up. Use an ampere meter between the PWM pin and +5.

Check solderings etc.....

I can't get my multimeter to measure. When I short the PWM to GND there is no reading on the device, but I noticed that the fan goes to stop while I keep the leads on the pins.
The only solder I have is on the voltage regulator, and measuring Vin and Vout looks right, so not sure if this is the problem.

dave-in-nj:
Put a simple HIGH signal out of pin 2 to the base.
Put a multimeter on pin 3 of the fan. At the fan.

If you're not getting 5 volts then you need to do something to get 5 volts.

Couldn't understand this "Put a multimeter on pin 3 of the fan. At the fan." Can you please rephrase it

Paul__B:
Maybe you need a 74HCT14? :grinning:

I never used this component and will order one. Can you help me with the connections?

One problem with using a BJT in this manner is that you are saturating it and it takes some time to come out of saturation with each PWM cycle.

If you must use it instead of the proper component as previously explained, put a diode in series with the base connection and another diode between the anode of the first and the transistor collector.

Hi all, just want to give an update as I found out the issue.
The board that I’m using (Wemos D1) has a PWM operating at 1Khz while the Mega/Uno operates at 490Hz. This should impact the range of the duty cycle defined in the code, to a range of 0 to 1023. Once I did this update I managed to control the fan directly from the board, which even the need for the BJT.
Thank you all for your time and support on helping me find the solution. Much appreciated

laoc:
Hi all, just want to give an update as I found out the issue.
The board that I’m using (Wemos D1) has a PWM operating at 1Khz while the Mega/Uno operates at 490Hz. This should impact the range of the duty cycle defined in the code, to a range of 0 to 1023. Once I did this update I managed to control the fan directly from the board, which even the need for the BJT.
Thank you all for your time and support on helping me find the solution. Much appreciated

I don't agree with Your conclusion regarding the frequency. But it looks like the Wemos uses a 10 bit divider/prescaler for PWM and UNO/Mega uses 8 bit. Sending PWM == 255 to the Wemos ought to give 1/4 dutycycle. and of course 1/4 of full output power.