DC Motor Issues

Hi,
I am trying to power a DC motor using my Arduino, however when I run the code and have the motor plugged in, nothing happens. I’ve linked a picture of how it is set up.
The code I am using is as follows:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13,HIGH);
delay(2000);
digitalWrite(13,LOW);
delay(2000);
}

When I put an LED in place of the motor, it works fine, however with the motor it does not work. Any ideas?

How is the motor powered? Not by the Arduino, I hope. There is no picture.

Added the picture. I'm just trying to find the simplest possible way to turn on and off a DC motor. Preferable without transistors or diodes.

What you have is the simplest way without transistors or diodes to destroy your Arduino.

When the motor runs it generates spikes or draw excess current that can damage the Arduino.

Weedpharma

Instead of giving me snarky, unhelpful comments, I'd appreciate it if you helped me to learn from my mistakes.

You absolutely need a transistor and a diode. The transistor to supply the correct current and the diode to prevent reverse EMF from destroying the transistor. The Arduino output can only supply 40 mA without a real risk of damage to the output. The motor will certainly draw more than 40mA.

Added the picture. I'm just trying to find the simplest possible way to turn on and off a DC motor. Preferable without transistors or diodes.

And your idea of "finding" is to connect things to other things without knowing what you are doing ?
Is that your idea of "trying to find " ? God help you if you ever work on anything powered by AC.

XYZAidan:
Instead of giving me snarky, unhelpful comments, I'd appreciate it if you helped me to learn from my mistakes.

If you had done ANY investigation prior to just connecting the way you have, you would already have known it was wrong.

What you have is the most common fault that has been discussed probably daily.

Weedpharma

If you had done ANY investigation prior to just connecting the way you have, you would already have known it was wrong.

If you don't know what you are doing , you shouldn't be doing it, until you research it and find out how to do it. It's that simple. If you are going to play "Russian Roulette" with your arduino then don't be surprised when you destroy it.

I understand that you are clearly much more skilled at this than I am, but being rude and somewhat hurtful is very discouraging to someone who just wants to learn. Instead of acting that way, please help me or don't say anything at all! I started this post because I wanted to learn and get assistance, not be criticized in a condescending way.

I understand that you are clearly much more skilled at this than I am, but being rude and somewhat hurtful is very discouraging to someone who just wants to learn. Instead of acting that way, please help me or don't say anything at all! I started this post because I wanted to learn and get assistance, not be criticized in a condescending way.

I am helping you. There is nothing rude in my post. It is simple statement of fact. You don't have to like it but it is the truth and right now that's what you need to hear. When you post on a forum of experts you should expect to get the truth, the whole truth , and nothing but the truth. We are not customer service reps for some service you are paying for. We are not here to stroke you ego. We are here to tell you what you are doing wrong and why, which is exactly what I have done and all that I have done. If it hurts you to be told you screwed up, then so be it.That's your problem not ours. Our problem is finding out what you did wrong and telling you . How you deal with it is up to you. I suggest you suck it up and say :

"Thank you SIR !, May I have another ?! "

I started this post because I wanted to learn and get assistance

Next time maybe you should post BEFORE you start connecting things.

Hi.
XYZAidan, can you tell us you level of electronics, programming and hardware.
This will help us give you informative answers.
It looks like you are familiar with some programming.

The output pins of the arduino have relatively low current ratings, 40mA, usually suitable for LEDs, opto-couplers and driving other integrated circuits.

To run your motor you will need transistor to switch the larger motor current, and a heavier supply for the motor.

https://itp.nyu.edu/physcomp/labs/motors-and-transistors/using-a-transistor-to-control-high-current-loads-with-an-arduino/

That link will show you how, in fact the rest of the site looks very good for electronics and arduino.

Tom........ :slight_smile:
Do you have Digital Multimeter? Even an elcheapo under $10-$20 will help..

Here's the specs for the UNO.

I'm just trying to find the simplest possible way to turn on and off a DC motor. Preferable without transistors or diodes.

It can be done with relays but you wouldn't have speed control.
Most people use a motor shield or an H-BRIDGE. You need semiconductor devices (ie:transistors or mosfets) to get speed control using PWM.

TomGeorge:
Hi.
XYZAidan, can you tell us you level of electronics, programming and hardware.
This will help us give you informative answers.
It looks like you are familiar with some programming.

The output pins of the arduino have relatively low current ratings, 40mA, usually suitable for LEDs, opto-couplers and driving other integrated circuits.

To run your motor you will need transistor to switch the larger motor current, and a heavier supply for the motor.

https://itp.nyu.edu/physcomp/labs/motors-and-transistors/using-a-transistor-to-control-high-current-loads-with-an-arduino/

That link will show you how, in fact the rest of the site looks very good for electronics and arduino.

Tom........ :slight_smile:
Do you have Digital Multimeter? Even an elcheapo under $10-$20 will help..

Thanks for the useful help Tom, unlike these other commenters. I'm still learning Arduino but I am experienced in basic circuitry. I do have a digital multimeter.

Wow, this 13-post thread has generated four reports to moderator!

Look, you don't need to report every post in a thread, we can read the thread and get the gist of what is happening.

Instead of giving me snarky, unhelpful comments, I'd appreciate it if you helped me to learn from my mistakes.

I don't find the comments above too offensive. They are trying to help save your Arduino from being destroyed.

For anything in this thread to have generated a report to mod, indicates the reporter is overly sensitive to having shortcomings pointed out.

Weedpharma

Should I save him the effort and report myself?

Why not? Actually, don’t bother because I just read that.

Driving motors, lights, etc. from an Arduino output pin

raschemmel:
Here's the specs for the UNO.

I used L293D motor shield , arduino uno and HC-06 bluetooth module.but I don't know how to use these three module efficiently.if you know please let me know and learn for this project.thanks..

raschemmel:
Here’s the specs for the UNO.

It can be done with relays but you wouldn’t have speed control.
Most people use a motor shield or an H-BRIDGE. You need semiconductor devices (ie:transistors or mosfets) to get speed control using PWM.

I used L293D motor shield , arduino uno and HC-06 bluetooth module.but I don’t know how to use these three module efficiently.if you know please let me know and learn for this project.thanks…