My fan keeps running no matter what

My fans run no matter what when i plug my 4AA batteries but work fine when I plug a usb



I think it has to do with the way I connected the power supply.

4 AA batteries is only 6 volt, the Arduino needs at least 7 volt supplied via the barrel jack to work properly....

I imagine the Arduino is been reset constantly be the on-chip brownout detection, or the motor is drawing to much power, for the chip to work stably.

1 Like

grafik

1 Like

The motor only needs 5V. And thats a big oh no

What can I do other than buy another big battery pack?

Try running the board of 4.5 volt by connecting 3 AA batteries to 5V on the board.

I'm also going to put an lcd and couple more sensors. Would that be enough?

The answer is simple.
Create an energy balance to determine the capacity of the battery.

Yes, but probably won't last very long....Look for a 6x AA battery holder to supply the recommended voltage range.

I've switched back to usb :frowning:

Why does my tmp 36 interfere with the fan motor?

Hard to say....Could you please provide the code in code tags(the button).

1 Like
int in1 = 2; //int is a function where you can set a variable to an integer.

int in2 = 3; //In this case, you use the int function to navigate pin numbers or also called magic numbers.

int tempSensor = A0; //A0 is an analog pin.
float temp;
int tempLimit = 27;

void setup() {
  Serial.begin(9600); //Sets the tickspeed to 9600 outputs per min

  pinMode(in1, OUTPUT); // By using the pinMode function, you can set whether the pin will OUTPUT or INPUT something.

  pinMode(in2, OUTPUT); // in2 is a pin in a motor, which needs to OUTPUT a spinning motion.

}

void loop() {
  //Temperature Code
  int tempRead = analogRead(tempSensor); //Reads Input from the Temperature Sensor
  
  float tempVoltage = tempRead * (5.0 / 1024.0); //Converts tempRead to Voltage (5V)

  temp  = (tempVoltage - 0.5) * 100; //Converts Voltage to Temperature (Celcius)
  Serial.println(temp);
  if (temp >= tempLimit) { //If temperature is higher than the set limit, it activates the fan. Else, nothing happens.
    digitalWrite(in1, LOW); //By using the digitalWrite function, we can set input voltage towards the fan and its direction.
    digitalWrite(in2, HIGH);

  } else {
    digitalWrite(in1, LOW);
    digitalWrite(in2, LOW);
  }

}

I don't use the buttons

Because the temperature limit hasn't been reached?

When the temperature limit reaches and the motor turns on, then the Serial Output outputs like random numbers like 30 and 17

Can I double power my arduino uno using a USB and the barrel jack with 4 AA batteries?

This is because I'm running 2 motors at the same time

Not exactly…..
The uno will pick the barrel jack(I think)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.