Go Down

Topic: output of pump is not controlled.... (Read 267 times) previous topic - next topic

OneStep9499


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.

WattsThat

#1
Feb 11, 2019, 05:31 am Last Edit: Feb 11, 2019, 05:36 am by 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.

Proper motor control circuits can be found here: https://www.gammon.com.au/motors
Vacuum tube guy in a solid state world

OneStep9499

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?

not_a_noob

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.


jremington

#4
Feb 12, 2019, 02:43 am Last Edit: Feb 12, 2019, 02:45 am by jremington
Here is how to wire a motor and logic level MOSFET transistor. DIG_OUT can be a PWM output.


MarkT

#5
Feb 12, 2019, 12:38 pm Last Edit: Feb 12, 2019, 12:39 pm by MarkT
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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up