Can the SparkFun Logic Level Converter Single Supply be used to control RPM on a 12v 4-wire PWM fan?

I need to know if the SparkFun Logic Level Converter - Single Supply (PRT-14765) can be used to directly control the speed of a PWM computer fan.

I have a 12V 4-wire PWM computer fan. (4 wires = 12V+, 12V-, 5V PWM signal IN, 5V RPM pulse signal OUT)

I want to control the speed of the fan via it’s 5V PWM signal input line.

I am powering the fan with a 12V power supply that is separate and isolated from my Raspberry Pi.

I would like to use the R-Pis HARDWARE PWM pin (not software PWM) to send PWM signals directly to the fan through the SparkFun Logic Level Converter - Single Supply since the Pi only outputs 3.3V, and the fan needs a 5V PWM input signal.

Is this possible to do ONLY using the SparkFun Logic Level Converter - Single Supply and NO OTHER extra circuit components?

If so, do I need to connect a ground on the fan side or can I just use the single PWM input wire connected to the output side of the SparkFun Logic Level Converter - Single Supply?

If I need to connect a ground from on the 5V side of the SparkFun Logic Level Converter - Single Supply, where would I ground it to?

I wouldn’t want to ground it to the 12V ground of the fan’s power supply would I? Would I need to put resistors across the ground connection to the 5V ground of the SparkFun Logic Level Converter - Single Supply to make sure I’m not frying something?

I could really use some advise on how to set this up… I thought this would be simple but it’s turning into a nightmare just to control the speed of a fan that is already designed to be controlled by PWM signal input :frowning:

Thank you.

The logic level converter itself can’t generate any signals on it’s own, your Pi would need to do that for you.

As far as sending a PWM signal from the Pi to the fan, the fan would probably be OK with a 3.3 volt signal rather than a 5 volt one but if you’re going to use the tach signal coming back from the fan and it’s at 5 volts, you’re definitely going to need to level shift that down to 3.3 volts since 5 volts will damage the Pi.

The fans ground wire is common to the fans 12 volt power and the 5/3.3 volt signaling so just connect all your grounds together. I’ve never tried driving a fan like this, but with a logic level converter between the Pi and fan, you should be good as long as you generate PWM at a frequency the fan is happy with. Shouldn’t need any resistors or anything as far as I can tell.

Awesome! That’s the answer I was hoping for. :slight_smile:

As I understand it, most computer PWM fans use a “standard” frequency range between 21-28 kHz to control speed on their PWM input line.

I just wanted to make sure the Single Side Logic Level Converter could handle those switching frequencies without corrupting the signal on the output (5V )side.

I also wanted to make sure that the fan was getting the 5V PWM signal that it’s specs call for.

Although my fan specs do say that PWM signal is pulled up to 5V internally inside the fan’s own on-board circuitry… so does that mean it has it’s own logic level converter built in and the R-Pi’s 3.3V signal will be fine by itself?

I do also plan on using the RPM return signal from the fan to monitor the fan’s actual speed… so I know I will need the logic converter for that, so i figured i’d run the PWM signal through it as well just to be sure I didn’t damage my new Pi 4 :stuck_out_tongue:

As I understand it, most computer PWM fans use a “standard” frequency range between 21-28 kHz to control speed on their PWM input line.I just wanted to make sure the Single Side Logic Level Converter could handle those switching frequencies without corrupting the signal on the output (5V )side.

I can’t give you a definite answer but I think it will work OK for you. You’re going to need to test it to find out for sure. (we’ve not tested these with a fan before.)

Although my fan specs do say that PWM signal is pulled up to 5V internally inside the fan’s own on-board circuitry… so does that mean it has it’s own logic level converter built in and the R-Pi’s 3.3V signal will be fine by itself?

That just means that that there’s a pull up resistor somewhere in the fan that makes the PWM signal idle high at 5 volts. There must be a 5 volt power supply somewhere in the fan, probably to operate the PWM and tach circuitry internally and there would be no logic level conversion. (The fan motor probably operates at 12 volts and the control circuitry inside the fan runs at 5 volts.) You will need to level shift that from 5 volts down to 3.3 to keep from damaging your Pi.

I do also plan on using the RPM return signal from the fan to monitor the fan’s actual speed… so I know I will need the logic converter for that, so i figured i’d run the PWM signal through it as well just to be sure I didn’t damage my new Pi 4

I don’t know the spec that well for this type of fan but the little bit of reading I did leads me to believe some fans might output a 12 volt signal for RPM. (tach) Double check your fan, if it’s not outputting 5 volts, you will need to drop from 12 to 5 before sending it through the logic level converter to avoid possibly damaging the logic level converter.