NodeMCU Web Server Controlled Servo Motor

Updated: Jul 2, 2021

Here to show you how to build a web server with the ESP8266 12E that controls the shaft’s position of a servo motor using a Web page slider.

Connecting the Servo Motor to the ESP8266

Servo motors have three wires: power, ground, and signal.

Servo Wire Color


GND-Black, or brown

Signal-Yellow, orange, or white

When using a small servo like the SG90 as shown in the figure below, you can power it directly from the ESP8266.

If you’re using a small servo like the SG90, you need to connect:

  • GND -> ESP8266 GND pin;