Wifi Controled ShadowBot

This page describes how to use a wifi module to communicate with a modified shadowbot. Halleffect sensors are utilized to allow the robot to move in a straight line to counter manufacturing differences between motor output. The robot creates a simple webpage with a text field for input. The Input from the form is saved to an SD card and then parsed by the robot to determine which directions it should travel and for what duration. The commands are sent in a simple format the direction(f,b,r,l) then the duration (0-9), or s to play a sound. The webpage has an example default value stored for directions that can be sent to test the system. When sending custom commands always remember to end the custom direction with the word stop, the code looks for that sub string to determine the length of commands sent.This is parsed and used to command the wheels which correct for motor output during forward and backward sessions to get the robot going in a straight line.

Webpage

It is important to note that the length of the direction information sent to the robot has a limit that is defined in the code so although a large number of directions may be sent it is possible to hit a breaking point. This limit can be changed easily by just increasing the buffer in the code.

The final assembly up on some blocks

Parts List

For convinced the parts list is provided including wiring diagrams.

Speaker

https://www.sparkfun.com/products/11089

https://www.sparkfun.com/products/11044

Wiring

mbedTPA2005D1Speaker
gndpwr - (gnd), in -
Vout (3.3V) or 5Vpwr +
p18 D/Ain +
out ++
out --
Any DigitalOut px(optional)S (low for shutdown)

SD Card

https://www.sparkfun.com/products/544

Wiring

mbedMicroSD Breakout
8CS
5DI
VOUTVCC
7SCK
GNDGND
6D)
CD

WIFI

https://www.adafruit.com/product/2471

Huzzahmbed LPC1768External 5V DC supply >=500MA
gndgndgnd
TXRX - p27
RXTX - p28
V+5VDC
RSTp26 (optional)

Dual Motor

https://www.pololu.com/product/713

Wiring

mbedDual H-bridgeRobot DC motorsBattery
VinVmot+
GndGnd-
VoutVcc
p21PWMB
p22BIN2
p23BIN1
p24AIN1
p25AIN2
p26PWMA
Vout/STBY
A01left-red
A02left-blk
B02right-blk
B01right-red

Wheel Encoder Kit

https://www.sparkfun.com/products/12629

Wiring

mbedEncoder LeftEncoder Right
p19Data Wire
p20Data Wire
VoutRed WireRed Wire
GNDBlack WireBlack Wire

Shadow Chassis

The shadow bot was built as per the assembly instructions included bellow the instructions also go into detail on how to integrate the wheel encoder kit into the chassis. The breadboard used is stuck to the top back of the chassis the second breadboard is only attached to the first breadboard to allow the chassis to be used again in the future for different design projects.

https://learn.sparkfun.com/tutorials/assembly-guide-for-redbot-with-shadow-chassis/all

/media/uploads/fischk08/2016-11-02_10.47.16.jpg

Code

All of the code developed was modified from various projects that implemented integration of individual components into the mbed.

Import programWiFI_Robot

Simple code to control a robot by sending it a string of commands over wifi


Please log in to post comments.