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

Multiple VNH5019 with Arduino Mega 2560


Hi to all in the Forum,

That is now my first post here, but I got a lot of good information and read interesting discussions

I want to use two or more VNH5019 for a submarine ROV unit. To prevent the whining sound coming from the motors, I want to use them all in ultrasonic PWM mode. (I think you can imaging who horrible it would be underwater for divers near by)

Okay, due to some limitations it is not possible to get them all in ultrasonic PWM by the pololu library. To use them as stackable shields is also not possible.

But I did not find any shield or breakout which will be usable. So I think it is time to talk about to use some external parts to solve this problem.

First idea was to use a TLC5940 Breakout.(like sparkfun.com/products/10616?)
Advantage: It has 16 channels, there is a ready to use library and can handle up to 30MHz grayscale clock frequency.
Disadvantages: Need several connections and some Timers for grayscale frequency and blanking the output.

My second Idea was to use the PCA9685 (a 16 channel 12bit PWM/Servo driver) like the one from Adafruit. (adafruit.com/products/815)

Advantage: Use a I2C bus connection and therefore it needs only 2 connections for the PWM scale for up to 16 channels.
Disadvantages: Adjustable frequency PWM only up to about 1.6 KHz, so not enough for ultrasonic.

Now I would like to discuss with you about your experiences or ideas. Has any of you ever run multiple motors with VNH5019 at 20kHz? How do you have solved this.

Sorry for my spelling errors, I do not write in English so often.



The Arduino Mega should be able to support four 20kHz timers. We wrote a modified version of our Dual VNH5019 Motor Driver Library for the Arduino Mega that lets you drive motors at 20kHz PWM. You can find it here.

However, if you are looking to control 4 motors from a single Arduino Mega, I recommend that you check the Arduino forum for more information:



Hi Jonathan,

Ok, I had hoped to start here is a larger discussion about multi motor projects.

Because my real intention was to show Pololu that there is eventually an interest to develop a shield which can be controlled up to 16 engines with 20kHz PWM. And this with less contacts between Arduino and shield.

So I was thinking of something like the TLC5940 with an external frequency and a mux to reduce the number of current-sense voltage output and the directions signals.

With something like this everyone will be able to develop mutil use VHN5019 projekt in ultrasonic mode.

But thank you very much for your answers. It seem to me, that not many people looks for a stuff like this. I can understand that this is not interest for Pololu if there is not market for it.

I have solved my 4 motor problem with the Arduino forum.



I’m glad to hear you were able to solve your problem.

Thank you for letting us know about your project. What do you need that many motors for? For a project like that, I would recommend using our motor controllers rather than Arduino shields. They can be chained together to enable control of many motors, and each has an on-board microcontroller that takes care of implementing advanced functionality that would be difficult for the Arduino to manage on such a scale. For example, you control eight of our Qik 2s12v10 dual serial motor controllers from a single Arduino serial bus to give you independent control of up to 16 relatively beefy motors (and all with 20 kHz PWMs).

- Ben


Hello Ben,

thank you for your info. I didn’t recognized that the Qik series controller are chainable. (my fault, i did not have read the whole manual)
Okay with this it is much easier to control multi motors and by a serial bus speed of 115.2 kbps the controlling will be also fast enough.

But one thing gave me great consider when I was looking for a suitable controller. What happens when communication breaks down or a motor gets faulty? Now I also have seen, that the reaction by several different errors can be set to whatever the project need.

wow, I really had should read the instructions better.