2

i am working on a project which requires changing the direction of the DC motor using arduino. that is I want the DC motor to rotate clockwise when i press key 'A' and anti clockwise when i press key 'D' on my computer.

i have v+ and v- input wires from battery. i have connected one end of the DC motor to gnd of the battery. On the other end of DC motor i want to connect V+ and V- input from the battery to spin the DC motor in clockwise and anticlockwise respectively. I have used BC547 npn transistor. i do not know how to change inputs (v+ to v- and vice-versa) using arduino when key is pressed.

is there any method other than H-bridge method to do so?

i use arduino uno.

  • I've used a double-pole-double-throw relay once to move a dc motor back and forth. Not ideal, but very easy to wire up, and foolproof. Just out of curiosity, what kind of battery are you using that has three terminals (GND, V+ and V-)? – Gerben Jul 22 '14 at 20:42
  • 2
    When working with DC - no there's no other ways. You can physically reverse the connections with a relay, or you can use an H-bridge. Regardless of the way it might be constructed, a device which allows you to control the current direction electronically will be called an H-bridge. You get an H-bridge in the Arduino starter kit so there's no reason to fear it. They are easy to use. – Jasmine Jul 23 '14 at 0:11
  • @Gerben i have 2 battery packs. i have packaged it into one. i do not fear the use of Hbridge. but i dint want to make the circuit more bulky. so thot if there was an other method where u can achieve this without using Hbridge just by using arduino and transistors – Rajath Jul 23 '14 at 4:12
  • Since you have both a V+ and V- you could just use 2 transitors. If you look at an H-bridge, you only need half the circuit. The only problem is that you need V- to disconnect the NPN transistor, and the arduino can only go as low as GND. So you'd need a second transitor to drive it. The same might also be needed for the PNP side, if the arduino voltage is regulated to a lower value than V+. I found this schematic applicable, but only use the left side, and replace the opto's with normal transisors. – Gerben Jul 23 '14 at 12:04
  • @Gerben thast cool. post that as an answer. thank you much – Rajath Jul 23 '14 at 13:32
1

Since you have both a V+ and V- you could just use 2 transitors. If you look at an H-bridge, you only need half the circuit.

The only problem is that you need V- to disconnect the NPN transistor, and the arduino can only go as low as GND. So you'd need a second transistor to drive it.

The same might also be needed for the PNP side, if the arduino voltage is regulated to a lower value than V+.

I found this schematic applicable, but only use the left side. The right side of the motor should be connected to ground (or the middle voltage of your battery). , and replace the opto's with normal transistors. enter image description here

Come to think of it, I'm not entirely confident about replacing the bottom opto, since battery-negative is below GND in your case. I think it should work, but I'm still quite new to this stuff.

Also make sure you add something like 1k resistors to the base of the transistors (that replace the opto's)

0

L298 IC is very popular way of doing it. IN1 IN2 to control direction, open circuit and breaking (short circuit of motor terminals). EN1 for PWM speed control.

Ready made module PCB widely available.

useful info https://www.sparkfun.com/products/9670

http://forum.arduino.cc/index.php/topic,84439.0.html

Hope it helps.

  • Without using any other IC is there a way? – Rajath Jul 22 '14 at 19:00
  • 1
    You could get 4 transistors and build your own H-bridge instead of one packaged in an IC. – Craig Jul 22 '14 at 20:00
  • Building a discrete H-bridge is non-trivial, so most will go with the IC solution. The L298 works but has high internal losses and is not great for battery powered projects. Something more modern like the TB6612FNG is more fragile but also far more efficient. – Chris Stratton Jul 22 '14 at 20:54
  • L298 boards has been around for long time, made by 50 factories and 200 resellers, thus, very good cost and easy available. Lot of tutorials and examples. New MOS driver can have better several to ten percents turn-on lower power loss which is generally not significant for DIY uses as compared when battery life is very important for real commercial products. They are higher cost and less easily available. – EEd Jul 23 '14 at 1:02
  • Why is an H-bridge non-trivial to build? I could do it with 4 logic level MOSFETs connected to logic lines on an Arduino. Add a few logic gates and it would only need a forward/reverse control and an on/off control from the Arduino. – Duncan C Jul 23 '14 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.