Using the DRV8835 with a Raspberry Pi Zero W

Hi, I’m trying to use a DRV8835 with a Raspberry Pi Zero W to drive 2 DC motors.
I’ve tested the motors by connecting them directly to the battery pack and they work fine, however when I try and use them with the Pi, DRV8835 and this Python code: (using pigpio)

import time
import pigpio
MOTOR_A1 = 25
MOTOR_A2 = 18

#connect to pigpiod daemon
pi = pigpio.pi()

# pi set frequency
pi.set_PWM_frequency(MOTOR_A2, 100)

pi.set_servo_pulsewidth(MOTOR_A1, 0)


…the code executes without error, but the motors do not move. Any help would be greatly appreciated.

My current wiring setup:

MD -> not connected
VM -> not connected

DRV8835 -> Pi Zero W
AIN1 -> BCM 25 (Physical pin 22)
AIN2 -> BCM 18 (Physical pin 12)
BIN1 ->BCM 23 (Physical pin 16)
BIN2 -> BCM 24 (Physical pin 18)
VCC -> 3v3 Power (Physical pin 1)
GND (VCC SIDE) -> Ground 6

DRV8835 -> Motors/Battery
AO1 -> Motor 1: Positive
AO2 -> Motor 1: Negative
BO1 -> Motor 2: Positive
BO2 -> Motor 2: Negative
VIN -> 4x AA Batteries: Positive
GND (VIN SIDE) -> 4x AA Batteries: Negative

Hi Daniel!

It would be really helpful if you had a photo of the wiring or a Fritzing picture of how its wired up just so its a little easier to understand. It looks like you need to provide logic power. How are you powering the Pi Zero? If you are powering the motor driver directly off the Pi perhaps it isn’t getting enough amps.


Try something like this for your code:

or you could adapt this motor driver library to work for you:

Give that a shot and get back to me

Sorry for the late reply.

I followed this DRV8833 tutorial for my current setup:

While it is for the older DRV8833 chip, I changed a couple of things to try and make it work. I just cannot for the life of me find a tutorial on using the DRV8835 with the Raspberry Pi.

I’m pretty sure that I’m providing logic power through the VCC pin on the DRV8835. I’m powering the motors off of 4x AA batteries, and I’m powering the Pi off of an iPad wall charger. As for using RPi.PWM, I’m not exactly sure how to make it work with two motors. I can’t find any schematics for the DRV8835 HAT thing that the library you linked to is for. Any idea what pins I would use?

Below are photos of my wiring setup:

Hey Daniel,

Could you make a Fritzing drawing and export it as an image to share so I can see how everything is hooked up? It’s pretty hard to tell in the photos what is connected to what.