Servo motor mg665 w arduin not working

So basically, my project is all about detection. When my IR sensor detects something, the servo motor should rotate. But seems like just the IR sensor is working, and idk what happened to servo. I have power adapter 5V 3a also for external power

:thinking:

  • Always show us a good schematic of your proposed circuit. Show us good images of your ‘actual’ wiring.

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

shoot, i dont have a phone to take a pic of my project, ill just describe it then

i attached the servo on arduino uno r3 with these:

red wire- 5V pin
brown wire- gnd
yellow wire- any pin but i chose 9 pin

and my power adapter is also attached to arduino, giving the power supply.

#include <Servo.h>

Servo myServo; 

void setup() {
  myServo.attach(9);  
}

void loop() {
  myServo.write(0);   
  delay(1000);        

  myServo.write(90);  
  delay(1000);        

  myServo.write(180); 
  delay(1000);        
}
  • Use a DMM to confirm the servo power supply is 5 to 6v DC.

  • Confirm the Arduino 5v power is 5v.

  • Confirm the continuity between the servo GND and Arduino GND is 0 Ω.

  • Try a different servo and wires.

still not working :frowning:

  • Draw us a schematic with Paint or similar.

  • Borrow a camera.

arduino ide said problem uploading to board

but ir sensor is working

  • Can you upload the simple Blink sketch to see if a LED on pin 9 toggles ?

Your topic does not indicate a problem with the Arduino Command Line Tools and therefore has been moved to a more suitable location on the forum.