I just got a new Raspberry Pi 3 model B and I need to do the following for my project

  1. Connect a L293D motor driver to GPIO
  2. Connect a LED to GPIO and
  3. Connect a cooling fan to GPIO

I have doubts regarding

a) Can I directly connect motor driver using female - female Jumper wire to Rpi and

b) which all pins I should use for LED (1.5-3v), Fan (1.5-3v) and motor driver?

I don't want to use a bread board so I'm wondering whether direct connections are possible.

1 Answer 1

  1. Adafruit has a tutorial on how to use the L293D with a Raspberry Pi

  2. A small LED can be driven from the GPIO, you need a current limiting resistor in series. The GPIO pins can be set high (3V3) or low (0V) allowing current to flow either to ground or the 3V3 rail. So you can basically choose if you want the LED on when the pin is high or low. Here's an explanation on how to do that.

  3. As long as the fan doesn't draw too much current, and starts on a low enough supply (3.3 volts) then it could be used. A neater solution is to use a MOSFET to drive the load, as the MOSFET is voltage controlled and draws nearly zero current from the GPIO pin. Andreas Spiess has a good video on how to do this, and you can even PWM the fan to get variable speed.

Main problem is that the Raspberry can only sink 16mA per pin, with a system total maximum of 51mA, so you don't have much current to play with from the get-go, thus the MOSFET solution. More reading regarding current capabilities of the GPIO

Your Answer

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

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