I've been looking at tutorials that discuss individually how to control motors and servomotors, however can they both be controlled by the same type of motor boards?

If I've got a project that uses 3 individual motors

  • 1 motor to drive a fan (On/Off and amount of power),
  • 1 motor to drive a fan (On/Off only)
  • 1 servomotor (controlling a rudder)

is there any particular setup/motor board anybody can recommend?

2 Answers 2


For DC motors such as fans, you can use a power transistor to switch power to the motor. An H bridge is probably over-kill since you only need the motor to spin in one direction. A circuit like this will probably suffice:


simulate this circuit – Schematic created using CircuitLab

When the GPIO is low, the transistor will be off and no power passed to the motor. However when the GPIO goes high, the transistor will conduct and the motor will run. The motor may produce "electrical noise" which may disturb the operation of the Pi by producing spurious signals. You can minimize or eliminate that with capacitors and chokes around the motor as well as using shield or twisted cables.

If the motor noise is still causing problems, an opto-coupler can be used to isolate the solution into two disconnected circuits.

I have also run into problems with electrical noise with the servos and again an opto-coupler solved my particular issues.

Should you need to control the speed of the motor, there are two solutions. First you can toggle the input to the transistor such that it is alternately on and off. If performed fast enough, then you will get an average voltage to the motor as ratio of the time on to the time off. Should you not need to control the speed of the motor, yet another solution would be to use a relay to control the power to the motor.


Fans are usually standard DC motors and it's simplest if you buy an inexpensive motor driver board.

Look on eBay for inexpensive modules based on the L9110S or the L298N, or even consider a single chip solution such as the L293D if you are happy to use a breadboard.

Each of those modules will drive two DC motors and allow you to change direction (pointless with a fan) and vary the power (by providing PWM signals to the motor driver board inputs).

Check that the fans don't need more power or voltage than the module can supply (unlikely to be a problem).

The servo doesn't need a motor driver board as it contains one. With a servo you just supply power and a PWM control signal.

The Pi can generate the PWM signals you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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