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

Thread Starter

pradel

Joined Dec 21, 2020
8
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 ?

Thanks in advance !
 

eetech00

Joined Jun 8, 2013
3,856
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 ?

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

MaxHeadRoom

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

Thread Starter

pradel

Joined Dec 21, 2020
8
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.
 

Thread Starter

pradel

Joined Dec 21, 2020
8
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
4,174
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
9,156
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)?
 

Thread Starter

pradel

Joined Dec 21, 2020
8
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.
IMG_20201223_162010.jpg
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);
}
Thanks all for your help
 
Top