Changing direction of DC motor 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.
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.


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)