Arduino Forum

Topics => Robotics => Topic started by: newuser1 on Nov 26, 2012, 01:32 am

Title: need help, Dc motor control using single switch
Post by: newuser1 on Nov 26, 2012, 01:32 am
i'm new user in arduino and i have low experience in programming, so i need help
i want to control Dc motor using single switch
when i press first time, motor turns clockwise
when i press again, motor stops
when i press third time, motor turns anti clockwise
when i press again, motor stops and so on.
Thanks in advance
Title: Re: need help, Dc motor control using single switch
Post by: retrolefty on Nov 26, 2012, 03:09 am
Well that can be pretty easily accomplished with an arduino. For minimum hardware you need any arduino board, a push-button momentary switch, and a motor H-drive controller and power source rated to run the motor in question. The rest is fairly simple sketch software commands.

If you don't require variable speed control for the motor (just full speed forward or reverse, or stopped) then it is possible to replace the H-drive controller with a DPDT relay and a couple of switching transistors, if your switching frequency is not too high. One transistor controls the relay for direction control, and the other transistor switches power on and off for the motor circuit.

Lefty
Title: Re: need help, Dc motor control using single switch
Post by: patduino on Nov 26, 2012, 03:17 am
Welcome!

I see Lefty beat me to it...  As he says, an H-bridge is the simplest way to go, especially for a new programmer (I assume you are also new at electronics, too).

Google H-bridges and see how to connect them to motors and to see how to use a switch.  They both should be fairly easy to understand.

Look online for the parts.

Title: Re: need help, Dc motor control using single switch
Post by: newuser1 on Nov 26, 2012, 09:30 pm
thanks alot for your help :)