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
- Sharp IR Sensor
- H Bridge
- Class D Audio Amplifier
- Speaker
- Servo
- ESP8266 Huzzah Breakout Board
- Shadow Chassis
Instructions
- Hook up the wires using the Wiring section and the Pictures as reference.
- Alter the program to use the SSID and password of your local wifi connection.
- 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.
- Compile the program and download it on to the mbed.
- 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.
- 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.
- Control the robot by pressing the buttons on the web page.
The image below shows the web page used to control the robot.
Wiring
H Bridge and Motors
H Bridge Pin | mbed Pin | Motor Wires |
---|---|---|
GND | Gnd | |
VCC | Vout | |
AO1 | Left Motor Red | |
AO2 | Left Motor Black | |
BO2 | Right Motor Black | |
BO1 | Right Motor Red | |
VMOT | External Supply (5V) | |
GND | Gnd | |
PWMA | p22 | |
AIN2 | p12 | |
AIN1 | p11 | |
STBY | Vout | |
BIN1 | p13 | |
BIN2 | p14 | |
PWMB | p21 | |
GND | Gnd |
ESP8266 Wifi Chip
ESP8266 Pin | mbed Pin |
---|---|
GND | gnd |
VBat | External Supply (5V) |
RX | p28 |
TX | p27 |
RST | p26 |
Class D Audio Amplifier and Speaker
TPA2005D1 | mbed Pin | Speaker |
---|---|---|
pwr -, in - | Gnd | |
pwr + | Vout | |
in + | p24 | |
out + | + | |
out - | - |
Servo
Servo Pin | mbed Pin |
---|---|
PWM Control | p23 |
GND | Gnd |
VCC | External Supply (5V) |
IR Sensor
IR Sensor | mbed Pin |
---|---|
Analog Signal (Yellow) | p20 |
GND (Black) | Gnd |
VCC (Red) | Vu |
Pictures
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:
Please log in to post comments.
.