The following schematic is how I'm wiring a 4 wire noctua fan and I'm wondering why the resistor is needed. I have wired things this way before on the advice from people on the forum but I still can't seem to understand why I would do this and would like to try to drill it into my head.
">
~~Please post the link and the schematic, in line.~~Check the fan docs. Perhaps the PWM input needs a pullup. Or the schematic is simply wrong.
The input may be 'open drain' and need the 5V to make sure it goes high when the input is floating.
The PWM input of a 4-pin fan does not need a pull up resistor (the diagram).
The tach input however does, because that pin is open collector/drain.
That physical pull up resistor could be replaced by the internal pull up of the pin.
pinMode(fanPin, INPUT_PULLUP);
Leo..
jremington:
~~Please post the link and the schematic, in line.~~Check the fan docs. Perhaps the PWM input needs a pullup. Or the schematic is
simply wrong.
missdrew:
The input may be 'open drain' and need the 5V to make sure it goes high when the input is floating.
The place I looked at this schematic didn't have the fan model but the Noctua fan I'm using does require 5V on the PWM signal.
Wawa:
The PWM input of a 4-pin fan does not need a pull up resistor (the diagram).The tach input however does, because that pin is open collector/drain.
That physical pull up resistor could be replaced by the internal pull up of the pin.
pinMode(fanPin, INPUT_PULLUP);
Leo..
I'm going to test it with a Mega so I wouldn't need the resistor but I thought I might use a Due also so I would need the pullup resistor for it, correct?
The tach input from the 12V fan requires a 2.7K ohm resistor per the spec sheet.
I thought I might use a Due
Not a good idea for a 5V fan. The Due has 3.3V I/O.
I thought that an open drain (or open collector) is always an output, never an input.
The PWM signal swings from 0V to Vcc and back, so the pull up resistor just adds
to the load on the output and is not required to go to Vcc.
jremington:
Not a good idea for a 5V fan. The Due has 3.3V I/O.
I'm not powering the fan from the the Due, I know the logic is 3.3V and the tach input at 5V would have to be dealt with to lower it to 3.3V to protect the Due.
I would add the pullup resistor for the PWM as the fan needs 5V PWM signal.
herbschwarz:
I thought that an open drain (or open collector) is always an output, never an input.
The PWM signal swings from 0V to Vcc and back, so the pull up resistor just adds
to the load on the output and is not required to go to Vcc.
I'm using open collector proximity sensors as inputs to the arduino.
The fan tach output is open collector per my spec sheet which would make it an input on the arduino.
Depends on the fan but you may want to give this a read. Arduino - how to read and control the speed of a fan. Again, depends on the fan. Most 3 wire 12 VDC fans like those found on home computers have a + / - and a tachometer output. The tach out is normally an open collector so a resistor is added between tach out and +12 volts. With a four wire fan it becomes a matter of the fan and how it is PWM driven for speed control. All 12 volt fans are not created equal. The data sheet for a specific fan would be nice.
You posted your last as I typed.
Ron
You can't pull a 3.3volt logic (input or output) pin to 5volt, because of the internal ESD protection diodes on the pins of a 3.3volt processor. The pin will likely clamp at about 4volt (3.3+0.65), and pulling a pin up strongly beyond "VCC+0.5volt" could damage the processor.
Leo..
Ron_Blain:
Depends on the fan but you may want to give this a read. Arduino - how to read and control the speed of a fan. Again, depends on the fan. Most 3 wire 12 VDC fans like those found on home computers have a + / - and a tachometer output. The tach out is normally an open collector so a resistor is added between tach out and +12 volts. With a four wire fan it becomes a matter of the fan and how it is PWM driven for speed control. All 12 volt fans are not created equal. The data sheet for a specific fan would be nice.You posted your last as I typed.
Ron
Wawa:
You can't pull a 3.3volt logic (input or output) pin to 5volt, because of the internal ESD protection diodes on the pins of a 3.3volt processor. The pin will likely clamp at about 4volt (3.3+0.65), and pulling a pin up strongly beyond "VCC+0.5volt" could damage the processor.
Leo..
I'm really confused now. I have read the stack exchange thread and it cleared some things up but it is using 5V logic and ideally I would like to use the Due at 3.3V logic.
There seems to be some issues with the spec sheet referenced in an earlier post per some on stack exchange but maybe the following schematic will get me to where I would like to go.
[iurl=http:// lint json][/iurl]
PWM speed control is on the blue wire.
If you're going to use a transistor to convert 3.3volt PWM to 5volt PWM, then you need of course a pull up resistor between the collector and a 5volt supply (from the Due).
Pull up resistor can be any reasonable value that the transistor can switch (nothing to do with the fan).
Anything between 220 ohm and 1k could work.
Tach output is on the green wire. That's an open collector output inside the fan.
Software pull up on the pin should be enough. Or 1-10k if you want to be difficult and use external pull up.
Leo..
Just to add one more detail. The tach out is normally two pulses per revolution. So if you use the tach out you may want to be sure of the number of pulses out per revolution.
Ron
Ron_Blain:
Just to add one more detail. The tach out is normally two pulses per revolution. So if you use the tach out you may want to be sure of the number of pulses out per revolution.Ron
It is 2 pulse per rev. I don't really need the tach, I think just turning it either on or off is all I will need.
Wawa:
PWM speed control is on the blue wire.
If you're going to use a transistor to convert 3.3volt PWM to 5volt PWM, then you need of course a pull up resistor between the collector and a 5volt supply (from the Due).
Pull up resistor can be any reasonable value that the transistor can switch (nothing to do with the fan).
Anything between 220 ohm and 1k could work.Tach output is on the green wire. That's an open collector output inside the fan.
Software pull up on the pin should be enough. Or 1-10k if you want to be difficult and use external pull up.
Leo..
Is there a better way than using a transistor?
So the schematic should look like this.
[iurl=http://][/url][/iurl]
ribbonman:
It is 2 pulse per rev. I don't really need the tach, I think just turning it either on or off is all I will need.Is there a better way than using a transistor?So the schematic should look like this.
Schematic looks ok, except for the missing (2.2k - 10k) base current limiting resistor, which you have drawn before.
If you only need on/off, then (~25kHz) PWM is not needed, but you might still need the transistor to convert from 3.3volt to 5volt logic (the blue wire). You could try if the fan still spins at full speed with 3.3volt logic.
If you would use a 5volt processor, then a common digital pin directly connected to the blue wire would be enough.
5volt = ON, 0volt = off (or low speed, depending on the fan).
-
Tach can of course also be used to see if the fan is still spinning.
-
~25kHz PWM is an Intel specification for 4-pin CPU fans.
High, so you don't hear the PWM signal inside the fan.
Leo..
Wawa:
Schematic looks ok, except for the missing (2.2k - 10k) base current limiting resistor, which you have drawn before.If you only need on/off, then (~25kHz) PWM is not needed, but you might still need the transistor to convert from 3.3volt to 5volt logic (the blue wire). You could try if the fan still spins at full speed with 3.3volt logic.
If you would use a 5volt processor, then a common digital pin directly connected to the blue wire would be enough.
5volt = ON, 0volt = off (or low speed, depending on the fan).
Tach can of course also be used to see if the fan is still spinning.
~25kHz PWM is an Intel specification for 4-pin CPU fans.
High, so you don't hear the PWM signal inside the fan.
Leo..
Thanks Leo,
I will give it a try with the 3.3V and see how fast it turns.
I left out the 2.2K - 10K resistor because tach output is open collector and the software pullup on the Due would be sufficient, I can add it back in.
ribbonman:
Thanks Leo,
I left out the 2.2K - 10K resistor because tach output is open collector and the software pullup on the Due would be sufficient, I can add it back in.
?
I mentioned the resistor in the base line of the transistor (for the fan PWM).
No resistor there could fry the Due pin, because the base-emitter junction of a transistor is like a diode to ground.
Leo..
Wawa:
?I mentioned the resistor in the base line of the transistor (for the fan PWM).
No resistor there could fry the Due pin, because the base-emitter junction of a transistor is like a diode to ground.
Leo..
Sorry, should have looked at the old schematic before answering. I will update my schematic.