output of pump is not controlled....

part : arduino uno/ npm-4 12v pump , bread board, transister

purpose: pump output control using analogwrite

Source:

int pump = A0; //pump pin AO

void setup ()
{
pinMode (A0,OUTPUT); //
}
void loop ()
{
analogWrite(A0,64); //slow
delay(5000);
analogWrite(A0,255); //fast
delay(5000);
digitalWrite(A0,LOW); // off
delay(10000);
}

Problem: movement of pump is okay but the pump is not worked following the code…

i want to control pump using analog code for time and output control…

I attach the photo that i connected the parts.

outputcontorl.ino (242 Bytes)

Pin A0 is not capable of PWM output, it is an analog input or non-PWM digital I/O.

You must use pin 3,5,6,9,10 or 11 on the Uno for PWM analog output.

I cannot see your breadboard very well but I do not see a base resistor or a free wheeling diode across the motor. You can damage your Arduino without the proper components in the circuit.

Proper motor control circuits can be found here: https://www.gammon.com.au/motors

WattsThat: Pin A0 is not capable of PWM output, it is an analog input or non-PWM digital I/O.

You must use pin 3,5,6,9,10 or 11 on the Uno for PWM analog output.

I cannot see your breadboard very well but I do not see a base resistor or a free wheeling diode across the motor. You can damage your Arduino without the proper components in the circuit.

Thanking for your reply.

As you told me , I change the pin number .

yet,the pump is not workded following the code...

becasuer i am Beginner, i do not understand exactly the circuit.

If I put a diode and a resistor, does this circuit work properly?

OneStep9499: If I put a diode and a resistor, does this circuit work properly?

I'd say the first thing you should do is provide a diagram of the circuit, and not have people trying to decipher that photo.

Here is how to wire a motor and logic level MOSFET transistor. DIG_OUT can be a PWM output.

Without a freewheel diode an inductive load such as motor, relay, solenoid can instantly destroy the circuit
driving it.

First step is to check everything still works by driving a resistor+LED.

That motor can easily pull enough current to melt your breadboard. Breadboards are
not designed for high current.