# 3.3V input to 5V output for motor control

I wanted to connect my DC motor to raspberry PI and control it with PWM pin. Problem is that gpio pins are 3.3V in PI and I have pololu 10:1 DC motor which I would like to run on 5V(to make it faster).

How can I convert those 3.3V to 5V for motor? Can I just simply connect PWM and GND pins to motor to steer it?

• You have another problem: PWM pin makes few mA current while your motor requires much higher current. You need to make a kind of simple amplifier. The simplest one is just one MOSFET. However, it inverts the control signal. Is it OK for you? May 23 '16 at 10:43
• By invert you mean that 80% full pwm will be 20% right? If that's the case then it's not a problem.
– Thun
May 23 '16 at 10:45
• @master: Using an N-channel MOSFET as a low side switch will allow current through the motor when the PWM signal is high which, I believe, was the original intent. May 23 '16 at 10:56
• I agree, was thinking about the voltage... May 23 '16 at 11:05

All you need is a N channel FET to act like a low side switch:

You have to make sure the FET has sufficiently low on resistance with 3.3 V gate drive. The example I show is 80 mΩ maximum with 2.5 V gate drive.

You didn't say what the maximum motor current is, but you have to make sure the FET can handle it. Also check the FETs dissipation at the maximum current.

Note the diode. It is not optional. It protects the FET against the inductive kickback from the motor when switched off, which happens every PWM cycle. It also allows current to continue flowing during the off phase of the PWM, which is important for efficiency.

• Can I use motor driver for this like TB6612FNG? Instead of building my own
– Thun
May 25 '16 at 9:53
1. Connect one of the motor's terminals to +5V, and the other end to the drain of a logic-level N-channel MOSFET rated to carry about twice the motor's stall current.
2. Connect the raspberry PI's ground and the MOSFET's source to the 5 volt supply ground.
3. Connect the raspberry PI PWM signal to the MOSFET gate through a 100 ohm resistor.