Electronic – Driving 4 100mA motors using GPIO pins and BS170s

gpiomosfetmotorraspberry pi

I'm trying to drive 4 tiny vibrating motors which draw 100mA at a maximum of 5V. I need to control them using PWM from the GPIO pins and would like to accomplish this in the smallest form-factor possible as it's for a portible device. I've looked at other motor driver hats and see that most require external power supplies which turns me off as all I want to use is the supply that is powering my RPi.

I've been asking some friends what they think and I've been advised to use 4 BS170 MOSFETs each with a 1N4001 diode to protect against voltage in the wrong direction when turning off the motors.

I'm here essentially to verify that this is a good setup and hear other recommendations as I'm not super familiar with this level of hardware. I'd also love some help with diagramming out how I would go about wiring these (in regards to the MOSFET and diode) coming off the Pi.

Thanks for your help!

Best Answer

If you have a little bit of leeway in what voltage the motors can take then one option is to use a ULN2803A to drive the motors directly. The device comes in a SOIC-18 package, and even includes flyback diodes in order to save as much board space as possible. Tying the drivers together in pairs will distribute the load across each, keeping the voltage drop low.

schematic

simulate this circuit – Schematic created using CircuitLab

Related Topic