# Motor driver for Pi Zero

**URL:** <https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108>\
**Category:** Uncategorized\
**Created:** [15 February 2022 07:10 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108 "2022-02-15T07:10:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [15 February 2022 07:10 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/1 "2022-02-15T07:10:17Z")

</div>

Hi team,

Any suggestion on motor driver and DC servo motor for Raspberry Pi Zero?

Any comment on the following?

> **[SparkFun Qwiic Motor Driver](https://core-electronics.com.au/sparkfun-qwiic-motor-driver.html)**
>
> The SparkFun Qwiic Motor Driver takes all the great features of the Serial Controlled Motor Driver (SCMD) and miniaturizes them, adding Qwiic ports for plug and .. read more

Vs.

> **[DC Motor Driver HAT(V1.0)](https://core-electronics.com.au/dc-motor-driver-hat-v1-0.html)**
>
> This is a Raspberry Pi DC motor driver board with on-board encoder interface, which can drive 2-way DC motor and DC motor with encoder. It communicates with Raspberry .. read more

VS

> **[Adafruit 16-Channel PWM / Servo Bonnet for Raspberry Pi](https://core-electronics.com.au/adafruit-16-channel-pwm-servo-bonnet-for-raspberry-pi.html)**
>
> The Raspberry Pi is a wonderful little computer, but one thing it isn't very good at is controlling Servo Motors - these motors need very specific and repetitive .. read more

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [16 February 2022 01:03 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/2 "2022-02-16T01:03:08Z")

</div>

Hi Riddhi,

All three of those motor drivers are very similar in that they all communicate via I2C protocol with a Pi Zero and will be able to use an external power supply to drive a motor.

Have you got a motor in mind you want to drive or can you give us some more details about your requirements?  
One of those motor drivers is 16 channels, how many motors do you need to control and what type of motor will they be?

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [16 February 2022 01:43 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/3 "2022-02-16T01:43:30Z")

</div>

Thanks Trent,

We are building a cable cam so basically only 1 motor needed. The cable cam will have a total weight of around 1kg. It will stop at every 5meter interval. For motor, we are thinking these options:

> **[Metal DC Geared Motor w/Encoder - 12V 251RPM 18Kg.cm](https://core-electronics.com.au/12v-dc-motor-251rpm-w-encoder.html)**
>
> This is a Gear Motor w/Encoder, model No.GB37Y3530-12V-251R. It is a powerful 12V motor with a 43.8:1 metal gearbox and an integrated quadrature encoder that provides a resolution of 16 counts per revolution of the motor shaft, which corresponds to...

> **[Metal DC Geared Motor w/Encoder - 6V 210RPM 10Kg.cm](https://core-electronics.com.au/metal-dc-geared-motor-w-encoder-6v-210rpm-10kg-cm.html)**
>
> This is a metal geared DC motor w/Encoder. It is a 6V motor with a 34:1 metal gearbox and an integrated quadrature encoder that provides a resolution of 11 counts .. read more

> **[391:1 Metal Gearmotor 20Dx46L mm 6V](https://core-electronics.com.au/391-1-metal-gearmotor-20dx46l-mm-6v.html)**
>
> These small brushed DC gearmotors can deliver a lot of power for their size. This version has a 6V brushed DC motor combined with a 390.6:1 metal spur...

Thanks.

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [16 February 2022 03:52 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/4 "2022-02-16T03:52:39Z")

</div>

Hi Riddhi,

Sounds like a cool project, a motor with an encoder would be a lot easier to keep track of if you wanted to move the camera fixed distances without having to adjust with a human operator. Keep in mind your motor stall current will determine the maximum load that will be placed on the motor driver.

The drivers you’ve linked are mostly good for up to 1.2A and some of these gearmotors have a stall current of 3.2A.

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [16 February 2022 04:23 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/5 "2022-02-16T04:23:03Z")

</div>

Thanks Trent,

For a load of 1kg and to be on safe side, lets consider it 2kg, which of these motors would you suggest? I am leaning towards DFRobot Driver with 6v 10kg 210rpm motor from dfrobot

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [16 February 2022 04:29 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/6 "2022-02-16T04:29:44Z")

</div>

Hi Trent, further to my previous message…  
i get what you mean now… i did not even check the stall current on mentioned motors because DFRobot seems to be showing those motors as compatible with this driver. Here on this page: [DC Motor Driver HAT for Raspberry Pi Wiki - DFRobot](https://wiki.dfrobot.com/DC_Motor_Driver_HAT_SKU_DFR0592)

Will this impact only the speed or is it going to kill my hardware?

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [16 February 2022 05:35 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/7 "2022-02-16T05:35:31Z")

</div>

Hi Riddhi,

I see what you mean DFRobot is linking to that motor as a required part but then also warning to ensure that the motor’s current stays below 2A. I think this is a mistake

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/912254d3d436bcd0ec107977b481a010a8ca4cbc.png)

When sizing up components in a drive system some things can feel like a bit of a chicken and egg scenario, where chosing one part impacts another and vise versa. The typically way to size a drivetrain is as follows:

- Start from the force required and work out a motor and gearbox combination that can output the required speed and torque.
- Then once you know the operating voltage and stall current of the motor find a driver that can supply more of both (you always want a little headroom to be safe).
- Then check that your power supply or battery can supply the maximum output of the driver, you may need a regulator between your driver and power supply/battery.

In all cases the load determines the first requirement, then everything else must meet or exceed those specs back towards the power supply.

A good way to think of it is that your load (the motor) draws whatever power it needs. The driver or power supply doesn’t push current, the load pulls it.

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [16 February 2022 06:38 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/8 "2022-02-16T06:38:45Z")

</div>

Thanks Trent,

I will start looking for motors based on a weight capacity of 2kg and check what amp current are the selection options. However, in case I cannot find any motor for less than 3.6a stall current, which motor driver (with encoder support) would you recommend?

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [16 February 2022 07:36 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/9 "2022-02-16T07:36:42Z")

</div>

Do you think any of the following will work for my use case?:

> **[172:1 Metal Gearmotor 25Dx71L mm MP 12V with 48 CPR Encoder](https://core-electronics.com.au/172-1-metal-gearmotor-25dx71l-mm-mp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a medium-power, 12 V brushed DC motor combined with a 171.79:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

> **[9.7:1 Metal Gearmotor 25Dx63L mm MP 12V with 48 CPR Encoder](https://core-electronics.com.au/9-7-1-metal-gearmotor-25dx63l-mm-mp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a medium-power, 12 V brushed DC motor combined with a 9.68:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

> **[227:1 Metal Gearmotor 25Dx71L mm MP 12V with 48 CPR Encoder](https://core-electronics.com.au/227-1-metal-gearmotor-25dx71l-mm-mp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a medium-power, 12 V brushed DC motor combined with a 226.76:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

> **[9.7:1 Metal Gearmotor 25Dx63L mm LP 12V with 48 CPR Encoder](https://core-electronics.com.au/9-7-1-metal-gearmotor-25dx63l-mm-lp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a low-power, 12 V brushed DC motor combined with a 9.68:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

> **[47:1 Metal Gearmotor 25Dx67L mm LP 12V with 48 CPR Encoder](https://core-electronics.com.au/47-1-metal-gearmotor-25dx67l-mm-lp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a low-power, 12 V brushed DC motor combined with a 46.85:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

> **[99:1 Metal Gearmotor 25Dx69L mm LP 12V with 48 CPR Encoder](https://core-electronics.com.au/99-1-metal-gearmotor-25dx69l-mm-lp-12v-with-48-cpr-encoder.html)**
>
> This gearmotor consists of a low-power, 12 V brushed DC motor combined with a 98.78:1 metal spur gearbox, and it has an integrated 48 CPR quadrature...

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [17 February 2022 00:08 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/10 "2022-02-17T00:08:08Z")

</div>

Hi Riddhi,

You’re in luck! Those Pololu motors have an excellent table in the product description that lays out the capabilities and requirements of all those motors:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/e/e0fdc3d79c818b9678586c20d3def46d15044060.png)

So just follow Trent’s instruction above, (work out the torque required etc.) and you should be on your way!

-James

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [17 February 2022 03:52 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/11 "2022-02-17T03:52:54Z")

</div>

Thanks Trent and James,

Exactly what doctors ordered! 🙂

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [3 March 2022 02:30 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/12 "2022-03-03T02:30:09Z")

</div>

Hello there,

I received my motors yesterday and seem to be working as expected. Could you please suggest some ideas for setting position/location control? I am using Polulu motor with DFRobot Motor Driver Hat v1

---

<div class="post-metadata">

**Author:** ![Liam120347](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam120347/32/5003_2.png) [@Liam120347](https://forum.core-electronics.com.au/u/Liam120347)\
**Post date:** [3 March 2022 09:26 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/13 "2022-03-03T09:26:34Z")

</div>

Hi Riddhi,

I’d have a look at using a linear encoder or distance sensor such as an ultrasonic or TOF sensor. There are lots to choose from but are project dependent on length, speed that the vehicle will be travelling at etc.

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [5 March 2022 03:08 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/14 "2022-03-05T03:08:21Z")

</div>

Hi Liam, I am using this motor with built-in encoder: [47:1 Metal Gearmotor 25Dx67L mm LP 12V with 48 CPR Encoder | POLOLU-4885 | Core Electronics Australia](https://core-electronics.com.au/47-1-metal-gearmotor-25dx67l-mm-lp-12v-with-48-cpr-encoder.html)

Will this be the best choice if I want to stop motor at certain distance for few seconds and then move it again. Total distance 50m in one direction and then move back to its starting position.

---

<div class="post-metadata">

**Author:** ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)\
**Post date:** [5 March 2022 04:12 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/15 "2022-03-05T04:12:40Z")

</div>

If you know how many turns of the shaft there are in 50m of movement, then you can multiply that by 48 and turn the motor while you count that many ticks of the encoder. Then wait a few seconds before reversing the motor direction and counting the same number back to the start.

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [5 March 2022 08:02 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/16 "2022-03-05T08:02:59Z")

</div>

Thanks, Jeff, Not sure why I was making it too complex. sometimes the simplest way is the right way :).

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [5 March 2022 08:05 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/17 "2022-03-05T08:05:05Z")

</div>

It is almost ready for me. Now have one quick question regarding power source. I was thinking of using a single powerbank as a power source to provide current to the Pi Juice and the motor. However, the variable voltage power bank with the capability to provide up to 20v seems to be sending only 5v to the DFRobot Motor Driver. Any suggestions?

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [5 March 2022 09:00 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/18 "2022-03-05T09:00:15Z")

</div>

Hi Riddhi

> [@Riddhi186182](#):
>
> ariable voltage power bank with the capability to provide up to 20v seems to be sending only 5v to the DFRobot Motor Driver. Any suggestions?

If we knew exactly what that was we might be able to suggest something.

Power bank or power supply. This subject has come up so many times over the past couple of years there should be a heading for it at the top of the page.  
They are 2 entirely different devices. The power bank is good for charging phones and similar battery operated devices while a power supply does what it says, supplies power.

I am not going into it all again. Suggest you apply some filtering on a search and try to find previous posts on the subject.

For your application I believe you should be using a power SUPPLY.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)\
**Post date:** [5 March 2022 21:51 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/19 "2022-03-05T21:51:33Z")

</div>

> [@Riddhi186182](#):
>
> However, the variable voltage power bank with the capability to provide up to 20v seems to be sending only 5v to the DFRobot Motor Driver. Any suggestions?

How have you configured the power bank? What have you set the voltage to? Note that the PiJuice has a maximum allowable supply voltage at J4 of 10v - that is not enough to drive the motor reliably, so it might not be possible to power both the PiJuice and the motor from one source.

---

<div class="post-metadata">

**Author:** ![Riddhi186182](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Riddhi186182](https://forum.core-electronics.com.au/u/Riddhi186182)\
**Post date:** [28 March 2022 09:23 UTC](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108/20 "2022-03-28T09:23:54Z")

</div>

I learned it hard way that the actual usb source power is not more than 5v. I then got an external power source that supplies 9v. It is surely supplying 9v, however, as soon as i plug the external power source to my motor driver, it also supplies power to Pi zero and every other hat in the mix. Any way to stop the motor driver from doing this?

Btw, i am using this motor driver: [DC Motor Driver HAT(V1.0) | DFRobot DFR0592 | Core Electronics Australia](https://core-electronics.com.au/dc-motor-driver-hat-v1-0.html)

[Next page](https://forum.core-electronics.com.au/t/motor-driver-for-pi-zero/13108.md?page=2)
