How to make a dc motor spin? (No controllers)

I am really confused. I have been trying to make a dc motor spin for a week without success.

I have watched a ton of youtube videos and read articles, but they are all complicating stuff...

I just want to turn my motor on for a second and then turn off for a second (repeatedly)

Right now, I am following this tutorial(Arduino - DC Motor)
There is an image attached, but it is basically the scheme on the tutorial's page.

I have:

  • One (working) dc motor
  • 330 OM transistor
  • Arduino Uno
  • breadboard
  • a diode
  • a transistor? (s9015 c331)

The red wire is the 5v wire
The green wire is the pin wire(3rd pin, digital). It is hard to see in the pic, but there is a resistor between transistors base and the wire.
The blue wire is the ground wire
The white and yellow wires are for my motors + and -
The right-most side of the transistor is connected to diode(diode's cathode is in the correct direction)

My code is super simple:

int motor = 3;

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

void loop() {
digitalWrite(motor, LOW);
delay(1000);
digitalWrite(motor, HIGH);
delay(1000);
}

When I upload the code and run it, nothing happens.
I tried putting, a led to see if the current reaches the motor(the led was working)

I have no idea, what could be wrong :frowning:
:frowning:

  • a transistor? (s9015 c331)

That is a PNP transistor, you need an NPN transistor the way you have wired it.

please draw out your complete circuit so we can see how you've connected it up. Including power sources and connections
(Your meant to be doing the work - not us!)

Also, please use </> code tags to display your code...
Start good habits now, it will serve you well.

Grumpy_Mike:
That is a PNP transistor, you need an NPN transistor the way you have wired it.

Thanks! I didn't know that.
I guess, the other two, slightly bigger transistors are npn ones.

lastchancename:
please draw out your complete circuit so we can see how you've connected it up. Including power sources and connections
(Your meant to be doing the work - not us!)

Also, please use </> code tags to display your code...
Start good habits now, it will serve you well.

I am new to electronics, I am yet going to learn how to draw and read those schematics, but, there is a schematic on the tutorial page I included. I hope that helps :slight_smile:

pupolajshu:
I guess, the other two, slightly bigger transistors are npn ones.

What other transistors?

Don't guess: read their codes and type them into the Googlez and you'll very likely find some info on them..

Are there any dedicated websites which can be used for this?

I have this n661DS LM35DZ transistor(I am pretty sure it IS a transistor)

Googling this tells me it is some temperature sensor, lol

An LM35 is definitely a temperature sensor

I just checked the kit I bought and it turns out I was supposed to have a npn transistor, a temperature sensor and a pnp transistor.
Unfortunately for me, I have got a pnp sensor and two temperature sensors :frowning:
This probably answers my question here......

You may try to switch the motor high side using the PNP transistor instead.

Do make sure the transistor can handle the motor's current!

The original photo shows the motor running off the 5V of the Arduino. Not a good idea.

Grumpy_Mike:
The original photo shows the motor running off the 5V of the Arduino. Not a good idea.

What would be the reason?

Doesn't the diode help?
Pretty much every tutorial out there is like this

pupolajshu:
What would be the reason?

Many motors will take more current than the Arduino can safely deliver. You might get away with it now but if you ever put any load on the motor (i.e. use it to drive something) then you might find you've killed your Arduino.

Steve

The regulator should have a thermal switch, so if overheating it just switches off. In other words, it most likely simply stops working. No matter what, it's not a good idea.

Also the interference kicked out by a motor is likely to reset or upset the Arduino.

Pretty much every tutorial out there is like this

Pretty much every tutorial out there is crap, written by people who do not know what they are doing.

Grumpy_Mike:
Pretty much every tutorial out there is crap, written by people who do not know what they are doing.

Even adafruit drive the motor in this tutorial from the Arduino 5V pin, although in their (her?) defence it does say to watch the current.

It'a bit like most "instructables". If you use the precise motor that they're talking about, often one supplied in a kit, then you might well get away with it (though it's still a bad idea).

But once the information is out in the wider world you're asking for trouble. People, not unreasonably, think they can do the same thing with any old motor they've picked up and suddenly they're in real trouble.

Steve