Hello! Unfortunately, my micro servo responds inconsistently to commands. Is there a way to fix the micro servo?
It worked perfectly fine for a year, but just recently it has become “lazy” and only drives to the correct position sometimes. In this video, the intended operation is for the servo to move about 15 degrees counterclockwise while I am holding down the push button. As you can see, it gets stuck at random, and I need to manually wiggle the gear to free it. Then, it works for a few more commands until it gets stuck again.
I didn’t change anything about my circuit since I first started using it, and the circuit works perfectly when I swap my old servo for a new one. Therefore, the issue must be my old micro servo itself; I’m hoping there’s a way to fix it.
Specifications:
-Microcontroller: Elegoo Arduino Uno R3
-Micro Servo: SMRAZA Micro Servo 9g S51
-Power Source for Servo: USB+5V
"stuck" could be the way your button is configured and your button-press routine with a bouncing button press telling the servo to start/stop many times. Here is a simulation of reading button presses... buttonPress - Wokwi ESP32, STM32, Arduino Simulator
Your code solution could be better, but the main fault is the cheap servo. It lasted a year? That's it's life. Either replace with more every year, or buy higher quality like those used in 3D printers.
#include <Servo.h> // Library for controlling servos
Servo Servo1; // Establish the Jaw servo and its default value.
int Button = A0; // Button is in port A0.
int valButton = 0; // Set initial value of button to 0
void setup() {
Serial.begin(9600);
Servo1.attach(10);
delay(1000);
}
void loop(){
valButton = digitalRead(Button);
if (valButton<1){
Servo1.write(90);
}
if (valButton>0){
Servo1.write(105);
}
}
Thank you for the suggestion. There weren't any plastic bits inside my servo or any loose parts. The servo may unfortunately be beyond its useful life.
No, I have two separate USB 5V power sources, one for the Arduino and one for the servo. Replacing my servo with a new one, it worked perfectly. I believe the issue may simply be that my servo is at the end of its useful life.
Yeah, I just thought I'd check first to see if anyone had experience fixing this type of servo before I rejected it. It's not a big deal to replace it, but if its possible to repair it instead I would prefer that.
All plastic shrinks over time. Now that you know how to take it apart, lubricate all the bearing points with some type of wax, I use lip balm, Chapstick, etc. Even vasoline will work. See if that makes a difference.