smartish PC fan controller with redboard and ardumoto

I have a sparkfun redboard and ardumoto shield, i want to use these two components to control 3 PC fans, 2 are exactly alike (92mm runs 11.9 -12.1 volts max speed) and can be run as one fan the 3rd fan (120mm) needs a slightly higher voltage (13.1) to run at full speed, i want all 3 fans to run at full speed all the time to keep a hacked together server tower cool(hard drives, chipset, gpus), 1 fan is a 120mm 12 volt fan running at .32 amps it has 2 wires but looks like it has the pad and circuitry for adding a 3rd wire, the 2 fans that need to run the same are both 92ish millimeter 12 volt .68 amp 3 wire fans, all brushless dc. i can pull 12 volts and 5 volts from one of the 4 pin molex rails, however when i plug the fans directly into the motherboard or power supply they do not run at full speed, i can get full speed from them when i connect the fans to a brushless motor controller. i need the 2 92mm fans to passively cool 2 nvidia tesla k20x’s plus the boards chipset and the 120 is cooling the sata raid array. (i don’t want to have to buy more stuff but if it’s the only way i can do this i will, i can also populate the boards with extra stuff if it’ll help)

Thanks for any help you can give!

ok how do i fix this code, and add in the 3rd wire so it can check to make sure the fans are spinning and spin in the correct direction? THANKS!

    /* 
  Three useful functions are defined:
    setupArdumoto() -- Setup the Ardumoto Shield pins
    driveArdumoto([motor], [direction], [speed]) -- Drive [motor] 
      (0 for A, 1 for B) in [direction] (0 or 1) at a [speed]
      between 0 and 255. It will spin until told to stop.
    stopArdumoto([motor]) -- Stop driving [motor] (0 or 1).

  setupArdumoto() is called in the setup().
  The loop() demonstrates use of the motor driving functions.
*/

// Clockwise and counter-clockwise definitions.
// Depending on how you wired your motors, you may need to swap.
#define FORWARD  0
#define REVERSE 1

// Motor definitions to make life easier:
#define MOTOR_A 
#define MOTOR_B 

// Pin Assignments //
//Default pins:
#define DIRA 12 // Direction control for motor A
#define PWMA 3  // PWM control (speed) for motor A
#define DIRB 13 // Direction control for motor B
#define PWMB 11 // PWM control (speed) for motor B

////Alternate pins:
//#define DIRA 8 // Direction control for motor A
//#define PWMA 9 // PWM control (speed) for motor A
//#define DIRB 7 // Direction control for motor B
//#define PWMB 10 // PWM control (speed) for motor B


void setup()
{
  setupArdumoto(); // Set all pins as outputs
}

void loop()
{
  // Drive motor A slow ramp up as test
  driveArdumoto(MOTOR_A, FORWARD, 55);
  delay(1000);  
  driveArdumoto(MOTOR_A, FORWARD, 110);
  delay(1000);
  driveArdumoto(MOTOR_A, FORWARD, 175);
  delay(1000);
  driveArdumoto(MOTOR_A, FORWARD, 255);
  delay(1000);
  stopArdumoto(MOTOR_A); 

  // Drive motor B slow ramp up as test
  driveArdumoto(MOTOR_B, FORWARD, 55);
  delay(1000);  
  driveArdumoto(MOTOR_B, FORWARD, 110);
  delay(1000);
  driveArdumoto(MOTOR_B, FORWARD, 175);
  delay(1000);
  driveArdumoto(MOTOR_B, FORWARD, 255);
  delay(1000); 
  stopArdumoto(MOTOR_B); 
  
  // Drive both
  driveArdumoto(MOTOR_A, FORWARD, 255);  // Motor A at max speed.
  driveArdumoto(MOTOR_B, FORWARD, 255);  // Motor B at max speed.
 

}

// driveArdumoto drives 'motor' in 'dir' direction at 'spd' speed
void driveArdumoto(byte motor, byte dir, byte spd)
{
  if (motor == MOTOR_A)
  {
    digitalWrite(DIRA, dir);
    analogWrite(PWMA, spd);
  }
  else if (motor == MOTOR_B)
  {
    digitalWrite(DIRB, dir);
    analogWrite(PWMB, spd);
  }  
}

// stopArdumoto makes a motor stop
void stopArdumoto(byte motor)
{
  driveArdumoto(motor, 0, 0);
}

// setupArdumoto initialize all pins
void setupArdumoto()
{
  // All pins should be setup as outputs:
  pinMode(PWMA, OUTPUT);
  pinMode(PWMB, OUTPUT);
  pinMode(DIRA, OUTPUT);
  pinMode(DIRB, OUTPUT);

  // Initialize all pins as low:
  digitalWrite(PWMA, LOW);
  digitalWrite(PWMB, LOW);
  digitalWrite(DIRA, LOW);
  digitalWrite(DIRB, LOW);
}

oops didn’t define motor_A and B, still need to query the speed wire and if the fans aren’t spinning to sound a speaker alert.

where do i put this so it makes the fans spin at max rpm?

analogWrite(3, 255);

it’s two of these fans, they are most important to have running full speed:

Description: NMB (3612KL-04W-B66) 92x32mm Cooling Fan 3-pin Dell Connector

Dell P/N: 8J208, 21KTM, D1598, 929FF, 4W022, F0995, D1598

Model: NMB 3612KL-04W-B66

DC12V 0.68A

Input Power: 1.25W

Speed: 1400~3800 RPM Thermal Control with Heat Sensor

Air Flow: 25~69.91 CFM

Noise Level: 17~43.5 dBA

10-Inch / 3-Wire / Dell 3-Pin Connector.

Dell Compatible Models 7J639, 7G538, 07G538, D1598 3612KL-04W-B66 M35172-57

ProfessorBean:
where do i put this so it makes the fans spin at max rpm?

analogWrite(3, 255);

this doesn’t work on 3 wire fans… the 3rd wire appears to just be a tachometer

i’ve been pulling 12 volts @ 1 amp through the barrel plug on the red board for testing, but the fans are not spinning at full speed no matter what i set the value to, i had planned to modify a 4 pin molex from the atx power supply to connect to the shield power in so i could pull the full 12 volts across up to 5 amps, would the barrel plug be the culprit?

i want all 3 fans to run at full speed all the time

Connect all 3 fans directly to 12 volts. No arduino, no motor driver board, no motherboard.

YellowDog:

i want all 3 fans to run at full speed all the time

Connect all 3 fans directly to 12 volts. No arduino, no motor driver board, no motherboard.

That’s the odd thing, the fans won’t run at full speed if i connect them to direct 12 volts, (even though they have all the circuitry built in to their own esc chip) they only run full speed when connected to an external ESC with a potentiometer connected, and i have to turn the pot up and down till i get the fans spinning, then i can fine tune till i get max rpm, i was hoping i could automated all that with the redboard and adrumoto shield

I’ve never seen a 3 wire fan behave like you describe. 4 wire fans, yes but not 3 wire.

Might be easier and less expensive to just get some 12 volt 2 wire fans and use those instead.

YellowDog:
I’ve never seen a 3 wire fan behave like you describe. 4 wire fans, yes but not 3 wire.

Might be easier and less expensive to just get some 12 volt 2 wire fans and use those instead.

now that you mention it, i peeled back the sticker on the back of the fan to have a look, and there is a pad for a 4th wire! i’m going to try and send pwm signals to that pad and see if i can get it spinning at decent rpm

ProfessorBean:

YellowDog:
I’ve never seen a 3 wire fan behave like you describe. 4 wire fans, yes but not 3 wire.

Might be easier and less expensive to just get some 12 volt 2 wire fans and use those instead.

now that you mention it, i peeled back the sticker on the back of the fan to have a look, and there is a pad for a 4th wire! i’m going to try and send pwm signals to that pad and see if i can get it spinning at decent rpm

i can definitely send pwm over this new 4th wire however it still only spins half speed, perhaps i need it at a faster speed then stock?

i tried this code however it didn’t work to spin the fan at full speed

    /* 
  Three useful functions are defined:
    setupArdumoto() -- Setup the Ardumoto Shield pins
    driveArdumoto([motor], [direction], [speed]) -- Drive [motor] 
      (0 for A, 1 for B) in [direction] (0 or 1) at a [speed]
      between 0 and 255. It will spin until told to stop.
    stopArdumoto([motor]) -- Stop driving [motor] (0 or 1).

  setupArdumoto() is called in the setup().
  The loop() demonstrates use of the motor driving functions.
*/

// Clockwise and counter-clockwise definitions.
// Depending on how you wired your motors, you may need to swap.
#define FORWARD  0
#define REVERSE 1

// Motor definitions to make life easier:
#define MOTOR_A 0
#define MOTOR_B 1

// Pin Assignments //
//Default pins:
#define DIRA 12 // Direction control for motor A
#define PWMA 3  // PWM control (speed) for motor A
#define DIRB 13 // Direction control for motor B
#define PWMB 11 // PWM control (speed) for motor B

////Alternate pins:
//#define DIRA 8 // Direction control for motor A
//#define PWMA 9 // PWM control (speed) for motor A
//#define DIRB 7 // Direction control for motor B
//#define PWMB 10 // PWM control (speed) for motor B


void setup()
{
  setupArdumoto(); // Set all pins as outputs
  driveArdumoto(MOTOR_A, FORWARD, 100); //testing sequence to verify fan is working
  delay (1000);
  driveArdumoto(MOTOR_A, FORWARD, 175);
  delay (1000);
  driveArdumoto(MOTOR_A, FORWARD, 200);
  delay (1000);
  driveArdumoto(MOTOR_A, FORWARD, 255);
  delay (1000);
  driveArdumoto(MOTOR_B, FORWARD, 100); //testing sequence to verify fan is working
  delay (1000);
  driveArdumoto(MOTOR_B, FORWARD, 175);
  delay (1000);
  driveArdumoto(MOTOR_B, FORWARD, 200);
  delay (1000);
  driveArdumoto(MOTOR_B, FORWARD, 255);
  delay (1000);
}

void loop()
{

  driveArdumoto(MOTOR_A, FORWARD, 255);  // Motor A at max speed.
  analogWrite(3, 255); //make sure fan is spinning full speed
  driveArdumoto(MOTOR_B, FORWARD, 255);  // Motor B at max speed.
  analogWrite(11, 255); //make sure fan is spinning full speed
}
// driveArdumoto drives 'motor' in 'dir' direction at 'spd' speed
void driveArdumoto(byte motor, byte dir, byte spd)
{
  if (motor == MOTOR_A)
  {
    digitalWrite(DIRA, dir);
    analogWrite(PWMA, spd);
  }
  else if (motor == MOTOR_B)
  {
    digitalWrite(DIRB, dir);
    analogWrite(PWMB, spd);
  }  
}

// stopArdumoto makes a motor stop
void stopArdumoto(byte motor)
{
  driveArdumoto(motor, 0, 0);
}

// setupArdumoto initialize all pins
void setupArdumoto()
{
  // All pins should be setup as outputs:
  pinMode(PWMA, OUTPUT);
  pinMode(PWMB, OUTPUT);
  pinMode(DIRA, OUTPUT);
  pinMode(DIRB, OUTPUT);

  // Initialize all pins as low:
  digitalWrite(PWMA, LOW);
  digitalWrite(PWMB, LOW);
  digitalWrite(DIRA, LOW);
  digitalWrite(DIRB, LOW);
}

after some probing with the multimeter, the pad for the new wire appears to be connected through the temperature sensor, ill try heating it up with it just connected to 12 volts to see if it speeds up

ProfessorBean:
after some probing with the multimeter, the pad for the new wire appears to be connected through the temperature sensor, ill try heating it up with it just connected to 12 volts to see if it speeds up

and that’s exactly what happened! turns out i have to put a resistor across the temperature sensor these fans are good but not for this application!

ProfessorBean:

ProfessorBean:
after some probing with the multimeter, the pad for the new wire appears to be connected through the temperature sensor, ill try heating it up with it just connected to 12 volts to see if it speeds up

and that’s exactly what happened! turns out i have to put a resistor across the temperature sensor these fans are good but not for this application!

OK! SO to use these awesome fans and bypass the temperature sensor you have to bridge the 12 volt+ with the pad that connects to the sensor, then bingo! WARP SPEED