Controlling a DC motor in both directions often need a H-Bridge, which is nothing but an arrangement of few transistors. If not by using a single input, atmost two inputs be used to control the motor in both the directions. Otherwise, there are chances for accidential burning of transistors by programming errors. For example, if you accidentally set the transistors 1 and 2 in conducting state, shot-circuit current will flow through both of these transistor making them useless for further operations.
At any instant only one of the cross pairs of transistors can be in conducting state as explained earlier. These two pairs of transistors are responsible for the movement of motor in both directions. When 1 and 2 are on, the motor moves in one direction, on the other hand when 3 and 4 are on, the motor moves into other direction. Not Gate is placed to make sure that the two pairs are never turned on together.
How to lock the motor using a single input? The single input can be provided with 1 or 0 forcing the motor to move in either direction. So locking of motor can not be achieved. However if the pulse of 50% duty cycle is given to the input, then the motor will come to halt. One disadvantage of this approach is that the motor will draw current even in the locking state.
The above circuit has been tested practically!
More to Follow