MG995 Tower Pro not working on NodeMCU V2 ESP8266

Hi. I have watched this video NodeMCU ESP8266 control Hobby Servo Tutorial - YouTube and copy his codes. But my servo is not working. He is using 4 1.5V AAA Battery while mine uses a powerbank with 5V output 1A. Is this okay? or do i really need to use 4 1.5V AAA battery ? new to arduino. thank you for your reply.

The following is my codes.

#include <Servo.h>

Servo servo;

void setup() {

servo.attach(5); //D1
servo.write(0);

delay(2000);

}

void loop() {

for(int i =0 ; i < 180 ; i+=10 ){
servo.write(i);
delay(1000);
}

for(int i =180 ; i > 0 ; i-=10 ){
servo.write(i);
delay(1000);
}

}

The following are my connections.

MG995
Orange D1 of NodeMCU V2 ESP8266
Red Positve of the power bank
Brown Negative of the powerbank and Ground of NodeMCU V2 ESP8266

What exactly does "is not working" mean? Does the servo move at all? It will be very slow because you're only moving 10 degrees a second so nearly 20 seconds from one end to the other.

That is a powerful servo and works better off 6V but even with only 5V and 1A I would expect it to do something. Is it wired directly to the powerbank or through a breadboard? Breadboards and other things like croc clips or twisting wires together can cause problems when connecting things that need fairly high currents.

Steve

Thank you for your reply. I don't use a breadboard. I use a cut usb cable connector and splice the red wire of the cable to the red of the MG995 Tower Pro, then black of the usb cable connector to the brown of the MG995 Tower Pro and Ground of NodeMCU V2 ESP9266. That is all. Thank You. It's not working at all. I'm waiting even for a small tick for almost ten minutes

@kalabwa

Other post/duplicate DELETED Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Please READ THIS POST to help you get the best out of the forum.

Bob.

sorry mr moderator. i have made it work. the problem is you also need supply of power to the nodemcu v2 esp8266. the problem now is the heating problem but i guess it's a different topic. then again. thank you all ^_^