Drive a DC motor as the maximum speed with a Raspberry PI

3.3v5vdc motorpwmraspberry pi

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.

Trials

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).

Best Answer

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.