Control of a wheeled robot using Wifly module

General Description This project aims to control a wheeled robot over a RJ45 ethernet connection or a Wifi connection using a Wifly network module. The two DC motors are driven by vnh3sp30 H-bridge drivers. A client computer would use a PHP front-end UI to send commands in UDP packets to the mbed board through the ethernet interface.

Ethernet UDP code A thread was used to set up the Ethernet connection on the mbed and get an IP address. If the connection was successful, the current date and time along with the MAC and IP address assigned to the mbed will be displayed on the TextLCD screen. Next the mbed's IP address can be set as the a target IP address in the PHP user interface. This enables the client running the PHP GUI to send commands to the mbed using a UDP sockets.

The mbed will use the 4th element of a the UDP packet to determine the command to be sent to the two H-bridges that run the left and right motors. For example, Depending on whether buffer[4] is a '+' or '-', the speed of both motors is either increased or decreased by 10%, if buffer[4] is set to 'B', 'L' or 'R', the motors will be stopped, make the robot turn right, left or move in the current direction at full speed, respectively.

Interfacing with the mbed

The sparkfun breakout board for the RJ45 Ethernet MDI Jack was used with the following pin mappings between the mbed and the Ethernet adapter.

/media/uploads/jgeorge33/ethernetmdi.jpg

MbedEthernet MDI adapter
TD+P1
TD-P2
RD+P7
RD-P8

/media/uploads/jgeorge33/hbridge.jpg /media/uploads/jgeorge33/dcmotor.jpg

The pinout mappings for each of the two H-bridge drivers and the DC motors are as follows:

MbedH-bridgePower supplyMotor
Vu+5V (IN)
GNDGND
revIN_B
fwdIN_A
Pull highEN_A
Pull highEN_B
pwmPWM
+ motor supply+ power supply
GND- motor supplyGround of power supply
OUT AMotor wire 1
OUT BMotor wire 2

Specifically, for motor 1: p21, p7, p8 represented the pwm, fwd, rev pins on the mbed and for motor 2, p22, p5, p6; represented the pwm, fwd, rev pins on the mbed.

Finally the pinout mappings for the TextLCD screen is as follows:

Mbed pinsGND5VGND via 1k resistorp15GNDp16p17p18p19p20
TextLCD pinsGNDVCCVORSRWED4D5D6D7

Wifly RN-131G is an 802.11G networking module which we used to connect to GTother network of Georgia Tech. There are several mobile wireless applications of this module so by following this page for the correct connections and configuration, one will be able to do a lot of cool stuff with this module.


Please log in to post comments.