# Control a 7.5V servomotor using a 5V PWM (from Arduino)

Joined Dec 21, 2020
4
Hello,

I am facing a problem on my personnal project. Usually, I control a 5V servomotor using an Arduino delivering a 5V PWM without any problem.
Now, I am using a different servomotor with a 7.5V power supply (an external power supply, ground interconnected), and it doesn't work.
I assume that the problem is because the PWM isn't at the same voltage than the power supply of the motor. I thought about using a MOSFET to "pull-up" the PWM's voltage from 5 to 7.5V but I don't really know how to do that and whether it is a good idea or not.

Any idea ?

#### eetech00

Joined Jun 8, 2013
2,493
Hello,

I am facing a problem on my personnal project. Usually, I control a 5V servomotor using an Arduino delivering a 5V PWM without any problem.
Now, I am using a different servomotor with a 7.5V power supply (an external power supply, ground interconnected), and it doesn't work.
I assume that the problem is because the PWM isn't at the same voltage than the power supply of the motor. I thought about using a MOSFET to "pull-up" the PWM's voltage from 5 to 7.5V but I don't really know how to do that and whether it is a good idea or not.

Any idea ?

Are you currently driving the servo motor directly with the Arduino?
If not, post your driver schematic.

Joined Jul 18, 2013
23,371
The important number with stepper motors is the current value which should be held constant throughout the whole RPM range.
Max..

Joined Dec 21, 2020
4
Thank you for your answers. Honnestly, I am not sure to understand what you both said. The schematic is simple, Vcc and Gnd from servomotor are both connected to an external power supply (7.5V) and PWM from servomotor is connected directly to an Arduino PWM pin. And both GND are connected. Sorry if I misunderstood something, I am a beginner.

#### djsfantasi

Joined Apr 11, 2010
7,763
The important number with stepper motors is the current value which should be held constant throughout the whole RPM range.
Max..
That’s good information if the TS was using a stepper motor. His problem is with a (RC?) servo motor.

Joined Jul 18, 2013
23,371
That’s good information if the TS was using a stepper motor. His problem is with a (RC?) servo motor.
Max.

Joined Dec 21, 2020
4
I tried to use a MOSFET to step-up the voltage but the motor doesn't react as it should do. I checked the voltage after the mosfet and it seems not to switch fast enough. I searched for a solution on the Internet and didn't find anything except for DC motors, but this solution used a MOSFET and as I said it doesn't work with my servomotor (SG90).
Any idea ?

#### LesJones

Joined Jan 8, 2017
3,290
Post the schematic of how you connected the mosfet. I suspect that you have inverted the signal in your mosfet. Did you remember to invert the signal in the software to take into account any inversion in the mosfet driver. (Assuming it does invert which we will only know when you post the schematic.) I am assuming this is a normal model servo that uses pulse width to control the position.

Les.

#### djsfantasi

Joined Apr 11, 2010
7,763
Post the schematic of how you connected the mosfet. I suspect that you have inverted the signal in your mosfet. Did you remember to invert the signal in the software to take into account any inversion in the mosfet driver. (Assuming it does invert which we will only know when you post the schematic.) I am assuming this is a normal model servo that uses pulse width to control the position.

Les.
There likely isn’t a way to invert the signal. If he is using the Arduino, I suspect he is using the Arduino library, servo.h. Control of the signal is embedded in that libraries functions.

But he may have implemented the PWM control himself. In that case, it may be possible to invert the signal.

He could add an NPN BJT in front of the MOSFET or even a second logic level N channel MOSFET.

@pradel, does your sketch use the Arduino servo library? Can you post your code (between code tags, [C0DE] and [/C0DE], using an O instead of the zero)?

Joined Dec 21, 2020
4
I suspect that you have inverted the signal in your mosfet.
You were right, the signal was inverted. I tried using a bipolar to correct the invertion of the signal and it looks like it is working ! Here is my schematic in case someone is interested.

I suspect that you have inverted the signal in your mosfet.
Yes you are right, it works but I put it after the mosfet. Does it change something ?

does your sketch use the Arduino servo library? Can you post your code
Yes, I was using it just for my tests. Here is the code I used:
Code:
#include <Servo.h>

#define SERVO_PIN 5

Servo servo;

void setup(){
servo.attach(SERVO_PIN);
}

void loop(){
servo.write(180);
delay(500);
servo.write(0);
delay(500);
}