Help with getting a motor to run

Me and a friend are pretty new to trying to use the Arduino, what we are trying to do is code the Arduino to try and run the motor in the predetermined path, but nothing happens. We are pretty sure the code is correct as we have tested it on different components as well as switch out wires, everything works individually but when we try to run it all together we get nothing. Let us know if you might know the answer to our problem, we just want to get it to run as a proof of concept so please let us know about any tips or help. Thanks!

Here's the OP's attachment. I have nfc what that's got to do with the question. Mind you, I'm not sure if there even is a question.

Im sorry I was emailing myself the picture and somehow that picture ended up in my emails, here is the correct picture. Our question is also what are we essentially doing wrong as we have no clue why our motor isn't running, If you need further information I will be happy to deliver

Capture.PNG

dakotacortes:
If you need further information I will be happy to deliver

Yeah a circuit diagram and your code would be a good start.

0fba3e2d402c8205cd48bc683c6113f8a801d7d9.png

What is the motor operating volt ?
Which pin you are using to trigger the motor for on and off.
What is the transistor ?.
On that Image you used a transistor. The Arduino pin is connected with some other pin not in base of the transistor.
usually in transistor center pin is the base pin but in that image showing different wiring.

where is the protecting diode ?. if not please add. otherwise it will kill your transistor when switch the inductive loads.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:

Here is really all the code we are using as we just want to test it for now:

int ledPin = 11;

void setup() 
{
  pinMode(ledPin, OUTPUT);
}

void loop() 
{
  analogWrite(ledPin, 183);
}

SureshKumar2610:
What is the motor operating volt ?
Which pin you are using to trigger the motor for on and off.
What is the transistor ?.
On that Image you used a transistor. The Arduino pin is connected with some other pin not in base of the transistor.
usually in transistor center pin is the base pin but in that image showing different wiring.

where is the protecting diode ?. if not please add. otherwise it will kill your transistor when switch the inductive loads.

The Motor operating volt is 3-6V
We are using Pin 11
The transistor is a MPS2222A
We just added a protecting diode to prevent our transistor from dying, Thanks!

manor_royal:
Yeah a circuit diagram and your code would be a good start.

As for the code we had used the number 183 to try and match the voltage of the battery as part of the troubleshooting process and we attached a makeshift diagram to give you an illustration

Makeshift Diagram.PNG

Here's OP's diagram

544821f53a1dfe67d3b6d8b7fbd5284292df66fb.png

Here is a better illustration of the diagram

Circuit diagram.png

OP's new pic:

fe77ddfcf205cd291e972977bba946db61408d22.png


Here
is how to run a motor via a transistor. Your motor's on the wrong side and the diode's in the wrong place.

your circuit is wrong. you added the diode in series. you should add diode across the load.The diode must be reverse polarity(reverse bias) and this is NPN. so the load must be like this. make emitter directly with ground. move the load from emitter side to collector pin.

Try this circuit .

1.PNG

I recommended you could use MOSFET

SureshKumar2610:
your circuit is wrong. you added the diode in series. you should add diode across the load.The diode must be reverse polarity(reverse bias) and this is NPN. so the load must be like this. make emitter directly with ground. move the load from emitter side to collector pin.

Try this circuit .

1.PNG

I recommended you could use MOSFET

We tried what you had recommended and our outcome was this, still would not work, starting to think it could be the code, we also switched the pins from 11 to 13.

Updatedwiring.PNG

Hi,
Is the negative of the battery that powers the motor connected to the arduino gnd?
1edit.jpg
If you are using 3,6V as motor supply, analogWrite(11,255) and/or increase battery voltage, you will be dropping some voltage across the transistor C to E.
Tom... :slight_smile:

TomGeorge:
Hi,
Is the negative of the battery that powers the motor connected to the arduino gnd?
1edit.jpg
If you are using 3,6V as motor supply, analogWrite(11,255) and/or increase battery voltage, you will be dropping some voltage across the transistor C to E.
Tom... :slight_smile:

Thanks that was exactly the problem we ran it with code and its starting to work!! thanks again for the help

I think the battery voltage is not enough. increase your battery