I am new to the Raspberry PI and I don't have strong background in electricity (but I'm here to learn).

The problem:

I have a dc motor that works at 12V, and I'm trying to let it run with the raspi through a motor driver based on M51660L IC. I control the motor driver with the gpio PWM. I know that I need the motor driver because otherwise I can damage the pi. I can power the pi both with the USB cable from a computer and with a 5V power supply (I'd prefer to use the power supply and not the USB from the computer). For the PWM I used the python code from this blog post.

The problem is that, even if in the code I set the low PWM duty cycle the motor runs slow.

I think that the problem is that the PWM out from the pi is at 3.3V, while it should be 5V.


If I attach the motor directly to the 12V power supply (without the pi), it goes faster (and I want it to go fast).

I tried to connect the 12V directly to the motor driver, and the motor driver was suddenly gets very hot, so I disconnect it, because I think that the motor driver can handle till 6V.

I have also a Darlington Array ULN2003A, but I'm not sure if I can use it (as far as I understood it can be used for switching the motor direction only).

The question:

Is my idea true? The motor does not get the maximum speed because I should drive the motor driver with 5V instead of 3.3V?

What can I do? I'd like to spend as less as possible because I have already spend more then I thought to drive a DC motor from the pi (I bought the motor, the motor driver and the Darlington array).

  • \$\begingroup\$ If you read the datasheet, M51660L's absolute maximum voltage is 7 volts, 4.8 recommended. You have most likely destroyed the chip. \$\endgroup\$ – HL-SDK Sep 13 '13 at 18:56

If the Motor driver accepts 5V PWM, you can use a level-shifter like this. Connect 3.3V and 5V to the level-shifter VCCA and VCCB. Then, connect the R-Pi PWM output to 3.3V side, connect motor driver to 5V side of the shifter.


You are correct, you need to increase the voltage to the motor. A ULN2003 can be used for this as long as the current draw of the motor is lower then the IC can handle. You can find datasheets for your part at www.digikey.com.

To get top speed out of the motor, use +12V. Don't forget to connect the clamp diode pin to +12V as well. The diode clamp pin should be connected to the same voltage you are running the motor with. Connecting this pin to a lower voltage power rail will burn out the ULN2003 and the Raspberry Pi.

  • 1
    \$\begingroup\$ There is no vcc connection for the ULN2003 -- they are NPN devices. \$\endgroup\$ – HL-SDK Sep 13 '13 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.