Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Interfacing 24v21 Pololu G2 MD


Hello Community,
I would like to use the 24v21 G2 Motor Driver https://www.pololu.com/product/29951 with the microcontroller Particle Electron https://store.particle.io/collections/electron to control this Linear Actuator http://de.rs-online.com/web/p/elektrische-miniatur-betatigungselemente-stange/9181344/1.

Is there any Library using the hardware abstract layer of the Pololu Motor Driver?
If not how can I interface the motor Driver.

Any help would be greatly appreciated.



We do not know of any libraries for our motor drivers for that platform. The basic interface for the driver board is pretty straight forward. If the PWM pin is high, the driver will send power to the motor and if it is low, the power will be disconnected. To drive the motor at less than full power, the PWM pin is toggled between high and low at a relatively high frequency (several hundred hertz to a few 10’s of kHz).

Changing the state of the DIR pin changes the direction of rotation of the attached motor when the PWM pin is high.

You can read more about the functionality of all the input and output pins on the motor driver in the “Pinout” section of the G2 motor driver’s product page.



Thank you for the great describtion.
Your answer is very helpful and extensive.:+1:
I’ll try it


@nathanb I have tried as you described. I have set the PWM pin to high and also tried it with the DIR PIN. I have checked with my multimeter, neither OUTA nor OUTB pin getting a high signal.

Did I something wrong?



We generally do not expect header pins inserted through the board into a breadboard like that to work. You should try soldering the pins or using minigrabber style test clips to make your connections if you want them to be more temporary.



I soldered the pins and still get no high signal on the OUT Pins.
Is it possible my motor driver is faulty :confused:


We have not eliminated the possibility of a faulty driver yet, but we test every board, so it seems more likely there is something else causing the problem.

Can you post pictures that show your soldered connections? What is the voltage of the battery you’re using for the motor driver? The motor driver has a minimum input voltage of 6.5V. When you tested OUTA and OUTB with the multimeter, were you measuring the voltage between those two pins or between each of those pins and GND?



I measure the voltage between each of those pins and GND but it works now.
The mistake was the voltage of the battery was too low.
The battery I had been using was throttled from 12v to 5v. And as you said, the motor driver needs at least 6.5v.

Thank you so much