MBED Wifi Controlled Robot

Alexander Newton / Chris Price

This was a project for a Georgia Tech ECE 4180 Lab. We set out to use an mbed with a capacitive touch keypad to control an mbed powered robot over wifi. The robot we used was the shadow robot kit from Sparkfun. We used a small MOSFET H-bridge to control the motors and a ESP8266 wifi module. On the controller side we used the same wifi module as well as a capacitive touch number pad for controlling the robots direction. As you can see in the pictures below the robot breadboard also has an IMU chip installed. We had intended to include PID control using the IMU to make the robot driving more accurate, however our priority was the wifi communication.

Demonstration:

A basic overview of the wifi communication is that both mbeds are connected to the same wifi network (GTother in our case), then the robot sets up a web server to constantly receive data. The controller then connects to this web server and sends specific commands, such as forward, backwards, left, and right.

/media/uploads/anewton8/img_0934.jpg

Again, the IMU is not implemented in the included code, but could be relatively easily.

/media/uploads/anewton8/img_0938.jpg

The wifi module is the black IC seen towards the front of the robot. It is important to note that in our particular case the mbed 3.3V Vout could NOT provide enough current to run the wifi module reliably. On both the controller and the robot we had to use an external power source for the wifi module. You can see on the robot I created a simple voltage divider. This is not the most ideal solution since if using batteries the voltage change could be significant and the IC may not receive clean power, a better solution would be a dedicated 3.3v regulator. However, for bench testing we were using an external power supply that gave a very constant 5 volts so the voltage divider was sufficient.

Also, as can be seen on the robot board 330uF decoupling caps were used on both the 3.3v circuit and the 5v circuit. This is incredibly important when running the motors and the electronics from the same power supply because the motors we cause a lot of interference in the power lines and the decoupling caps will help to smooth that out to some degree.

/media/uploads/anewton8/img_0935.jpg

/media/uploads/anewton8/img_0937.jpg

The circuitry for the control board was relatively simple, since it was just the number pad and the wifi module. Once again note the decoupling cap for the wifi module and the wires exiting the bottom left of the picture going to an external 3.3v power supply.

Two notes about controlling the robot:

  1. The http GET doesn't close properly, so you may need to hit the capactitive touch screen a few times to get it working
  2. Controls for the touch screen:
Capacttive NumberDirectionDuration
2Forward1 second
5Backward1 second
7Left0.5 seconds
10Right0.5 seconds

Below is the main.cpp for the controller code:

Import programECE_4180_Lab_4

Code to run the controller for the wifi robot

Pinouts for the capacitive touch controller are below: ESP8266 WiFi Controller

ESP8266mbed LPC1768330uf cap
VccExternal 3.3V Power Supply+
GndGnd-
Resetp29
RXp28-TX
TXp27-RX
CH_PDVout

MPR121 I2C Capacitive Touch Sensor

mbedTouch Keypad4.7K ohm pullup to 3.3V?
GndGnd
p9SDAYes
p10SCLYes
p26IRQ
Vout(3.3V)Vcc

And the robot webserver code:

Robot pinouts: ESP8266 WiFi Controller

ESP8266mbed LPC1768330uf cap
VccExternal 3.3V Power Supply+
GndGnd-
Resetp29
RXp28-TX
TXp27-RX
CH_PDVout
H-bridgeMBEDMotors
GNDGND
VCCVOUT
AO1Right Red
AO2Right Black
BO2Left Black
BO1Left Red
VMOT5V(ext)
GNDGND
PWMAP26
AIN2P25
AIN1P24
STBYVU
BIN1P23
BIN2P22
PWMBP21
GNDGND

NOTE: A voltage divider was used to power both the motor and the WiFi module off of 5V wall-power.


Please log in to post comments.