cditty
Posts: 31
Joined: Fri Sep 28, 2012 3:05 pm

Pi Zero - Motor controller needed?

Thu Aug 29, 2019 6:17 pm

I'm trying to control 1 motor from a raspberry pi zero w. I just need it to spin one direction for x seconds and then another direction for x seconds. Do I need a motor controller board for that? I'm looking at the gpiozero modules to control it and it doesn't show a controller board so I'm confused.

Can someone school a newbie please? Thanks

trejan
Posts: 584
Joined: Tue Jul 02, 2019 2:28 pm

Re: Pi Zero - Motor controller needed?

Thu Aug 29, 2019 6:43 pm

You can't directly drive a motor from the GPIO pins. That motor wants far more current than the GPIO pin is able to supply. If you look at the diagram on the gpiozero page, it uses a SN754410 driver. Replicate the circuit on the diagram or an alternative would be a L293D but you'd need to wire it differently.

User avatar
B.Goode
Posts: 8609
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pi Zero - Motor controller needed?

Thu Aug 29, 2019 7:36 pm

cditty wrote:
Thu Aug 29, 2019 6:17 pm
I'm trying to control 1 motor from a raspberry pi zero w. I just need it to spin one direction for x seconds and then another direction for x seconds. Do I need a motor controller board for that? I'm looking at the gpiozero modules to control it and it doesn't show a controller board so I'm confused.

Can someone school a newbie please? Thanks

You have apparently only looked at the Simple Recipe for gpiozero. But the Motor documentation there does show a breadboard with a chip on it between the RPi and the motor - that chip must be there for a purpose... it is the H-bridge controller.

The full documentation is more explicit:
Attach an H-bridge motor controller to your Pi; connect a power source (e.g. a battery pack or the 5V pin) to the controller; connect the outputs of the controller board to the two terminals of the motor; connect the inputs of the controller board to two GPIO pins.
Ref: https://gpiozero.readthedocs.io/en/stab ... html#motor


Don't connect a motor directly to your RPi, even to run it in one direction. Catastrophic/fatal/permanent damage to your RPi can result.

LTolledo
Posts: 1963
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Pi Zero - Motor controller needed?

Thu Aug 29, 2019 9:08 pm

Whereas nobody here can physically stop you from doing what you want to do if you insist.

you can connect and control your motor to the RPiZW, run it in one speed in one direction and one time only!

after that your RPIZeroW is: (take your pick)
K.I.A. (killed in action!)
kaput!
inoperable!
irreparably damaged!
toast!
fried!
unusable!
irreparable!
rendered useless!
$10 down the drain!

if you still dont understand it then you'll just have to learn the hard way....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

cditty
Posts: 31
Joined: Fri Sep 28, 2012 3:05 pm

Re: Pi Zero - Motor controller needed?

Fri Aug 30, 2019 1:23 am

Thanks for the info. I didn't realize that this would actually hurt the pi. I've already the motor controller, I was just trying to get around having to use it. I'm concerned about a secondary power source for it.

stiehler
Posts: 2
Joined: Mon Sep 23, 2019 5:50 pm

Re: Pi Zero - Motor controller needed?

Mon Sep 23, 2019 6:09 pm

Would a relay work in this instance?

Return to “Automation, sensing and robotics”