Noctua 4-pin PWM fan speed control

Basic Information:

Printer Model: Ender 3v2
MCU / Printerboard: SKR Mini E3 v3.0
Host / SBC Raspberry Pi 3B+
klippy.zip (1.3 MB)

Description of the issue:

I just set up my new Motherboard as a replacement of the Stock Creality 4.2.2 board. So far everything works fine besides the PWM fans. I have 12V Noctua fans with 4 control pins so apparently they can’t be PWM controlled through only the fan pins on the motherboard but instead need a dedicated 5V PWM signal on a different pin.
When trying to bypass this and just PWM-controlling it through 12V and GND the fan made weird noises and wouldn’t move.
For clarification: I run the 24V fan pin output through a buck converter to the fan but connect the GND of the fan directly to the pin on the board.

I also tried using the technique in this post but that didn’t seem to work either. Maybe it’s because this is a different motherboard?

Any help is greatly appreciated!

This is the Noctua Fan pinout:

noctua_pin_configuration_12v_fans

The additional pin (green) gives the actual speed back to MCU.

Hey @EddyMI3D thanks for the answer, but this is not my problem. The issue is that I can’t change the actual speed of the fan because I don’t know how to wire it and setup the software.
Also when just redirecten the RPM pin back to the MCU I am risking killing the microcontroller since it will short with 12V through a pin that might only be capable of 3.3V

True, you would damage at least your IO pin, even kill your MCU.

I would choose this way How to read RPM from 3-wire fan - PIC18F4550 - Electrical Engineering Stack Exchange with the diode and the pull-up. You don’t have to care about the supply voltage of your fan.

Second choice. A voltage divider. Dimensioning depends on the supply voltage of your fan.

Good luck, hcet14

Yeah that looks like a good solution for MCU safety!
I have never worked with diodes so I am a bit clueless what kind I need, maybe you could give me a hint?

But the main problem is not the RPM monitoring but that I can’t even change the RPM because i don’t have a 5V PWM signal that goes into the corresponding pin on my fan. I really don’t knwo how to set this up nad its annyoing me. I can’t work with different fan speeds for example which can be a major drawback in print quality :frowning:

Well, as indicated by @EddyMI3D, you will need:

  • 12V for the fan
  • 5V for the PWM signal

So the topic is:

  • On the more simple boards the fan connector typically have VCC of the main PSU, i.e. usually 24V → Connecting the PWM there will kill your fan
  • These boards do not have a jumper setting to control the voltage
  • Any other pin typically has only 3.3V, which likely is too low to drive the PWM reliably

What you can do - Option 1:

  • Connect VCC (Yellow wire according to @EddyMI3D schematic) to any 12V source (e.g. a DCDC converter that is connected to your main PSU)
  • Connect the PWM signal (blue wire) to the GND pin of a fan connector
  • Invert the fan pin in Klipper’s setting with a !

Option 2:

  • Connect VCC (Yellow wire according to @EddyMI3D schematic) to any 12V source (e.g. a DCDC converter that is connected to your main PSU)
  • Connect an external MOSFET, e.g. Amazon. Its input goes to the fan connector or any other free pin
  • Its output gets 5V and is connected to the Ncotua’s PWM

The 1N4148 is “the diode”, I guess the only one with a wiki entry 1N4148 signal diode - Wikipedia You may take every diode that starts with 1N4…

The THT types are easy to find on every cheap PCB. It has a glass package (see wiki).

I guess you have little electronics experience. No problem. I would try it like this

Noctua says in the spec 5V, but I’m quite positive it will work with a 3.3V PWM signal (just a positive guess). If it doesn’t work, you will not destroy your MCU or anything else.

Else…

…or any transistor.

Edit: Changed pic according to @EddyMI3D

When I read the Noctua PWM White Paper it says in there:

WARNING: Connecting 12V or 24V supply voltage to the PWM pin (pin 4) will instantly damage the fan.

Wouldn’t your setup lead to the 12V running through the PWM pin and therefore damaging the fan?

This I didn’t quite understand unfortunately. What do you mean by “fan connector or any other free pin”.

Also how does the MOSFET do something that my board can’t do? Shouldn’t I be able to PWM control my fans directly from the board or is the problem that’s causing trouble here that these are 4-pin fans? If that was the case I might just look to buy some 3-pin fans and save me all that jazz.

Do I just use any of the I/O pins on this board for the PWM signal e.g. PD0? (in the upper right corner)

Maybe some general understanding of fans:

2-wire fans (usually used in 3D printing)

  • Pins
    • Power (VCC)
    • GND
  • PWM
    • Typically, the GND pin is toggled (connected / disconnected) via a MOSFET, while VCC remains stable
    • Speed change is achieved by quick on-off pulses to adjust the level of power applied to the entire fan (including the internal fan electronic)
    • Can lead to higher motor noises
    • Low PWM frequencies
    • Often require around 15% to 20% minimum-PWM before they start spinning
  • Tach signal
    • not available

3-wire fans

  • Pins
    • Power (VCC)
    • GND
    • Tach
  • PWM
    • Typically, the GND pin is toggled (connected / disconnected) via a MOSFET, while VCC remains stable
    • Speed change is achieved by quick on-off pulses to adjust the level of power applied to the entire fan (including the internal fan electronic)
    • Can lead to higher motor noises
    • Low PWM frequencies
    • Often require around 15% to 20% minimum-PWM before they start spinning
  • Tach signal
    • Limited. The fan will only deliver a Tach signal when turned on, i.e. must stay on long enough to be able to deliver a full Tach cycle or otherwise may report wrong readings

4-wire fans

  • Pins
    • Power (VCC)
    • GND
    • Tach
    • PWM
  • PWM
    • A dedicated PWM pin is taking the PWM signal and does not switch on/off the entire fan but only the power to the motor coils
    • Speed change is achieved by quick on-off pulses to adjust the level of power applied to the motor
    • Often PWM frequencies >20 kHz are used to move the switching noise out of the audible range
    • The PWM logic typically uses 5V power supply and has internal pull-ups to this 5V (this is why they can be used via the GND pin)
    • Can start spinning as low as 10% duty cycle
  • Tach signal
    • Full, as the fan’s electronics is constantly powered

No, as long as you do not connect VCC to the PWM pin

  • The dedicated Fan connectors on the printer board have a MOSFET, in order to be able to deliver the needed power to 2-wire and 3-wire fans
  • Any normal pin can be used as PWM source as well (software PWM) but the pin alone is not able to drive a fan and would be damaged if you connect a fan directly

With the external MOSFET you can use 5V power supply to the PWM circuit of the fan, regardless of the supply voltage the used pin on the board would have otherwise:

  • “Normal” pins on such boards mostly have 3.3V
  • Fan pins on the better boards have selectable voltages, otherwise the same voltage as your main PSU

Correct

Yes BIGTREETECH-SKR-mini-E3/hardware/BTT SKR MINI E3 V3.0/Hardware/BTT E3 SKR MINI V3.0_SCH.pdf at master · bigtreetech/BIGTREETECH-SKR-mini-E3 · GitHub
Your STM32G0B1RCT6 uses 3,3V supply voltage → they work with 3,3V

I think this proofs it https://noctua.at/pub/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf
Have a look at
External pull-up is not necessary as the signal is pulled up to 3,3V/5V inside the fan.
I don’t see any imperfections with my above proposed solution. A diode and a pull-up resistor are way cheaper than a new fan + you already have the DC/DC down converter.

Oh wow thank you guys for these comprehensive answers, really appreciated!

You are absolutely right, I will try this as soon as the parts are delivered :wink:
Will keep you updated about the progress!

1 Like

Okay so today I tried this setup and it broke my motherboard…

I connected the power supply cables to the pins on the board. Then i connected the tach pin with the diode and the resistor in parallel (is it called that way) to the tach pin on the board.
Finally i conected the PWM input from the fan to my board and created a short that killed the MCU.
The only thing I could think of that was the problem is that the 3.3V through the pullup resistor weren’t turned on yet but I thought that shouldn’t be a problem when the fan isn’t turned on either.

The moment I connected the PWM pin the DC-DC converter status LED was turned on so I immediately disconneted the pin again but it was obviously too late. The microcontroller was turning really hot and Klipper told me that it had lost connection to the MCU.

I think I can send the board back and get a refund since it has only been a week since I ordered it. But I’d really like to understand what I did wrong here…?

Could you draw a picture of how you tried to wire the fan? Pictures of the actual wiring would be helpful.

What are you going to try and return, the fan or the “motherboard”? I don’t think you can do either as it’s really your fault that you killed them.

Sh*t! But you are alive.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

You never answered that question.

Please ask, what to do concerning electronics if you’re unsure! A mistake could kill you!!!
Especially with something like this!!! Working with Line Voltage (110 V / 230 V / >50 V)

Never touch stuff above AC 50V or DC 120V, if you have not the proper training!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I fear, you did this


Before connecting the “Tacho” signal to your MCU you should have measured the voltage with a multimeter. I expect, you would have measuered something below 5V, but above 3,3V or something below 12V, but above 5V (depends to your fan). Anyway, whatever you would have measured, this will kill your MCU, if connected like above.

I’ll keep my fingers crossed!

hcet14

I really apprechiate your concerns but I don’t think it was that dangerous since everything running here has a mximum of 24V DC coming from the PSU. It is then even converted to 12 V before going to the fan.

I don’t have a lot of experience working with electronics but I am aware of the basics like “Don’t touch the wires that are under voltage” and “Measure voltages before you touch anything”.

My wiring looks like this:

When I connected all the cables I thought there was no voltage on any of the pins. I assigned the PD0 pin as a pin that I can switch on and off via SET_PIN PIN=pin_name VALUE=1. This pin was turned off (VALUE=0) and I measured it before connecting.
The pins labeled with FAN0 on the board were also turned off (since in my current config they only turn on when an associated heater is turned on as well).

When I connected the green tach wire to the pin PD2 nothing happened, although I must say I didn’t measure the pins PD2 and PD3 before connecting.

The problem ocurred when I connected the blue PWM wire to PD3.

Does the 3.3V from PD0 or the 12V supply voltage of the fan need to come from an external source? Is that what’s causing the short?

Why did you connect your 24V/12V converter to the fan output and not the printer’s power supply? Going back over the thread, that’s NOT what @hcet14 drew (although, to be fair, he doesn’t make it clear you need a common Ground between the “DC/DC Converter”, the fan and the SKR Mini E3 V3).

Regardless, you connected the yellow wire to the power coming in to the SKR Mini E3 V3 at a fan connector BUT you connected the black wire to the switched output of the fan and this will be floating UNLESS you have the fan running with a 100% duty cycle. So, when you connected power, the 24V/12V converter did not have a ground connection (at least one that wasn’t common to the board) which means the fan didn’t have one and without that, the TACH and PWM pins were probably at 24V relative to the STM32’s Ground because there was no ground for the 24V/12V converter.

When you said you knew some basic rules in electronics, I suggest that you add “Have a common Ground to all the circuits.”

At first I wanted to do that but then all the outputs of the board will run on 12V and I thought that the heaters for the bed and the extruder need 24V to work properly.
I mean if I would just run them on 12V it would take ages for the bed and hotend to heat up, no?

But dont they have a common ground anyways since the board GND pins are all connected, or at least thats what I thought…

This means I should connect the black GND wire from the fan to a GND pin or directly to the GND of the PSU?
And do I need to ground of the DC/DC converter to that same pin as well even though it doesn’t have a GND output?

By “when you connected power” you mean when I turned the PSU on or when I turned the fan on? Because I didn’t turn on the fan at all, only the PSU!

So the wiring should look like this (GND could also be connected to the pins in the black ellipse)?

Hehehe I will definitely add this from now on, thanks! But to be fair I thought I already followed that rule but the problem is rather that I didn’t understand the functionality of the pins correctly…

Regarding the return: I get a new board sent to me today. And yes, it might be my fault that it is broken now but since I ordered it from Amazon I really don’t have a bad conscience from getting a new one paid by them :slight_smile:

Power connection should be so:

Okay but the ground of the converter needs to be connected as well?

Yes to both questions. The DC/DC provides a voltage relative to a common point - this common point is “Ground”, the lowest possible voltage in the circuit.

By turning on the PSU, you ended up applying 24V or so to the MCU’s PD3 and frying it. The ST MCUs don’t have great input voltage protection on their chips - you really have to be careful with them.

Not quite, I think you should go with the wiring diagram produced by @EddyMI3D here in his latest reply to this thread: Noctua 4-pin PWM fan speed control - #18 by EddyMI3D. I would think you have some spare terminals on the AC/DC power supply in the printer - use those for the DC/DC power and the Fan ground.

When I’ve used four wire fans, I use 24V rated fans and avoid the DC/DC all together.