ECE 477 Digital Systems Senior Design Project Spring 2007

Homework 10: Software Design Considerations

Due: Friday, February 9, at NOON

Team Code Name: _____Smart-Shopper______Group No. __2____

Team Member Completing This Homework: ______Jeff Richards______

e-mail Address of Team Member: ___JLRICHAR___ @ purdue.edu

Evaluation:

Component/Criterion / Score / Multiplier / Points
Introduction & Summary / 0 1 2 3 4 5 6 7 8 9 10 / X 1
Software Design Considerations / 0 1 2 3 4 5 6 7 8 9 10 / X 3
Software Design Narrative / 0 1 2 3 4 5 6 7 8 9 10 / X 3
List of References / 0 1 2 3 4 5 6 7 8 9 10 / X 1
Appendices / 0 1 2 3 4 5 6 7 8 9 10 / X 1
Technical Writing Style / 0 1 2 3 4 5 6 7 8 9 10 / X 1
TOTAL

Comments:

Comments from the grader will be inserted here.

1.0  Introduction

The Smart-Shopper will attempt to keep track of its location in a given store and help guide the shopper along an ideal route as they collect items on their shopping list. No GPS type tracking system will be used to ensure the cart can always know its exact location. Will be using a method of checkpoints that allow us to know when we’ve reached specific points, primarily the end of each isle. With this in mind, it will be up to the software to collect all this data, keep track of the current location and heading of the cart, as well as display instructions to the user guiding them along their ideal path through the store.

2.0  Software Design Considerations

Our design will require many subroutines for all the devices we will be polling. However, most of these will be rather simple and shouldn’t require much processing power or extensive resources.

The most difficult task will be mapping our path through the store. On a modern pc this would ideally be done with a simple recursive routine that would potentially traverse every possible path in order to find the shortest. This is not an ideal approach for an imbedded system. For our purpose we will do numerous simple sorts, organizing the list of items by isle and then subsequently by their approximate location in the isle. This will allow us to map a simple route from one end of the store to the other, moving through any isle that contains a listed product and skipping those that don’t. Another reason for keeping this simple is to allow the cart to calculate a new path should a shopper detour from the original path while shopping. This will need to be done in a reasonable amount of time so as to provide quick results back to the shopper.

Another consideration is memory. The micro will need to know the location, a brief description, and rfid tag of thousands of items. This won’t be near as big of an issue for our model as it will be on a small scale basis; we won’t be demonstrating it with near the items you would find in your average retail store.

3.0  Software Design Narrative

Software for our project will be broken up into many different sections related to all the devices in use by our cart. These devices include the RFID reader, LCD display, Digital Compass and USB drive. We’ll be using specific modules to interact with each device, retrieving data and storing it in a form more appropriate for use by the other modules if necessary. We’ll also have additional sections for tasks such as sorting the list of items and generating a list of instructions.

scanTags:

This function, or module, will read all available tags in range of the RFID reader. While doing so it will compare them with a list of tags that have previously been scanned. If the tag is in this list it will skip it and continue on to the next tag. If the tag is new it will check if the tag is an item tag or location tag. This will determine whether it is added to the list of items in the cart or used to update the current location of the cart. This module has only been outlined in pseudo code.

updateLocation:

This module will first retrieve the last location tag scanned in, and check the current heading from the digital compass. It will then check if the location and heading are located along the ideal path that was already generated. If they are along this path and match the current instruction, this instruction will be checked off and a display module will be invoked to display the next instruction to the shopper. Should the location not be along our ideal path we’ll assume the shopper has either gotten lost or simply wondered off course. At this time we’ll call the generateList function to recompile and resort a new list of instructions based on the shoppers current location in the store. This module has only been outlined in pseudo code.

generateList:

The purpose of this module will be to generate a list of instructions based on the shoppers current location and their shopping list. In order for this to be done we’ll first call the getItems function to retrieve the list of items from a file on the USB drive and save them in a more appropriate format in the memory of the micro. The next step will be to sort the items. We’ll be using 2 simple sorts, sorting first by isle followed by the approximate location of each item in that isle. Once this is done we’ll generate a simple set of instructions for getting from each item to the next. This module has only been outlined in pseudo code.

getItems:

This module will be retrieving items from the users shopping list, located on a USB drive, and saving them in a more usable format in the memory of the microcontroller. The USB drive will contain a simple list of RFID tags that need retrieved. The first thing this module will do is search a database on the microcontroller for each of these tags. This database will contain information regarding the isle the item is located in, approximate placement in that isle along with a brief description of each item. For each item in the shopping list this information will be read into RAM for quicker access while sorting. This module has only been outlined in pseudo code.

sort:

After a list of items has been read into memory, this module will sort them. A simple sort will be used to sort the items first based on isle, and then by their approximate location in that isle. This module has only been outlined in pseudo code.

4.0  Summary

This report covers many of the design considerations we need to consider while designing our software, as well as general descriptions of the modules that will be used. Although we haven’t designed and tested any of the software for our project yet, this should provide a good basis to get started as well as give us some considerations to keep in mind.


List of References

[1]  None, we will be writing all the software for our project. No commercially available scripts or source libraries will be used.


Appendix A: Flowchart/Pseudo-code for Main Program

function pollingLoop()

scanTags();

getHeading();

function scanTags()

foreach tag

// Loop through list of tags in range

if (tag is new)

// Tag is new, not an item already in the cart

if (tag is a location tag)

// If tag is a location tag, update location

updateLocation();

else

// Tag is an item tag, add to cart

addItemToCart(tag);

function isNew(tag)

// Check whether the tag has just been placed in range of the reader

function updateLocation()

if (tag is in path)

// Move to next instruction

else

generateList();

function addItemToCart(tag)

// Adds newly found item to list of items in the cart

function getHeading()

// Get the current heading from the digital compass

if (compass heading has changed by > 10 degrees)

updateLocation();

function generateList()

getItems();

sort();

function getItems()

// Retrieves a list of items from the usb drive, and puts them in memory

function sort()

// Sorts the list of items in memory first by isle, then by location in each isle
Appendix B: Hierarchical Block Diagram of Code Organization

-6-