TRANSISTOR CODE

When I run this code from the ardino board it functions perfectly.
When I remove the power and ground from the board and attach to an external power 5v supply nothing happens.
I have checked that the external power supply is correctly attached.
The motor works ok directly from the external power supply so it is feeding the power ok.
The wiring diagram is attached, is it something to do with the way the transistor is set up?

/
int motorPin = 9;

void setup() {

pinMode(motorPin, OUTPUT);
}

void loop() {
digitalWrite(motorPin, HIGH);
delay(2000);

digitalWrite(motorPin, LOW);
delay(1000);

}
/

Now show us a good image of ‘your’ actual wiring.

You should never power a motor from the Arduino 5v.

I'm using "Arduino for Dummies" and that's the instruction, the wiring diagram is now attached.
Thanks

You have been warned!

You do have $ for a new Arduino?

Not clear what "last thing" refers to. I have run the program with the 2 power supplies several times each with the same result!
The Arduino has an onboard 5v power supply, not clear why I should not run a motor from it?

Let’s see ‘your’ actual wiring.

“not clear why I should not run a motor from it?”

Because you ‘will’ blow up your voltage regulator.

When I remove the power and ground from the board and attach to an external power 5v supply nothing happens.
I have checked that the external power supply is correctly attached.

When you are using an external power supply how and where are you connecting it to the Arduino ?

larryd:
Because you ‘will’ blow up your voltage regulator.

But the OP stated that the external power supply is 5v. Meaning that Arduino's voltage regulator is not involved at all.

Sam1Bird2:
When I run this code from the ardino board it functions perfectly.
When I remove the power and ground from the board and attach to an external power 5v supply nothing happens.

The external power ( on the jack ) should be between 7V and 12v

Regards,
bidouilleelec

Montmorency:
But the OP stated that the external power supply is 5v. Meaning that Arduino's voltage regulator is not involved at all.

If the external is connected to the jack, Arduino's voltage regulator IS involved.

I am using the arduino's +- rails I upped it to 9v nothing; then double checked Arduino still working with direct + - supply from board.
Why would I need more than 5v direct jack, it runs ok at 3.5v from the Arduino board.
Thanks

Sam1Bird2:
I am using the arduino's +- rails I upped it to 9v nothing; then double checked Arduino still working with direct + - supply from board.
Why would I need more than 5v direct jack, it runs ok at 3.5v from the Arduino board.
Thanks

Is it an Arduino Uno , as shown on your schematic ?

from the power jack I get 9v in constant output 2.9v constant mA .07
From the Arduino board I get varying voltage [as one would expect] 0 - 5v and varying mA 0-0.19
????

Sam1Bird2:
from the power jack I get 9v in constant output 2.9v constant mA .07
From the Arduino board I get varying voltage [as one would expect] 0 - 5v and varying mA 0-0.19
????

I understand that the external power is connected to thr Arduino Jack?
Post your ACTUAL schematic.

Sam1Bird2:
......it runs ok at 3.5v from the Arduino board.

What is this 3.5v ?

larryd:
Because you ‘will’ blow up your voltage regulator.

That probably not since it is a 7805 family type one, which has overheat & over-current protection built in, but the induction that occurs when starting and stopping a motor may damage quite a few other parts.

The Arduino has an onboard 5v power supply, not clear why I should not run a motor from it?

well one of the reasons is mentioned already, but the other thing is that these lineair power regulators are not suitable to drive motors in general, they don't work !

There have been sooo many new people here that have burned out the regulators on their Arduino.

You cannot rely on internal device protection if that device is constantly abused by people who think electronics can be treated as immortal. :wink:

If new people think they are smarter than designers of equipment, their equipment ruined will be their best teacher.

Montmorency:
But the OP stated that the external power supply is 5v. Meaning that Arduino's voltage regulator is not involved at all.

I posted the images the OP attached and said:
“You should never power a motor from the Arduino 5v.”
“from the Arduino 5v”

The OP refuses to address or show us a good image of the “actual” wiring so I have to assume they really don’t want our help.

Using a book like “Arduino for Dummies” explains why many new people have trouble with the documentation.