ECE 477 Digital Systems Senior Design Project Rev 8/11

Homework 3: Design Constraint Analysis and Component Selection Rationale

Team Code Name: RevGeo Multipurpose Puzzle Box Group No. 11

Team Member Completing This Homework: Joshua Marchi

E-mail Address of Team Member:

Evaluation:

SCORE

/

DESCRIPTION

10 /

Excellent – among the best papers submitted for this assignment. Very few corrections needed for version submitted in Final Report.

9 /

Very good – all requirements aptly met. Minor additions/corrections needed for version submitted in Final Report.

8 /

Good – all requirements considered and addressed. Several noteworthy additions/corrections needed for version submitted in Final Report.

7 /

Average – all requirements basically met, but some revisions in content should be made for the version submitted in the Final Report.

6 /

Marginal – all requirements met at a nominal level. Significant revisions in content should be made for the version submitted in the Final Report.

* /

Below the passing threshold – major revisions required to meet report requirements at a nominal level. Revise and resubmit.

* Resubmissions are due within one week of the date of return, and will be awarded a score of “6” provided all report requirements have been met at a nominal level.

Comments:

1.0  Introduction

The RevGeo, or “Reverse Geocache”, is a multipurpose puzzle box to be used for recreational purposes. Whereas normal geocaching involves searching for hidden objects at specific GPS locations, the RevGeo will consist of a sealed, locked box given to a user, and will only open after one or more predetermined GPS locations have been visited. The RevGeo box will direct the user to the next location by means of GPS coordinates or text displayed on an LCD screen, and by a ring of LEDs acting as a digital compass, either pointing towards magnetic north or the direction of travel to reach the next destination. The GPS coordinate route data will be stored on a MicroSD card located inside the box, and will be able to be taken out and reprogrammed by a PC, ensuring a high replay value for the device. Lastly, an RFID “master key” interface will be developed, providing a “backdoor” method to unlock the box without finishing the current puzzle route.

PSSCs

1.  An ability to obtain and decode global positioning data in order to verify if current location matches pre-determined desired location.

2.  An ability to utilize accelerometer and magnetometer data to determine a compass heading with tilt compensation.

3.  An ability to access and interpret files located on a MicroSD card.

4.  An ability to display information to the user via an LCD display.

5.  An ability to identify an RFID tag using an RFID reader.

2.0  Design Constraint Analysis

When designing the RevGeo box, there are a few major constraints that need to be taken into consideration. First of all, the computation speed of the chosen microcontroller needs to allow for real-time analysis of GPS coordinate data, as well as accelerometer and magnetometer data used for tilt-compensation calculations. Next, the RevGeo design needs to ensure that communication between the microcontroller and the various peripheral modules occurs in a timely fashion, allowing the microcontroller to interact with the GPS module, RFID reader, compass module, MicroSD card, and LCD screen without any contention. Third, the RevGeo will be a battery powered device, meaning that a low-power design is a must, as well as the implementation of a rechargeable battery as the power source. Finally, the packaging of the RevGeo needs to be small and light enough to be carried with ease, while still providing adequate empty space inside the box to store whatever “treasure” the user is to find at the completion of the route.

2.1  Computation Requirements

There are a few main computation responsibilities of the main microcontroller, the first of which involves coordinate analysis from the GPS module. This includes parsing the data received from the module, determining if the current location matches the stored location for the desired route, and calculating distance to the target if the target has not yet been reached. GPS data will be automatically sent from the GPS module at a rate of 1Hz, meaning that all calculations for a given set of coordinates must be completed within 1 second. This is more than ample time for all calculations, and no major concerns are related to this time constraint. Secondly, the microcontroller will be in charge of receiving accelerometer and magnetometer data, and calculating a tilt-compensated compass heading from these values. These calculations involve a large amount of floating point multiplication and division operations as well as trig functions, which will be implemented through lookup tables in flash memory. Although the amount of calculations needed to determine each compass heading is substantial, the update frequency of the heading does not have to be large. A frequency on the order of 5-10 updates per second would be more than enough for this project, and would be easily satisfiable with the chosen hardware. Lastly, in order to interface with the MicroSD card, the microcontroller must utilize a file system library, which requires a large amount of Flash (~12KB) and RAM (~2KB). There is no real critical time constraint associated with this action, and as long as the chosen hardware has ample memory, there should be no concerns related to this interface.

2.2  Interface Requirements

The microcontroller for the RevGeo will be in charge of interfacing with numerous peripherals. 4 SPI pins will be used for the MicroSD card interface, using 3.3V logic. The Compass module will be interfaced to using 2 I2C pins using 3.3V logic, and the GPS module will be interfaced to using 2 UART pins using 3.3V logic. Another 2 UART pins will interface to a UART to USB bridge using 3.3V logic, allowing for debug messages to be sent to a PC for logging and analysis. The RFID receiver will also be interfaced to using 2 UART pins, but since the RFID module operates on 5V, two logic level converters will need to be used for these lines to translate between 3.3V and 5V logic. One PWM pin will be used to control the position of a servo locking mechanism for the box, and another PWM pin will be used to output audio to a speaker. Due to the large amount of current needed to power the speaker, which may range from 10mA to 150mA depending on the duty cycle of the PWM signal, a simple driving circuit using a BJT will be implemented. The LCD display chosen for this project uses a parallel interface, which will be controlled using GPIO pins. Depending on whether or not a shift register is used for the data pins, 6-12 GPIO pins will be used for LCD control. The LCD also operates on 5V, so logic level converters will be needed for these signals to translate between 3.3V and 5V logic. 12 LEDs will be used for the compass ring display, and a shift register will most likely be used to reduce the GPIO pins required to 2. Using a current limiting resistor, the current used by the LEDs should not exceed 10mA, which is an acceptable amount of current to source from the shift register pins. Finally, 1-2 pushbuttons will be used for user interface, and will use GPIO pins as well.

2.3  On-Chip Peripheral Requirements

Since the microcontroller for the RevGeo needs to interface with many different off-chip peripherals, many serial communication channels are required. 3 UART channels will be required to communicate with the GPS module, RFID receiver, and the UART to USB bridge used for debugging purposes. One SPI channel will be used for the MicroSD interface, and one I2C channel will be used for the accelerometer/magnetometer module. One PWM channel will be needed to output tones to a speaker, and another PWM channel will be used to control the position of the servo locking mechanism. Lastly, at least 2 output compare timer channels will be used. One timer will be used to regularly poll the compass module to obtain accelerometer/magnetometer data, and another will be needed to control strobe rates to the LCD screen.

2.4  Off-Chip Peripheral Requirements

As described earlier, one of the main components in the RevGeo design is the off-chip GPS module. The module will automatically attempt to lock onto GPS satellites, and once locked, will output GPS coordinates to the microcontroller via UART at a frequency of 1Hz. Another off-chip peripheral is the digital compass module, consisting of a 3-axis accelerometer, and 3-axis magnetometer. When polled, the compass module will transmit sensor readings to the microcontroller via I2C. The microcontroller can then analyze these readings to determine a compass heading with tilt compensation. An RFID reader will be used to detect the presence of any RFID tag that is brought within close proximity of the RevGeo box. When an RFID tag is detected, the reader will output the tag ID to the microcontroller via UART. An interrupt will be generated, and the microcontroller will be able to analyze the tag data to determine if the ID matches the “master key” assigned to the box. Finally, an off-chip UART to USB bridge, such as the FT232[1], will be required to allow debug messages to be viewed on a PC. This will provide an easy method for verification of calculated sensor data, and will allow “print” statements to be used to indicate when specific events occur on the microcontroller.

2.5  Power Constraints

As the RevGeo will be a battery powered device, several power constraints are immediately associated with the design. First of all, the battery will need to be small and lightweight, since it will be located inside of the puzzle box, and must not significantly contribute to the weight of the entire device. The battery must be able to last for several hours to allow for extended continuous usage of the RevGeo without interruption. A 3.6V, 3300mAh lithium-ion polymer battery has been chosen for the design, and based on initial maximum current draw estimates of 400-500mA, the RevGeo should be able to operate for well over 5 hours on a single charge. A charging IC will also be integrated into the design, allowing for recharging of the device without requiring the battery to be removed from the box. Although most of the modules on the device (Micro, GPS, MicroSD, Compass) operate on 3.3V, the LCD and RFID reader require a 5V source. To solve this issue, two switching regulators will be used to regulate both voltage levels on the single PCB. These regulators each have a 93% efficiency characteristic and should not dramatically increase the power usage of the system.

2.6  Packaging Constraints

The RevGeo is designed for outdoor recreational activity, and therefore needs to be highly durable. Since it will be carried by an individual for extended periods of time, it needs to be small enough to hold comfortably, and light enough to not cause excessive strain to the user. It also needs to be able to receive a GPS signal from within the box through a small antenna, and therefore cannot be made of material that interferes with GPS. The box chosen for the design is the Pelican 1150 Case[2], a highly durable plastic container, with 9-1/4" x 7-9/16" x 4-3/8” outside dimensions. This will provide adequate room for design components, and also plenty of empty space to store whatever “treasure” is hidden in the box.

2.7  Cost Constraints

Currently, there is no widely manufactured product similar to the RevGeo, so there is no direct competition related to pricing. However, for the initial prototype, the total cost is estimated to be around $240 (see the Parts List in Appendix A). Part of this cost is to be attributed to the use of breakout boards for a few of the off-chip peripherals, which reduces the complexity of the design and eases testing and debugging. If the RevGeo were to be manufactured, the cost would be able to be greatly reduced by incorporating the breakout board components into the single PCB, as well as purchasing modules at discounted “bulk” price. Incorporating these changes, the total cost of the design would likely be reduced to well under $200.

3.0  Component Selection Rationale

One of the biggest design decisions for the RevGeo was the selection of the microcontroller. As described above, some of the major requirements of the microcontroller were to have at least 3 UART channels, at least 1 SPI channel, and at least 1 I2C channel. In addition, the microcontroller needed to have around 256KB of Flash, 16KB of RAM, and a comprehensive library to interface with a MicroSD card. The first microcontroller choice was the PIC24FJ256GA106 16-bit device by Microchip[3]. In addition to having 256KB Flash, 16K RAM, 4 UART, 3 SPI, and 3 I2C channels, it also supports Microchip’s Memory Disk Drive File System Library, which allows for easy interfacing with SD cards. The second microcontroller that was considered was the MC9S12E256 16-bit device by Freescale Semiconductor[4]. This microcontroller also has 256KB Flash, and 16KB RAM, but only has 3 UART, 1 SPI, and 1 I2C channel. Also, while SD card interfacing is possible via software libraries, the libraries have all been created by 3rd party developers, with no official support from Freescale. For this reason, and the fact that the on-chip serial communication modules would barely satisfy the design constraints leaving no additional channels available, the PIC was chosen over the Freescale for the RevGeo design.