ESP8266 Wifi Controlled Robot

Introduction

This project is a demonstration of controlling a robot via a webpage hosted on the ESP8266 wifi chip. The program uses the LPC1786 chip. The robot has two motors connected to an H-Bridge to move the robot and a servo to move the IR sensor. Both of the motors and the servo can be controlled via the webpage hosted on the ESP8266 chip. The speaker (amplified using a Class D audio amplifier) outputs a sound when the IR sensor detects a close object.

Components

Instructions

  1. Hook up the wires using the Wiring section and the Pictures as reference.
  2. Alter the program to use the SSID and password of your local wifi connection.
  3. Open TeraTerm or RealTerm application on your computer and select the mbed virtual com port. This must be monitored to receive the IP address when the ESP8266 chip connects to the wifi.
  4. Compile the program and download it on to the mbed.
  5. Wait about 30 seconds until the IP address shows up over the serial port. The MAC address is also returned if it is needed for authentication.
  6. Connect to the webpage to control the robot by typing in the IP address returned by the program over the USB virtual serial connection. You must be on the same local wifi connection.
  7. Control the robot by pressing the buttons on the web page.

The image below shows the web page used to control the robot.

/media/uploads/K2Silver/webpage.png

Wiring

H Bridge and Motors

H Bridge Pinmbed PinMotor Wires
GNDGnd
VCCVout
AO1Left Motor Red
AO2Left Motor Black
BO2Right Motor Black
BO1Right Motor Red
VMOTExternal Supply (5V)
GNDGnd
PWMAp22
AIN2p12
AIN1p11
STBYVout
BIN1p13
BIN2p14
PWMBp21
GNDGnd

ESP8266 Wifi Chip

ESP8266 Pinmbed Pin
GNDgnd
VBatExternal Supply (5V)
RXp28
TXp27
RSTp26

Class D Audio Amplifier and Speaker

TPA2005D1mbed PinSpeaker
pwr -, in -Gnd
pwr +Vout
in +p24
out ++
out --

Servo

Servo Pinmbed Pin
PWM Controlp23
GNDGnd
VCCExternal Supply (5V)

IR Sensor

IR Sensormbed Pin
Analog Signal (Yellow)p20
GND (Black)Gnd
VCC (Red)Vu

Pictures

/media/uploads/K2Silver/wifi_robot_class_d_amplifier_speaker.jpg /media/uploads/K2Silver/wifi_robot_esp8266_hbridge.jpg /media/uploads/K2Silver/wifi_robot_ir_servo.jpg /media/uploads/K2Silver/wifi_robot_mbed.jpg /media/uploads/K2Silver/wifi_robot_top.jpg

Code Example

Import programESP8266_wifi_robot

Wifi controlled robot that uses ESP8266 wifi chip.

Demonstration Video

The video below demonstrates the following: 1. PWM sound output change when the IR sensor detects a close object. 2. Moves motors so that the robot moves forwards, backwards, left, and right


1 comment on ESP8266 Wifi Controlled Robot:

31 Oct 2016

.

Please log in to post comments.