You are on page 1of 3

WEB CONTROLLED SERVO MOTOR USING

ARDUINO – IOT PROJECT

SYNOPSIS
Normally, in order to control a Servo Motor with Arduino (for example), all
you need is a Servo Motor, Arduino and a Potentiometer. Depending on the
position of the POT, the PWM value of the Servo Motor input changes and
consequently the position of the Servo Motor’s shaft changes.

In case of a Web Controlled Servo Motor using ESP8266, Arduino still


drives the Servo Motor but the input isn’t from a POT but a Web Page we created.

The slider in the web page sends the angle values and is received by the
ESP8266, which acts as a Web Server. The ESP8266, upon receiving the value,
transmits it to the Arduino, which then changes the position of the Servo Motor
according to the value.

One important thing to remember here is that both the Server and client
should be on the same network i.e. the ESP8266, which acts as the Server, and the
Computer (or a Mobile Phone), which is the client, must be connected to the same
WiFi network.

COMPONENTS REQUIRED
 Arduino Uno

 Servo motor (sg90)

 Esp8266

 Esp-01 adapter

 Connecting wires

 Hardware

 Circuit Diagram
CIRCUIT DIAGRAM

The circuit diagram for Web Controlled Servo using ESP8266 WiFi Module
is given in the image below.

DESIGN OF THE CIRCUIT

The main program will be for Arduino and it will be responsible for
everything i.e. connecting ESP8266 to WiFi, getting information for ESP8266 and
finally controlling the Servo.

In order to enable Serial Communication between Arduino and ESP8266,


Pin 2 and 3 of Arduino are enabled as SoftwareSerial (in the program). Here, Pin 2
acts as RX and Pin 3 as TX. So, connect TX of ESP8266 to Pin 2 of Arduino and
RX of ESP8266 to Pin 3.
Since, ESP8266 cannot tolerate 5V, the TX of Arduino (pin 3) is first level
shifted using two resistors (1 KΩ and 2.2 KΩ) and then connected to RX of
ESP8266.

The VCC, CH_PD and GND pins of ESP8266 are connected to 3.3V, 3.3V
and GND respectively. The RESET pin of ESP is connected to a button where the
other end of the button is connected to GND.

Pin 9 of Arduino will provide the necessary PWM signal to the Servo
(Orange). Its other pins are power supply pins and are connected to 5V and GND
(Red and Brown).

You might also like