Can I drive DC motor in both direction using just arduino board?

Hi! Can I drive DC motor in both direction using arduino and programming? I ti's possibe,can you drescribe me how to do it ?

Thx ! :grin:

I think you can not.

I think you tought use the digital pins to give the motor direction. But you can not run a DC Motor with the digital output, even when the digital pins have 5 volts as output, the give just 40 mA, and a DC Motor needs more. So you hace to take power from the labeled 'power' pins on Arduino or even an extra supply.

You will need a motor shield to control de motor or just a L293D IC to control up to 2 motors (I think).

Cheers!

lazarvgd: Hi! Can I drive DC motor in both direction using arduino and programming? I ti's possibe,can you drescribe me how to do it ?

Thx ! :grin:

Yes

But we need to know what motor to tell you if your arduino will last more than a heartbeat

It is far easier/simpler/cheaper to purchase a Motor Driver module/shield with a H bridge which is built for exactly this purpose

Craig

On the basis that a DC motor direction is defined by the polarity of its supply voltage then numerically you can drive a virtual "motor" in either direction directly from an arduino. The "motor" would be connected to a pair of digital outputs, say A and B. When A is at 1 and B is at 0 the "motor" will rotate in one particular direction. If you now set A to 0 and B to 1 the "motor" will rotate in the opposite direction.

However, as others have said the arduino cannot drive a real motor.

And you should always be aware that inductive(*) loads require protection circuitry when connected to any electronic device to prevent inductive spikes causing damage - most motor controllers have flyback diodes built in specifically for this purpose.

(*) anything that involves a coil of wire that generates significant magnetic fields, such as transformer, motor, relay, solenoid.