Simple motor control for Mr. Basic
May 22, 2009
I have seen a few people asking questions about controlling Mr. basics motors. One problem is that they draw more current than an L293D can handle. A L298N will do the job but you will want at leat 6V. Below is a schematic of the simplest way I know of to control your motors. Using a 5V relay you can run from 3.6V to 6V. I suggest a 9V relay if you want to use 7.2V.
The relay is a DPDT (double pole double throw) with the motor connected to the common terminals. The forward/reverse signal turns the relay on or off via the BC548 transistor. The diode across the relay coil is wired reverse polarity and only conducts when the coil de-energises to protect the transistor.
You will see in the diagram that with the relay off and the motor connected to the NC (normally closed) contacts that one side is connected to the positive of the battery and the other to ground via another transistor (BD681). When the relay turns on then connections to the motor are reversed and so is the direction of the motor.
The BD681 is a darlington transistor (basically two transistors in one package) that allows a small signal from the processor to drive up to 4A. A heatsink should be used on this transistor! This is your on/off switch. A high to the base of the transistor turns your motor on. A low turns it off. If you are working at 3.6V or trying to drive more than 2A then the 1K resistor could be reduced to as little as 470 ohms.
Because the transistor is working as a highspeed switch you can drive it with your PWM outputs if you want speed control. The diode across the transistor is to protect it from any reverse polarity spikes that can occur when driving an inductive load.
It is documented in the manuals that on powerup or reset that the output pins may temporarily go tri-state (open circuit). To prevent your motor turning on unexpectedly when this happens the 27K resistor pulls the base to ground.
As mentioned below in a reply to Mintvelt. A FET could be used if you are using higher voltages or if you can find a FET designed for low voltage applications.
DAGU is now going to produce a dual version of this for opperating two motors.
This is the new board that has been designed with this circuit.