Hello all!
I'm not sure where this topic belongs but I wanted to ask if anyone has any idea whats's going on here? I ordered these motors off of amazon https://www.amazon.com/gp/product/B01GN07I5U/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 and wanted to use them for a "useless box" project. I will upload the code I used as well (not mine but I did change the PWM values to fit my needs). After 5 minutes of use the motor, no matter which one, would just stop working. Granted some lasted more than others but that is to be expected. I did my own research as well as open one motor up and found nothing out of the ordinary except the potentiometer getting extremely hot which may indicate it is cutting all the power from reaching the motor itself ( I measured voltage across the board and found everything past the resistor had no electricity running through it). I am using an ICR 18350 600mAH 7.4v battery (even tried two in series with no success because I thought maybe the battery ran out too fast due to the motors) and the schematic below for my project. I made sure every connection was secured and the arduino uploaded with the right code. Like I said, I am almost positive it has something to do with hardware of the motor and not software or any other factor i mentioned before. I just want to know how to fix the problem without having to sacrifice too much time and effort for the same outcome (ie replacing ALL the potentoimeters on each motor just for it to degrade again) so an alternative is my goal here. I would also like to know what casues the problem, I would love to use this as a learning lesson for future documentation/ research. If anyone needs for info please do not hesitate to ask, I appreciate all the comments and look forward to reading them!

My code: added led for a purple light instead of a basic one.
original code:
I'm not sure where this topic belongs but I wanted to ask if anyone has any idea whats's going on here? I ordered these motors off of amazon https://www.amazon.com/gp/product/B01GN07I5U/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 and wanted to use them for a "useless box" project. I will upload the code I used as well (not mine but I did change the PWM values to fit my needs). After 5 minutes of use the motor, no matter which one, would just stop working. Granted some lasted more than others but that is to be expected. I did my own research as well as open one motor up and found nothing out of the ordinary except the potentiometer getting extremely hot which may indicate it is cutting all the power from reaching the motor itself ( I measured voltage across the board and found everything past the resistor had no electricity running through it). I am using an ICR 18350 600mAH 7.4v battery (even tried two in series with no success because I thought maybe the battery ran out too fast due to the motors) and the schematic below for my project. I made sure every connection was secured and the arduino uploaded with the right code. Like I said, I am almost positive it has something to do with hardware of the motor and not software or any other factor i mentioned before. I just want to know how to fix the problem without having to sacrifice too much time and effort for the same outcome (ie replacing ALL the potentoimeters on each motor just for it to degrade again) so an alternative is my goal here. I would also like to know what casues the problem, I would love to use this as a learning lesson for future documentation/ research. If anyone needs for info please do not hesitate to ask, I appreciate all the comments and look forward to reading them!

My code: added led for a purple light instead of a basic one.
Code:
#include <Servo.h> //包含舵机库
Servo handServo; //定义舵机名称
Servo boxServo;
int switchStatus=0, action=1, vot, randNumber=0; //定义基本整形变量用于存储开关状态 电池电压 开关次数和种类
//定义LED引脚
const int frontSwitchPin = 2;
const int handServoPin = 5;
const int boxServoPin = 6;
int red_light_pin= 11;
int green_light_pin = 10;
int blue_light_pin = 9;
void setup()
{
Serial.begin(9600);
pinMode(red_light_pin, OUTPUT);
pinMode(green_light_pin, OUTPUT);
pinMode(blue_light_pin, OUTPUT);
handServo.attach(handServoPin); //定义舵机信号引脚
boxServo.attach(boxServoPin);
handServo.write(0); //舵机复位
boxServo.write(90);
}
void loop()
{
RGB_color(255, 0, 255);
switchStatus = digitalRead(frontSwitchPin); //读取开关状态
if (switchStatus == LOW){ //若开关被按下
if (action == 1)
{
Serial.println("Action 1"); //第一种 慢慢抬头看 慢慢关开关
for (int i = 90; i <= 180; i++)
{
boxServo.write(i);
delay(5);
}
for (int i = 0; i >= 110; i--)
{
handServo.write(i);
delay(20);
}
delay(1000);
handServo.write(110);
delay(200);
for (int i = 110; i <=0; i++)
{
handServo.write(i);
delay(20);
}
for (int i = 180; i >= 90; i--)
{
boxServo.write(i);
delay(20);
}
action++;
}
else if (action == 2)
{
Serial.println("Action 2"); //第二种 迅速关开关 事后探头看
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(550);
handServo.write(110);
delay(550);
handServo.write(0);
delay(550);
boxServo.write(90);
delay(1500);
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(3000);
boxServo.write(90);
action++;
}
else if (action == 3)
{
Serial.println("Action 3"); //第三种 抬头看一下 然后迅速关开关
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(1000);
boxServo.write(90);
delay(2000);
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
handServo.write(110);
delay(550);
handServo.write(0);
delay(500);
boxServo.write(90);
action++;
}
else if (action == 4)
{
Serial.println("Action 4"); //第四种 慢慢抬头看 手碰开关 然后迅速关开关
for (int i = 90; i <= 180; i++)
{
boxServo.write(i);
delay(20);
}
for (int i = 0; i >= 110; i--)
{
handServo.write(i);
delay(20);
}
delay(2000);
handServo.write(110);
delay(200);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 5)
{
Serial.println("Action 5"); //第五种 抬头看然后挥手抗议
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
handServo.write(100);
delay(550);
handServo.write(75);
delay(200);
handServo.write(100);
delay(200);
handServo.write(75);
delay(200);
handServo.write(100);
delay(200);
handServo.write(75);
delay(200);
handServo.write(100);
delay(200);
handServo.write(75);
delay(200);
handServo.write(100);
delay(200);
handServo.write(75);
delay(200);
handServo.write(100);
delay(2000);
handServo.write(110);
delay(400);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 6)
{
Serial.println("Action 6");
//第六种 抬头看然后摔盒子 然后关开关 然后探头看
for (int i = 90; i <180; i++)
{
boxServo.write(i);
delay(20);
}
delay(1000);
for (int i = 0; i < 12; i++)
{
for (int j = 90; j <= 180; j++){
boxServo.write(j);
delay(6);
}
delay(200);
}
for (int i = 0; i >= 110; i--)
{
handServo.write(i);
delay(30);
}
handServo.write(110);
delay(400);
handServo.write(0);
delay(400);
boxServo.write(90);
delay(1500);
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(3000);
boxServo.write(100);
action++;
}
else if (action == 7)
{
Serial.println("Action 7"); //第七种 关上开关然后摔盒子
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(400);
handServo.write(110);
delay(1000);
for (int i = 0; i < 6; i++)
{
for (int j = 90; j <= 180; j++){
boxServo.write(j);
delay(6);
}
delay(200);
}
delay(500);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 8)
{
Serial.println("Action 8"); //第八种 关上开关然后举手抗议
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
handServo.write(110);
delay(2000);
for (int i = 0; i < 7; i++)
{
handServo.write(80);
delay(100);
handServo.write(115);
delay(100);
}
delay(500);
handServo.write(0);
delay(1000);
boxServo.write(90);
action++;
}
else if (action == 9)
{
Serial.println("Action 9"); //第九种 露半个头非常生气 慢慢慢慢地关上开关 然后探半个头看
for (int i = 90; i <= 175; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
boxServo.write(180);
for (int i = 0; i >=110; i--)
{
handServo.write(i);
delay(40);
}
delay(500);
handServo.write(110);
delay(200);
for (int i = 110; i <=0; i++)
{
handServo.write(i);
delay(40);
}
boxServo.write(90);
delay(2000);
boxServo.write(150);
delay(3000);
boxServo.write(90);
action++;
}
else if (action == 10)
{
Serial.println("Action 10"); //第十种 慢慢探半个头看 然后摔盒子 然后迅速关开关
for (int i = 90; i <= 170; i++)
{
boxServo.write(i);
delay(100);
}
delay(1000);
for (int i = 0; i < 10; i++)
{
for (int j = 90; j <= 160; j++){
boxServo.write(j);
delay(6);
}
delay(100);
}
boxServo.write(180);
delay(100);
handServo.write(110);
delay(650);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 11)
{
Serial.println("Action 11"); //第十一种 迅速探头关开关 然后慢速举手抗议 然后再探头按住开挂
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
handServo.write(110);
delay(2000);
for (int i = 0; i < 3; i++)
{
handServo.write(100);
delay(200);
handServo.write(75);
delay(200);
}
delay(1500);
handServo.write(0);
delay(400);
boxServo.write(90);
delay(1500);
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
handServo.write(110);
delay(3000);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 12)
{
Serial.println("Action 12"); //第十二种 慢慢地露出头 非常生气 慢慢慢慢地关上开关 然后迅速缩回去
for (int i = 90; i <= 180; i++)
{
boxServo.write(i);
delay(50);
}
delay(1000);
for (int i = 0; i >= 110; i--)
{
handServo.write(i);
delay(50);
}
delay(2000);
handServo.write(110);
delay(200);
handServo.write(0);
delay(400);
boxServo.write(90);
action++;
}
else if (action == 13)
{
Serial.println("Action 13"); //第十三种 迅速探头 挥手假装要关开关 然后重复几次 关上开关然后缩回去
for (int i = 90; i <= 180; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
for (int i = 180; i >= 70; i--)
{
handServo.write(i);
delay(40);
}
for (int i = 0; i < 3; i++)
{
handServo.write(115);
delay(200);
handServo.write(95);
delay(800);
}
handServo.write(110);
delay(2000);
handServo.write(0);
delay(500);
boxServo.write(90);
action++;
}
else if (action == 14)
{
Serial.println("Action 14"); //第十四种 很生气 露出半个头盯着你 然后迅速关掉开关 然后继续盯着你
for (int i = 90; i <= 170; i++){
boxServo.write(i);
delay(6);
}
delay(4000);
boxServo.write(180);
handServo.write(110);
delay(650);
handServo.write(0);
delay(500);
boxServo.write(170);
delay(4000);
boxServo.write(90);
action++;
}
else if (action == 15)
{
Serial.println("Action 15"); //第十五种 很生气 露出半个头然后整个头然后又露剩半个头重复 然后慢慢关掉开关
for (int i = 90; i <= 170; i++){
boxServo.write(i);
delay(6);
}
delay(1000);
for (int i = 0; i < 3; i++)
{
for (int j = 90; j <= 170; j++){
boxServo.write(j);
delay(50);
}
for (int j = 170; j >= 90; j--)
{
boxServo.write(j);
delay(50);
}
}
for (int j = 90; j <= 180; j++){
boxServo.write(j);
delay(50);
}
for (int i = 0; i >= 110; i--)
{
handServo.write(i);
delay(40);
}
delay(1000);
handServo.write(110);
delay(400);
handServo.write(0);
delay(400);
boxServo.write(90);
action = 1;
}
}
}
void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
{
analogWrite(red_light_pin, red_light_value);
analogWrite(green_light_pin, green_light_value);
analogWrite(blue_light_pin, blue_light_value);
}
original code:
Code:
#include <Servo.h> //包含舵机库
Servo handServo; //定义舵机名称
Servo boxServo;
int switchStatus=0, action=1, vot, randNumber=0; //定义基本整形变量用于存储开关状态 电池电压 开关次数和种类
const int ledPin = 13; //定义LED引脚
const int frontSwitchPin = 2;
const int handServoPin = 5;
const int boxServoPin = 6;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT); //定义LED引脚为输出
digitalWrite(ledPin,HIGH);
handServo.attach(handServoPin); //定义舵机信号引脚
boxServo.attach(boxServoPin);
handServo.write(180); //舵机复位
boxServo.write(70);
//randomSeed(analogRead(0));
}
void loop()
{
switchStatus = digitalRead(frontSwitchPin); //读取开关状态
//action = random(1,16);
if (switchStatus == LOW){ //若开关被按下
if (action == 1)
{
Serial.println("Action 1"); //第一种 慢慢抬头看 慢慢关开关
for (int i = 70; i <= 110; i++)
{
boxServo.write(i);
delay(20);
}
for (int i = 180; i >= 35; i--)
{
handServo.write(i);
delay(20);
}
delay(1000);
handServo.write(26);
delay(200);
for (int i = 26; i <=180; i++)
{
handServo.write(i);
delay(20);
}
for (int i = 110; i >= 70; i--)
{
boxServo.write(i);
delay(20);
}
action++;
}
else if (action == 2)
{
Serial.println("Action 2"); //第二种 迅速关开关 事后探头看
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(550);
handServo.write(26);
delay(550);
handServo.write(180);
delay(550);
boxServo.write(70);
delay(1500);
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(3000);
boxServo.write(70);
action++;
}
else if (action == 3)
{
Serial.println("Action 3"); //第三种 抬头看一下 然后迅速关开关
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(1000);
boxServo.write(70);
delay(2000);
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
handServo.write(26);
delay(550);
handServo.write(180);
delay(500);
boxServo.write(70);
action++;
}
else if (action == 4)
{
Serial.println("Action 4"); //第四种 慢慢抬头看 手碰开关 然后迅速关开关
for (int i = 70; i <= 110; i++)
{
boxServo.write(i);
delay(20);
}
for (int i = 180; i >= 35; i--)
{
handServo.write(i);
delay(20);
}
delay(2000);
handServo.write(26);
delay(200);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 5)
{
Serial.println("Action 5"); //第五种 抬头看然后挥手抗议
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
handServo.write(65);
delay(550);
handServo.write(40);
delay(200);
handServo.write(65);
delay(200);
handServo.write(40);
delay(200);
handServo.write(65);
delay(200);
handServo.write(40);
delay(200);
handServo.write(65);
delay(200);
handServo.write(40);
delay(200);
handServo.write(65);
delay(200);
handServo.write(40);
delay(200);
handServo.write(65);
delay(2000);
handServo.write(26);
delay(400);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 6)
{
Serial.println("Action 6");
//第六种 抬头看然后摔盒子 然后关开关 然后探头看
for (int i = 70; i <110; i++)
{
boxServo.write(i);
delay(20);
}
delay(1000);
for (int i = 0; i < 12; i++)
{
for (int j = 70; j <= 110; j++){
boxServo.write(j);
delay(6);
}
delay(200);
}
for (int i = 180; i >= 35; i--)
{
handServo.write(i);
delay(30);
}
handServo.write(26);
delay(400);
handServo.write(180);
delay(400);
boxServo.write(70);
delay(1500);
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(3000);
boxServo.write(80);
action++;
}
else if (action == 7)
{
Serial.println("Action 7"); //第七种 关上开关然后摔盒子
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(400);
handServo.write(26);
delay(1000);
for (int i = 0; i < 6; i++)
{
for (int j = 70; j <= 110; j++){
boxServo.write(j);
delay(6);
}
delay(200);
}
delay(500);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 8)
{
Serial.println("Action 8"); //第八种 关上开关然后举手抗议
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
handServo.write(26);
delay(2000);
for (int i = 0; i < 7; i++)
{
handServo.write(75);
delay(100);
handServo.write(40);
delay(100);
}
delay(500);
handServo.write(180);
delay(1000);
boxServo.write(70);
action++;
}
else if (action == 9)
{
Serial.println("Action 9"); //第九种 露半个头非常生气 慢慢慢慢地关上开关 然后探半个头看
for (int i = 70; i <= 105; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
boxServo.write(110);
for (int i = 180; i >=35; i--)
{
handServo.write(i);
delay(40);
}
delay(500);
handServo.write(26);
delay(200);
for (int i = 26; i <=180; i++)
{
handServo.write(i);
delay(40);
}
boxServo.write(70);
delay(2000);
boxServo.write(100);
delay(3000);
boxServo.write(70);
action++;
}
else if (action == 10)
{
Serial.println("Action 10"); //第十种 慢慢探半个头看 然后摔盒子 然后迅速关开关
for (int i = 70; i <= 105; i++)
{
boxServo.write(i);
delay(100);
}
delay(1000);
for (int i = 0; i < 10; i++)
{
for (int j = 70; j <= 100; j++){
boxServo.write(j);
delay(6);
}
delay(100);
}
boxServo.write(110);
delay(100);
handServo.write(26);
delay(650);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 11)
{
Serial.println("Action 11"); //第十一种 迅速探头关开关 然后慢速举手抗议 然后再探头按住开挂
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
handServo.write(26);
delay(2000);
for (int i = 0; i < 3; i++)
{
handServo.write(65);
delay(200);
handServo.write(40);
delay(200);
}
delay(1500);
handServo.write(180);
delay(400);
boxServo.write(70);
delay(1500);
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
handServo.write(26);
delay(3000);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 12)
{
Serial.println("Action 12"); //第十二种 慢慢地露出头 非常生气 慢慢慢慢地关上开关 然后迅速缩回去
for (int i = 70; i <= 110; i++)
{
boxServo.write(i);
delay(50);
}
delay(1000);
for (int i = 180; i >= 26; i--)
{
handServo.write(i);
delay(50);
}
delay(2000);
handServo.write(26);
delay(200);
handServo.write(180);
delay(400);
boxServo.write(70);
action++;
}
else if (action == 13)
{
Serial.println("Action 13"); //第十三种 迅速探头 挥手假装要关开关 然后重复几次 关上开关然后缩回去
for (int i = 70; i <= 110; i++){
boxServo.write(i);
delay(6);
}
delay(2000);
for (int i = 180; i >= 60; i--)
{
handServo.write(i);
delay(40);
}
for (int i = 0; i < 3; i++)
{
handServo.write(60);
delay(200);
handServo.write(40);
delay(800);
}
handServo.write(26);
delay(2000);
handServo.write(180);
delay(500);
boxServo.write(70);
action++;
}
else if (action == 14)
{
Serial.println("Action 14"); //第十四种 很生气 露出半个头盯着你 然后迅速关掉开关 然后继续盯着你
for (int i = 70; i <= 105; i++){
boxServo.write(i);
delay(6);
}
delay(4000);
boxServo.write(110);
handServo.write(26);
delay(650);
handServo.write(180);
delay(500);
boxServo.write(100);
delay(4000);
boxServo.write(70);
action++;
}
else if (action == 15)
{
Serial.println("Action 15"); //第十五种 很生气 露出半个头然后整个头然后又露剩半个头重复 然后慢慢关掉开关
for (int i = 70; i <= 105; i++){
boxServo.write(i);
delay(6);
}
delay(1000);
for (int i = 0; i < 3; i++)
{
for (int j = 70; j <= 105; j++){
boxServo.write(j);
delay(50);
}
for (int j = 105; j >= 70; j--)
{
boxServo.write(j);
delay(50);
}
}
for (int j = 70; j <= 110; j++){
boxServo.write(j);
delay(50);
}
for (int i = 180; i >= 35; i--)
{
handServo.write(i);
delay(40);
}
delay(1000);
handServo.write(26);
delay(400);
handServo.write(180);
delay(400);
boxServo.write(70);
action = 1;
}
}
}