# Fan is startup slowly after switched on

#### enesene

Joined Mar 3, 2020
29

This is my circuit. When 12V switched on the fan is suddenly spinning slowly and after any command from arduino it reaches its maximum speed as it should be.
But i want this fan not spinning initially until my command. What should i do?

Code:
int led = 9;
String x;
int val;

void setup(){
Serial.begin(9600);
pinMode(led, OUTPUT);
}

void loop(){
if(Serial.available()>0)
{
val=x.toInt();
analogWrite(led, val);
}
}
(it's associated with visual studio)

#### DickCappels

Joined Aug 21, 2008
7,746
What kind of output on the Arduino are you using to switch the fan with?

#### enesene

Joined Mar 3, 2020
29
What kind of output on the Arduino are you using to switch the fan with?
Digital output PWM pin

Joined Jul 18, 2013
23,649
Is there a gate to GND (10k) resistor?

#### vanergr

Joined Nov 23, 2020
10
Hello,
Couple of things to consider:
For the slow start of the fan part
a) does your fan's control sense is logic levels or voltage level and what is the min and max. The Arduino PWM is not much.
PWM Voltage = (Duty cycle/ 256)*5V.
b) Is the current enough to drive the coils?
c) I would personally put a transistor or a mosfet as driver and have the Arduino drive the Base/Gate.
For not starting as soon as the Arduino is on you have to initialize your output as 0 some time if not specified it can cause unwanted behavior.

Joined Jul 18, 2013
23,649
I have never used Arduino, but I would have assumed you need a mosfet from the Arduino output?

#### vanergr

Joined Nov 23, 2020
10
I have never used Arduino, but I would have assumed you need a mosfet from the Arduino output?
I didn't see it on the diagram that's why I mention it.

#### BobaMosfet

Joined Jul 1, 2009
1,854
What is the sticker on the fan that displays its specification and manufacturer so we can pull a datasheet?

#### Yaakov

Joined Jan 27, 2019
3,523
Hello,
Couple of things to consider:
For the slow start of the fan part
a) does your fan's control sense is logic levels or voltage level and what is the min and max. The Arduino PWM is not much.
PWM Voltage = (Duty cycle/ 256)*5V.
b) Is the current enough to drive the coils?
c) I would personally put a transistor or a mosfet as driver and have the Arduino drive the Base/Gate.
For not starting as soon as the Arduino is on you have to initialize your output as 0 some time if not specified it can cause unwanted behavior.
If you parse the TS carefully you will see that he is complaining the fan starts at power up and he wants it not to do that until his program controls it.

"On power up it spins at a slow speed and I want it to stay off until the program sends a particular PWM signal" is my translation. If this is incorrect, I expect @enesene will correct me...

#### enesene

Joined Mar 3, 2020
29
If you parse the TS carefully you will see that he is complaining the fan starts at power up and he wants it not to do that until his program controls it.

"On power up it spins at a slow speed and I want it to stay off until the program sends a particular PWM signal" is my translation. If this is incorrect, I expect @enesene will correct me...
Correct. first of all i made a scroll bar with c# and i used a LED instead of fan motor so i can control led's brightness. it worked perfect. the led stays off until i scroll bar right side and after i scrolling it's getting brighter.
I mean at the start of the program there's no scroll so led is off. But with this 12v pwm fan it starts with a slow spinning.

Joined Jul 18, 2013
23,649
If you parse the TS carefully you will see that he is complaining the fan starts at power up and he wants it not to do that until his program controls it.
It seemed that it could be a floating output until output turned on.
Didn't realize he was not using a Mosfet?

#### vanergr

Joined Nov 23, 2020
10
If you parse the TS carefully you will see that he is complaining the fan starts at power up and he wants it not to do that until his program controls it.

"On power up it spins at a slow speed and I want it to stay off until the program sends a particular PWM signal" is my translation. If this is incorrect, I expect @enesene will correct me...
On his own title he is saying slow startup. That is why I assumed he has two issues, and I did read the hole post and code that is why I broke my suggestions into two.

#### vanergr

Joined Nov 23, 2020
10
Correct. first of all i made a scroll bar with c# and i used a LED instead of fan motor so i can control led's brightness. it worked perfect. the led stays off until i scroll bar right side and after i scrolling it's getting brighter.
I mean at the start of the program there's no scroll so led is off. But with this 12v pwm fan it starts with a slow spinning.
I gave you some ideas to help out both with the slow spin and the erratic behavior. I'm sorry if my suggestions didn't get to be communicated correctly

Joined Jul 18, 2013
23,649
Typical mosfet connection.
Rin = 100R, Rgs 10k.

#### enesene

Joined Mar 3, 2020
29
Typical mosfet connection.
Rin = 100R, Rgs 10k.

View attachment 237030
can i use transistors instead of it?
- i use tip121 power transistor, 2.2k res and uf4007 diode
it works kow but at low voltages it doesn't spin and it's making buzz noise.
I have to scroll up the bar at least 35% to make it spin but after it started to spin it's spinning slowly if i scroll down to like 15% and it stops at %1 as it should be.

thank you

#### vanergr

Joined Nov 23, 2020
10
can i use transistors instead of it?
- i use tip121 power transistor, 2.2k res and uf4007 diode
it works kow but at low voltages it doesn't spin and it's making buzz noise.
I have to scroll up the bar at least 35% to make it spin but after it started to spin it's spinning slowly if i scroll down to like 15% and it stops at %1 as it should be.

thank you
It sounds like the Base-Emitter(on) Voltage isn't sufficient from the Arduino output to turn it on. In that case I would try an optocoupler if your goal is to have that much of control at low speeds. The Arduino can easily drive the LED in those and in theory you could have the control you want to achieve.

Joined Feb 20, 2016
3,914
If you remove the Arduino and connect a 1K resistor between the control pin and gnd, does the fan start?
Assuming 0V is off, that is.
If so, just a resister added to hold the pin at 0V while the Arduino powers up may fix it.
Iff +5V is off, add the resister from control to +5V instead.

#### enesene

Joined Mar 3, 2020
29
I just connect Fans + and - pins with transistor to arduino. I didn't connect PWM pin anywhere. This fan is designed to be controlled with a PWM signal and increase or decrease its RPM so maybe i should connect pwm pin to somewhere? But i don't know where.

#### enesene

Joined Mar 3, 2020
29

#### DickCappels

Joined Aug 21, 2008
7,746
Digital output PWM pin
I believe that is a 0 to 5V output. Add the MOSFET inverter shown by @MaxHeadRoom MOSFET buffer in post 14 and you should get the full range of speeds.