MG995 servo motor only rotate in one direction

So I am using a 360-degree servo motor for my project. Based on the Internet and this forum, writing a value of between 0 and about 90 should rotate it in one direction, and a value of 90 and 180 will rotate it in the other direction.

However, when I tried the code below, it just rotated in the same direction. Does anybody know the reason behind this? Thanks in advance.

#include <ESP32Servo.h>

Servo myservo;

void setup()
{
  myservo.attach(26);
  myservo.write(90);
}

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

Get familiar with servo and servo motor. They are 2 different kind of devices.

Please post a link to the device that you have

That seems to be a standard RC servo rather than a 360 degree, continuous rotation "servo" that you say you are using. Is that your actual servo or does it just have the same name ?

How is the servo powered in your project ?

Well, I bought it from Taobao and the description is all Chinese...
Maybe it is a cheap knock-off version of the original one
But that is indeed a 360 degree continuous rotation motor
(I should not use the word "servo")

I powered it using the 3.3V pin on the ESP32 microcontrollers
The manual of the product said it can be powered as low as 3V and up to 8V
If the voltage is not enough, will it change the logic of the rotation?

Could you elaborate further?

Can you please post a link ?

That does not sound like a very good idea. Are you sure that the "servo" is not taking too much current and causing the processor to reset ? Add some print statements to the sketch showing what it is writing to the "servo"

Insufficient.
The power should not be less than 5V.
The signal should not be less than 3V.

https://e.tb.cn/h.TRKGv8MiCdd8lZf?tk=Jio3e149Abf

You need to login in to see the detail tho
Really annoying...

void loop()
{
  myservo.write(0);
  delay(500);
  Serial.println("1");
  myservo.write(180);
  delay(500);
  Serial.println("2");
}


The loop has been correctly executed?

From the webpage you gave the link to:
There are many counterfeit servos of TowerPro from China dealers selling on eBay, Amazon and Alibaba websites.

For ¥3.9 it has to be a fake

Oh that 3.9¥ price tag is a clickbait, the actual price is 45¥, I agree it is fake tho


That would be a very strange way to use a continuous rotation "servo", particularly given this description

Linear servo MG995 servo modified linear reciprocating motion multi-stroke high tension torque telescopic rod customization


I bought this one

Reply #5 and #6 just did it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.