1
\$\begingroup\$

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!

\$\endgroup\$
  • \$\begingroup\$ Why the RPi power supply can't be qualified as "external"? Why do you think your homebrew driver won't require it? Obviously you won't get enough current out of GPIO pins. \$\endgroup\$ – Eugene Sh. Jun 27 '16 at 19:46
  • \$\begingroup\$ I'd be worried that the PCB traces cannot handle a 4 watt draw, and that your supply will brown out, or worse, ignite. Be sure that you're using a minimum 10 Watt 5V power supply, and more than that if you're using peripherals. \$\endgroup\$ – user86234 Jun 27 '16 at 19:49
  • \$\begingroup\$ @EugeneSh. I know I won't get enough current - that's why I'm using the MOSFETs in the first place. \$\endgroup\$ – Kevin Murphy Jun 27 '16 at 19:51
  • 1
    \$\begingroup\$ Ah.. this is the jargon for a daughter board... Anyway, you really don't have to use a "HAT", but build a circuit with a driver on it yourself, exactly like you are planning with the mosfets \$\endgroup\$ – Eugene Sh. Jun 27 '16 at 19:56
  • 1
    \$\begingroup\$ @tuskiomi thanks for bringing that up. something else for me to consider :D \$\endgroup\$ – Kevin Murphy Jun 27 '16 at 19:57
2
\$\begingroup\$

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

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ thanks for the recommendation. the opperating voltage is 2-5V (not sure if you saw that) but in terms of leeway, do you mean going over this? Since the ULN2803A is 8 channel, can I power all 4 motors with this one device? \$\endgroup\$ – Kevin Murphy Jun 28 '16 at 0:18
  • \$\begingroup\$ The outputs do result in a small voltage drop. The motors have to be able to still operate even with this difference in voltage. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 28 '16 at 0:20
1
\$\begingroup\$

The BS170 would work just fine with a loss of 0.5 volts maximum assuming worse case of 5 ohms RDSon. The ULN2803 would work just fine driving 4 servos on at the same time. You will have a voltage drop of just over 1 volt in the ULN2803. You can pick another MOSFET that has a UIS (Un Clamped Inductive Spike) rating and no external diode is needed or required. You can get several amps very cheaply in SMD (Surface Mount Device) package. All of the above parts are available in SMD packages. I would recommend not powering them from the Raspberry pi board as this will induce noise on the board and in its ground circuits.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ "The BS170 would work just fine" - I wouldn't bet on that. Maximum threshold voltage is 3V, which is not much below the Pi's output voltage. Unfortunately I only have one sample to test, but it has a threshold of 2.02V (less than the 'typical' value of 2.1V) yet drops 0.75V at 100mA with 3.30V on the Gate. \$\endgroup\$ – Bruce Abbott Apr 18 at 3:00
  • \$\begingroup\$ I stand corrected, I was thinking of a different processor. I used the Fairchild data sheet, BS170/D and looked at the typical which is 1.5V. If you look at the On data sheet has higher numbers. It may or may not work so you gave the best answer. To be safe it is best to look at the data sheet for the part you have, not all data sheets are the same for the same part number. \$\endgroup\$ – Gil Apr 19 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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