Why doesn't the Arduino motor do what it should?

Hello, this is my third question on the Arduino topic.

I used this sketch:

const int forwardPin = 8;

const int backwardPin = 12;

const int delayTime = 2000;

void setup(){

pinMode(forwardPin, OUTPUT);

pinMode(backwardPin, OUTPUT);

}

void loop(){

digitalWrite(forwardPin, LOW);

digitalWrite(backwardPin, LOW);

delay(delayTime);

digitalWrite(forwardPin,HIGH);

digitalWrite(backwardPin,LOW);

delay(5000);

}

and I'm just experimenting a little bit so I know how the engine works.

However, it doesn't do what it's supposed to. Sometimes it just rotates jerkily, then for 10 seconds, then not at all, and then it rotates until I unplug it, etc.

I don't know what the problem is and hope someone can answer this for me so that the engine finally does what it's supposed to.

Here are some more pictures of my setup:

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
8 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
KaePie
10 months ago

Images show too little.

Which IC have you installed? Is it connected by data sheet? I miss at least one 100nF condenser zw. GND and 5V.

Did you rebuild a schematic or a grid? Then post this.

And very important in retrofitting: take red and black cables only for power supply.

BrascoC
10 months ago
Reply to  KaePie

That’s a DC engine. He doesn’t need an IC for the code, does he?

RareDevil
10 months ago
Reply to  BrascoC

Yes, because the Arduino exit is the power. There must always be relays or a power level behind. Transistors or optionally H stage (motor driver with change of direction)

KaePie
10 months ago
Reply to  BrascoC

The questioner gives too little information.

I’ve only tried with the Arduino once, I use it for other things: pheli.de

Suiram1
10 months ago
Reply to  KaePie

The IC is an L293D, which is also properly connected.

The concrete structure is this https://www.youtube.com/watch?v=B0YmHIJInto (also from a previous question).