FINAL Report Topdog

download FINAL Report Topdog

of 41

Transcript of FINAL Report Topdog

  • 8/13/2019 FINAL Report Topdog

    1/41

    TAMU CPSC 483 Final Report 1/41

    Territory Tracking and

    Restriction System

    Final Report

    Top Dog TechnologiesDenise Cuppett

    John Kaczmarek

    Michael Stewart

    Chris Wesp

    Department of Computer Science

    Texas A&M University

    December 11, 2007

  • 8/13/2019 FINAL Report Topdog

    2/41

    TAMU CPSC 483 Final Report 2/41

    Table of Contents

    1 Executive summary .............................................................................................................................. 3

    2 Project background ............................................................................................................................... 3

    2.1 Needs statement ........................................................................................................................... 4

    2.2 Goal and objectives ..................................................................................................................... 4

    2.3 Design constraints and feasibility ................................................................................................ 5

    2.4 Literature and technical survey .................................................................................................... 6

    2.5 Evaluation of alternative solutions .............................................................................................. 7

    3 Final design .......................................................................................................................................... 8

    3.1 System description ....................................................................................................................... 8

    3.2 Complete module-wise specifications ......................................................................................... 9

    3.3 Approach for design validation ................................................................................................. 14

    4 Implementation notes ........................................................................................................................ 14

    5 Experimental results ........................................................................................................................... 24

    6 Users Manuals Needs statement ....................................................................................................... 24

    7 Course debriefing ............................................................................................................................... 32

    8 Budgets ............................................................................................................................................... 37

    9 Appendices ......................................................................................................................................... 39

  • 8/13/2019 FINAL Report Topdog

    3/41

    TAMU CPSC 483 Final Report 3/41

    1 Executive summaryThe Need, the Goal and the Objectives

    The current commercial products available for tracking and deterring pets from specific zones are verylimited in functionality. Current indoor deterrents involve a single setup to where a user can deter a pet

    from only one area, but there is no simple way to document how often the pet enters a zone or violates anoff-limit zone without constant supervision. Our intent is to correct this problem by developing a deterrentsystem that can have multiple off-limit locations and keep track of the time and place of every violationso that the user can be kept up to date with his or her pets habits. Multiple pets may be tracked by thesystem and all of the information can be viewed from one simple and easy to understand program. Ourgoal is to build this new tracking and deterrent system and make it not only cost-affordable, but effortlessto use and setup. The Territory Tracking and Restriction System that Top Dog Technologies isdeveloping will have higher quality than any other products currently on the market because there is aneed to have a deterrent and tracking system that monitors and documents when pets enter specific zones.

    Our team has researched the need of having a deterrent and tracking system and has defined the goal of itsnew product to create a receiver and transmitter pair that can record the general location of a pet and deterit from the off-limit areas. There has been a lot of research into the implementation of our project becausethere are some very important objectives that must be met to keep the product competitive in the market.The cost of the product is a very important aspect that must be kept to a minimum. The system mustfunction well in an indoor environment without hindering or harming animals or people. The system mustbe easy to set up, use and adjust. With these objectives in mind, Top Dog Technologies has decided to usecurrent RF technology to create the Territory Tracking and Restriction System.

    Final Design and Implementation

    The complete design of our project involves a series of RF receivers and transmitters. However, due tocertain restrictions we have created only one transmitter and receiver pair. The transmitter will be thedevice placed on or around the location a user wishes to make a zone of interest. On it there will be aninput that will allow the user to adjust the range of transmission, or deterrent settings. The range can be

    adjusted on transmitters by controlling the voltage input of a particular transmitter pin. The range canvary from a 1 foot radius to a 10 foot radius. This allows the system to track and potentially deter a petfrom different locations ranging from a small area to an entire room. The pet will be equipped with aspecialized collar that will have a receiver module on it. Whenever the receiver picks up the transmittedsignal, the transmitters id and a time stamp are stored to built-in memory. If the zone is designated as anoff-limit zone, the pet will be deterred until it leaves the zone. When the pets owner wishes to see therecorded tracking information, he or she can remove the device from the collar and connect it to acomputer via USB. An advanced software suite will display the information in a user friendly fashion.The ability to keep track of when and where your pet is violating off-limit zones will be a new technologyto the market. The user can look at all the documentation recorded for their pet and follow its progressover time.

    ResultsOur final result was one of success. Our team accomplished the goal of designing and building atransmitter and receiver that tracks zone breaches and signals if the zone is off limits. Our transmitter isfully built and runs off of AA batteries. It transmits a signal that includes its individual ID as well as thecurrent deterrent settings. The transmitter ID is hard-coded into the transmitter software, but is easilychanged at the time of programming. The deterrent settings are set on the fly by the end user withswitches corresponding to each pet collar. Another successfully implemented feature is the adjustabletransmitter range. The range at which the transmitter broadcasts the signal is fully adjustable using a dialwhich controls a potentiometer. This allows our system to achieve the result of different zone sizes.

  • 8/13/2019 FINAL Report Topdog

    4/41

    TAMU CPSC 483 Final Report 4/41

    The second successfully implemented component of our project is the receiver for the pet collar. Thecollar detects incoming signals and monitors for the beginning sequence of our transmitter. Once this ispicked up we can process it for both the deterrent setting corresponding to the pet collar and the ID of thetransmitter. The receiver module can then store the ID, the deter setting for the pet and a timestamp. Allof this data is then used later when the user connects the receiver module to a computer and runs the clientsoftware.

    Our third completed result was creating a software application that could intuitively show a pet owner thedata the system had recorded. The software downloads all of the stored information from the memory inthe pet collar module and automatically stores it. A user is also able to view this information throughseveral types of charts and graphs. The most useful of which is a timeline display of the zones and whichpets have entered them and when. The software program is also able to apply several filters to the data toallow the user to customize the information they see.

    The primary goals of the project were fully accomplished by our team and we are happy with the finalresults. Given more time there are a few improvements we would have liked to attempt. Primarily, wewould like to test and implement a multiple transmitter multiple receiver system. In which we couldovercome possible interference and fault recovery issues.

    Project Management Summary

    Overall our team experience was a very good one. We managed out time well getting benchmarksaccomplished quickly so that we would not be rushed to complete something. We had an effective teamleader that set goals and delegated responsibility. The team as a whole was able to get along well andutilize individual strengths to achieve results in a limited timeframe. Our team ran into several technicalissues throughout the project timeline, such as bad support issues, confusing sample code frommanufacturers, and hardware malfunctions. However, proper and effect team-based decision making wasused to overcome these challenges and in the end we succeeded.

    2 Project backgroundMany pet owners have trouble keeping their pets out of specific areas of their house. For instance, they

    may want to keep their pet off valuable furniture or keep it away from certain rooms and areas. When petowners are absent from their houses, they are unable to control where their pets are allowed to go. TheTerritory Tracking and Restriction System will allow owners to track and control their pets movement.When a pet enters user determined zones, the system will record that the pet entered the zone and deterthe pet if it is an off limit zone. This is done by putting RF transmitters in off limit zones, and giving thepet a collar with a RF receiver. When the pet enters a zone, the receiver will receive the RF signal fromthe transmitter containing the zone id and deterrent settings. The receiver then responds according to thesignal received, deterring if necessary. At any time, the owner can use a USB connection to get the datafrom the receiver to see what zones the pet has been entering and at what times.

    2.1 Needs statementThere is a need to have a pet deterrent system that tracks pet movement throughout the house 24/7 bymonitoring and documenting when a pet enters certain areas of interest and deters the pet when needed.

    2.2 Goal and objectivesThe goal our group has set for this project is to create a network of receivers and transmitters that canrecord the general location of a pet and deter it from the off-limit areas.

    Here is a list of objectives that need to be taken into consideration when designing our Pet DeterrentSystem:

  • 8/13/2019 FINAL Report Topdog

    5/41

    TAMU CPSC 483 Final Report 5/41

    The prototype system must cost less than $500 to meet the projects budget constraints.

    The commercial system should cost $50 or less per receiver and $30 or less per transmitter to becompetitively priced on the market.

    The system must use a power source accessible to the public, such as a battery, and the powersource must last at least 1 month without being replaced.

    The system must not harm animals or people.

    The system must function well in a typical indoor environment.

    The collars should be light, less than 1 pound, and comfortable for the pet.

    The system must be easy for the user to set up which is defined as the set up time taking less than30 minutes.

    The system must be easy to use and adjust; any adult with basic computer knowledge should beefficient with the computer software after 1 week.

    The system should have a variable range that covers an area with a 1 foot radius to an area with a10 foot radius.

    The system should document the zone and time when a pet violates a restricted location; shouldalso record when a pet enters an allowable zone.

    The recorded information should be displayed to the user in an organized and understandablefashion.

    2.3 Design constraints and feasibilityThe economic constraints of this system fall into two groups. First the prototype of the deterrent systemshould cost less than $500. If the development of the project goes over $500 then the project will go overbudget. Secondly, this system is being designed with the intent of being a consumer product. The finalsystem needs to be priced competitively. In order for the system to be affordable, the receiver should cost

    $50 or less, and the transmitter should cost $30 or less. Another commercial economic constraint is thepower for the system. The power source needs to be something that is easily accessible and cheap to theconsumer. Also, the power source for the system needs to be efficient, so that it does not have to bereplaced often.

    The physical constraints on the system are in the collar/receiver and transmitter design. The receiverneeds to be lightweight (preferably less than one pound) and not hurt the pet. In addition to beinglightweight, the receiver needs to be relatively small; a bulky receiver could hinder the pets movement.The receiver also needs to not produce to much heat or it could aversively affect the pet; this means it isimportant that our voltage regulators do not produce too much heat. Further testing will be needed todetermine what amount of excess heat is acceptable. The collar needs to be wireless when in operation, sothe pet is not constrained by wires. The only exception to this is when the user is using USB to get thedata off the receiver. The transmitter needs to have good battery life to prevent the deterrent zone from

    turning off. Also, the transmitter needs to be small enough, so that it will not get in the way of the usersdaily life.

    The physical setup of the receiver collar and transmitters needs to be easy for the user. Putting the collaron the dog and activating the receiver should be easy. Activating the transmitter and selecting thedeterrent settings also needs to be easy for the user to accomplish with minimal instructions. To do this,the design needs to be simplified that the average consumer will not have any difficulties.

  • 8/13/2019 FINAL Report Topdog

    6/41

    TAMU CPSC 483 Final Report 6/41

    The software design is user friendly and easy to setup for someone with basic computer knowledge. Also,the user interface is simple and easy for the average user to be able to learn and use quickly. The filtersare all straight forward and logical.

    The system needs to function in an indoor environment, so being able to work with obstructions such asfurniture is needed. Currently, obstacles do cause a problem at close ranges because of the weakness of

    the signal strength. With a larger range this will not be as much of an issue.Our prototype will not actually have a deterrent method, due to possible safety regulations andconstraints. Instead there will be two LEDs, a green one to indicate a safe zone and a red one to indicatean off-limit zone.

    2.4 Literature and technical surveyIndoor Positioning Systems

    http://www.radianse.com/download/news-bit-2004.pdf

    The goal of the Pet Deterrent System is to track pets in specific areas and deter them from off-limit areas.Top Dog Technologies looked at commercial products used to track items in an indoors environment.Indoor Positioning Systems have been used in hospitals for almost 20 years to locate patients andequipment. There are many different techniques that have been put to the test over the years and thisdocument explains the pros and cons of each. The topics covered are Passive RFID Systems, InfraredSystems, Radio Triangulation Systems, Radio Fingerprinting Systems and Active RFID Systems.

    PetSafe Electronic Indoor Pet Deterrent Systems

    http://www.gundogsupply.com/peelpetdesy.html

    This product is similar to what the proposed design. A transmitter with a variable range can be placedindoors to deter a pet from that area. If the pet, with the appropriate collar, gets in range of the receiverthe collar will shock the pet.

    Long Range Passive RFID-tag for Sensor Networks

    http://ieeexplore.ieee.org/iel5/10422/33099/01559038.pdf?arnumber=1559038

    This is a research project done by scientists at Tohoku University in Japan that works to control distancesemitted by RFID transmitters. The bulk of our project involves controlling the range of the emitted signalfrom the transmitter. Our need to emit an accurate, strong signal in a specified range is a must for ourproduct to succeed. The researchers in this paper have identified the problem with short-range RFIDs andhave come up with a way of adjusting better ranges thereof. They have modified the traditional RFID tagto have a microstrip antenna and a voltage regulator to amplify the signal and to better control it. Ourdesign calls for a specific control of the range by adjusting the input power. The microstrip antenna is anoption on some of the transceivers we are looking at, in particular the TI TRF7960 unit. The benefits ofthis design are mentioned and the control, combined with voltage amplification, are noted and will beconsidered when building this project.

    Pet Deterrent Project at Texas A&M University (Spring 2007)Last semester a group of students in the Computer Science Department here at Texas A&M Universityworked on and developed a pet deterrent project similar to ours. Their work involved having a transmitteremit a signal over a controllable range and having the pet collar pick up the signal and deter whenever hewas in close proximity. On the collar they made a PIC to store the information and had USB connectivityso that the user could monitor his or her pets location. They ran into a problem when they ordered a long-range transmitter and were unable to successfully create the correct sized zones that would be needed in acommon household. Top Dog Technologies hopes to work off of their idea and develop in a more system-approach manner that would allow more options to the user during setup.

  • 8/13/2019 FINAL Report Topdog

    7/41

    TAMU CPSC 483 Final Report 7/41

    Contech ScatMat

    Contech provides a pet deterrent system called a ScatMat. This product is a mat that gives the pet a mildshock when he stands on it. This is meant to keep the animal out of certain areas of the house. It hasthree different levels of intensity, so the user can customize it for their pet. The downside to this design isthat it can only keep a small area off-limits, 40x20. In addition to being a small area, the mat has tophysically cover the entire area that the user wants to deter the pet from. If the user wanted to keep thepet off of a counter, the mat would have to cover the entire counter. Also, this would not be an effectivetool to keep pets off of furniture. Another downside to this particular design is that the deterrent is onlyprovided when the pet is standing on the mat. If the pet learns that he can walk over the mat quickly, thenthe pet might still get into the off-limit areas. Our design accomplishes the same thing as the product, justbetter. Ours can cover larger areas, does not have to physically cover the entire area, and cannot be easilybypassed by the pet.Our proposed design is unique from the designs and products above because it stores data on what zones,both off-limit and tracking, the pet has entered. This data can be viewed using software on the computer.There are no products that are used to deter pets along with keeping a record of where the pet has been.

    2.5 Evaluation of alternative solutionsOne alternate solution to our pet deterrent system involves a system of Active RFID transceivers around aroom setup to home in on a single transceiver located on the pet. The three transceivers setup on the wallswould geometrically pick up the pets signal and using the signal strength as a means of distancedetermine his location in the room. This would serve as a constant monitor for the pet. In order to deterhim from certain objects, the user would setup an invisible perimeter by storing locations in the room (i.e.encircling the couch). If the pet came within proximity of these areas he would be deterred by a shock onhis collar. The plus side of this design is that it is low cost and low bulk. There are only 3 transceivers anda system on the dog. The user could define their own off-limit areas and update them easily. The onlydownside to this project is the fact that all the distance measuring is done by the RSSI signal strength pin.This method of measuring distance, no matter how many transceivers you have setup, will alwaysproduce faulty measurements and never maintain any sort of consistency.

    Building off of the previous design we could implement a similar system without having to worry about

    RSSI and signal strength. Several of the latest indoor positioning systems developed by researchersinvolve using multiple technologies together so as to act off one anothers flaws. For instance, RFID onits own is unreliable because of the RSSI pin. GPS is excellent for positioning things with great accuracy,but only works outdoors. Ultrasonic technology can carry a precise signal, but only in a single room. Bycombing these technologies to work off of each other you have the potential to implement a somewhataccurate system that you could count on for consistency. This idea was introduced by a group ofresearchers at a conference in Korea in 2006. With the addition of a filter for the RFID, the systemboasted the ability to search around obstacles, such as furniture, and noise that may alter the signal. Theaccuracy of this system was the big selling point in that it boasted a 2cm error maximum for a smallroom. Based on the research done this is by far some of the best results we have seen. In fact, this projectcould have been our first choice except for the complexity and price of the system. Having GPS,Ultrasonic, and RFIDs working off of each other is not simple and building this project would take more

    than a single semester.

    UWB is a radio frequency called ultra-wide band. UWB is not affected that much by multipath fading(distortion of a signal due to reflections), which is one of the main problems of normal narrow-band RFsignals. This is because UWB uses short pulses that are not as prone to signal reflections overlapping theoriginal pulse. Since they are not affected by the multipath distortion, the calculation for flighttime/distance can be done by time of arrival instead of signal strength, and the signal can go throughobjects. Setting this up would be similar to the triangulation method as mentioned before, except that youwould only need three receivers for the whole house. However, the downside to UWB is that it is very

  • 8/13/2019 FINAL Report Topdog

    8/41

    TAMU CPSC 483 Final Report 8/41

    new. Because it is new, there are practically no receivers and transmitters for sell, and the ones that are forsell are very expensive.

    RFID stands for radio-frequency identification. The passive technology has no power source for the RFIDtags. Instead they are powered by the electrical current induced from a signal by the reader. This gives thepassive tags the advantage of using no power source that has to be replaced when it runs out. The

    downside to RFID is that it has a very short range, making it unusable for our project.Unlike the passive RFID, active RFID can have a short or long range based on the transmitter. Eventhough it needs power, battery life in some RFID tags can last a few years. For tracking purposes RFIDhas two major drawbacks. It cannot go through walls or objects well due to multipathing. The signal tendsto reflect off objects making it hard to determine the signal strength. Secondly, signal strength has to bemeasured to determine distance, and this measurement is very inaccurate. The best accuracy we foundusing active RFID for tracking was with the LANDMARC system. The LANDMARC system used extratags placed around the room to serve as reference points. Multiple readers are then used to read signalstrengths from the reference tags and the tags being tracked. By comparing the readings, it can bedetermined which reference tags, the tracked tags are closest too. Using this data, and approximatelocation can be determined. However, even using this system, error was still in the 1-2 meter range, whichis too high for a deterrent system. Also, placing all of these reference tags would make our system more

    expensive and impractical. No one will buy a commercial product requiring them to use reference tags.

    3 Final design3.1 System descriptionThe system will be comprised of primarily three main components; the transmitters which create thezones of interest, the receivers which are on the pet collars, and the client program which is the userinterface to monitor all the information. The initial step in the process is for the user to define the zones ofinterest. This is done by placing the transmitters in areas in which they want to either track or deter. Theymust then define a range for the radius and select which pet collars will be set to the deter mode andwhich collars are set to only track. This step is refined by testing the ranges and making sure the system is

    functional. Next the transmitter will continually broadcast a repeating signal stating its unique transmitterID and a code for which pets to deter and which to only track. Once a receiver comes in range it willprocess the message and respond accordingly. If the pet is not supposed to be in that zone it will triggerthe deterrent mechanism. In either case however the zone ID will be stored in the memory along with atime stamp. If the memory becomes filled (meaning the user has not cleared the data in a long time) olddata will begin to be written over. All events will be 3 bytes long (2 bytes for the timestamp + 1 byte forthe tag information). Our memory is 64kB which means the system could store more than 21,000 eventsor about one week of constant data. Finally, the user takes the pet collar and connects it to a homecomputer. All data is transferred to the PC and cleared automatically from the on board memory. The usercan then interact with the client program to monitor the recorded data. All data is saved for later use andby using this information they can make adjustments to the zones or simply return the pet collar to theanimal.

  • 8/13/2019 FINAL Report Topdog

    9/41

    TAMU CPSC 483 Final Report 9/41

    3.2 Complete module-wise specificationsTransmitter

    The transmitter has been designed to meet the objectives that specify that the product should be easy forthe user to set up and adjust. Top Dog Technologies decided that the system should be usable with or

    without the software suite. A diagram of how the end project should look is found below. Eachtransmitter is given a unit number that represents the unique ID in decimal. Each collar is given a number1 through 4 and the user may specify for each pet if the transmitter should track or deter by altering theappropriate switch in the deterrent settings section. The radius is adjustable by a knob, and should allowthe user to create a circular zone with a diameter between one and twenty feet.

    The schematics below are how we intend to make the transmitter fully functional. We have chosen to usethe TXM-315-LR by Linx as our transmitter. The PIC created by Microchip, PIC18f2455, generates andoutputs the signal so that the transmitter can send it. The switches determine the deterrent settings and theID is programmed onto the PIC.

  • 8/13/2019 FINAL Report Topdog

    10/41

    TAMU CPSC 483 Final Report 10/41

    The schematic has undergone a few changes since the CDR report. Initially the ID was input to the PIC.This would require 16 different types of transmitters to be manufactured, the ID is now coded onto thePIC so that only one kind of transmitter is manufactured. We are using different kinds of switches, andthey required pull up resistors. Another adjustment made was to sync the receiver and transmittercorrectly they needed to run off the same oscillator speed. The receiver used an external oscillator tomake USB connections possible, so the external oscillator, along with its resistor and capacitors, was

    needed on the transmitter as well. An LED was added to show when the transmitter is transmitting. Acapacitor was added to keep the power source from introducing noise into the system. Two voltageregulators were added to keep the output lines from the PIC under 3.3V.

    The transmitter initially sends a square wave so that the baud rate is within the range the receiver needs topick up the signal. The square wave is followed by three zeros so that the rising edge of the beginningsequence is picked up. The beginning sequence of 10000000 is sent so that the receiver can verify that thesignal is important. The beginning sequence consists of mainly zeros because noise is typically recordedas a one. The beginning sequence is followed by four bits containing the transmitter ID. The unique IDwill identify this transmitter differently from the other transmitters set up in the house. Four bits for theID will allow a user to place up to 16 transmitters. The next four bits sent in the signal determine thedeterrent settings for each collar. This will allow the user up to four pets on the system. When the receiverpicks up the starting sequence, it then waits for the ID to record it in its memory module. The PIC on the

  • 8/13/2019 FINAL Report Topdog

    11/41

    TAMU CPSC 483 Final Report 11/41

    receiver knows which bit from the four bit deterrent setting that relates to it. If that specific bit is 0 thenthe transmitter is simply tracking the pet. If that specific bit is 1 then the transmitter is deterring that petand the appropriate actions will be taken.

    The signal pattern has been adjusted since the CDR report. The square wave was added to the beginningso that signal is sent at the correct baud rate to be picked up. The leading zeros were added so that the

    rising edge of the beginning sequence is easily detected. The beginning sequence contains many zeros sothat noise is unlikely to be considered the beginning sequence. The ending sequence was shortenedbecause it is not actually needed.

    The user should be able to place a transmitter in his or her home, adjust the range with the knob and flipthe switches to determine which pets are being deterred and which are being tracked. The transmitter thensends the appropriate signal, including the transmitter ID and deterrent settings, and when a receiverenters the zone the appropriate actions should be taken. The transmitter constantly sends a signal and then

    sleeps to save power. Here is a complete list of parts needed to create the transmitter that Top DogTechnologies has designed.

    Part Part Number Vendor Distributor PriceNumber per

    Transmitter

    Transmitter TXM-315-LR Linx Digi-key $7.46 1

    PIC PIC18F2455 Microchip Microchip Free Sample 1

    3.3 VoltageRegulator

    UCC383TDKTTT-3

    TI TI Free Sample 3

    Switches ---------------- ---------------- ---------------- Free Sample 4

    Potentiometer ---------------- Radio Shack Radio Shack $2.99 1

    Resistor ---------------- ---------------- ---------------- Free Sample 8

    Capacitor ---------------- ---------------- ---------------- Free Sample 3

    LED ---------------- Radio Shack Radio Shack $.50 1

    Resonator ---------------- Digi-key Digi-key $.33 1

  • 8/13/2019 FINAL Report Topdog

    12/41

    TAMU CPSC 483 Final Report 12/41

    Receiver

    The receiver module is what receives signals from the placed transmitters and deters the pet from the offlimit locations, as well as store information about the incident. Ideally, the module will consist of only afew ICs with the addition of a small battery. This should be a rather small unit upon completion and willeasily fit on a pets collar with ease and comfort, meeting our set objectives. The receiver will receive and

    process any information it gets from the designated transmitters. In order to process the data andeventually store it we will need a microcontroller, memory, and an interface. The method of deterrent forour application will be notification by an LED.

    The receiver used is the RXM-315-LR-S from Linx Technologies which is the counterpart to thetransmitter that is used in our setup. We will receive information across a 315 MHz signal. The -112 dBM

    sensitivity on this module is excellent for picking up the weak signals transmitted over short ranges on thetransmitter. In fact, we have tested this to work within a range of around 3 inches to show consistency.The module itself is rather simple since it only has sixteen total pins, nine of them being No Connections.Upon hookup, the only pins used are the Vcc, GND, and the DATA pin. Whenever the receiver picks up asignal emitted from the transmitter it will send it across the DATA pin to be processed in the PIC.

    The microcontroller in our case is a PIC18F2455. It handles all of the information processing and is thecore behind the receiver module. Once the receiver gets a signal from the transmitter it sends it from itsDATA pin to the PICs Rx pin, which receives data and stores it to a register. Currently, our bit setup is tosend an 8-bit open identifier, then 4 bits needed for the transmitter ID, then 4 bits needed for the hot-encoded pet deterrent settings, and 3 bits for a close identifier. The PIC will process the data accordinglyand judge if a deterrent is needed. If the bit for the particular pet is high, then it means it is an off-limitzone. If this happens, a signal is sent out of the RB5 pin. When a signal is received the LED will blink, or

    in the case of a real module, shock to deter. The RB4 pin will flash if a pet enters a zone he is allowed to.This is meant solely for testing and observation and will not be used on the final product.

    All instances of data that the PIC receives will be stored so that the user can follow the patterns of theirpet(s). The information needed to be stored is 3 total bytes: the transmitter ID (which is four bits), a bit fordeter/not deter, and two bits for the petID. The second and third bytes store a short timestamp so the usercan know when and where their pet has been. The timestamp is a 16bit value in minutes. Since the PIChas only 256 bytes of memory to work with we needed an external memory module. For that we attainedthe Microchip 24LC64 memory module which has 64K memory that can be accessed serially. This meanswe only have to worry about two pins, SDA and SCL, which we can connect to the PIC respectively.Storing and retrieving the data will now work over the same line and the address pins are not needed.

    The EEPROM is very simple. It has address lines that allow you to segment your storage, a write protect

    line, and the serial clock and serial data lines. Storage segmentation and write protection is not needed forour project. The SCL and SDA are used to do byte writes and byte reads. The control is set by theprogram and then the high and low addresses are kept in global variables and incremented or decrementedafter each operation. Lastly the data is sent and then an ACK is sent back to the PIC.

  • 8/13/2019 FINAL Report Topdog

    13/41

    TAMU CPSC 483 Final Report 13/41

    The user interface to the stored data will be by USB. This is by far the most complicated aspect of theentire module because it requires a large amount of code and a few extra components to allow it to runcorrectly. The USB connector itself will be a type-B connector that has 4 DIP pins on it. Those pins areVcc, GND, D+, and D-. The D+ and D- are the data lines for USB. These pins are connected to theircounter D+ and D- on the PIC. In order to send signals correctly, the proper frequency must be obtained.To do this we need an external oscillator. Based on the recommendations from the tech doc we need a 16MHz ceramic oscillator and two 22pF capacitors to make it run properly. The two sides of the oscillatorare fed into OSC1 and OSC2 on the PIC. From here they are fed into the PICs internal PLL, whichmultiplies the frequency to make it run properly for USB purposes. The code we used for this wasprovider by PICCoder.co.uk and is implemented based upon the USB Generic class as provided by

    Microchip.The final module for the receiver can be seen below.

    Client Software

    The User Interface for our project allows the customer to upload the data from the pets collar to thecomputer. Here, the data is presented in multiple ways to show the user when and where the pet was in azone, whether allowed or off-limit. The code is written in C# using the .NET framework. The power ofVisual Studio allowed us to create a powerful GUI with little effort. It gives a very professional feel that

  • 8/13/2019 FINAL Report Topdog

    14/41

    TAMU CPSC 483 Final Report 14/41

    will represent our product well on the market. The User Interface begins by calling a function thatconnects to the Receiver module (collar) through the USB interface and compiles the data onto thecomputer. The data is automatically saved to disk with a timestamp for a filename. All of the data thatwas on the PIC is now deleted and ready for a fresh start again. The user is now able to view and seedifferent interpretations of his data on the computer. Choosing between Pet ID and Transmitter ID youcan filter the material that is displayed on screen. You can view instances in a range of time or by zone.

    You have the ability to view bar graphs, pie charts, timelines, and tree charts to better observe the trainingof your pet in bad zones and his time spent in each zone. The purpose of the software is to demonstratethe process of training your pet from certain areas as well as an advanced tracking system.

    3.3 Approach for design validationTop Dog Technologies followed the Range Test, the Deterrent Test, the Power Test and the software testsdocumented in the CDR. The power test was adjusted to use math to calculate how long the batterieswould last. The software tests were combined into one Software Test for simplicity. These tests verifiedthat the system does what it was designed to do.

    4 Implementation notesTransmitter

    When building a transmitter the most important decision is what RF Transmitter IC should be used. Thereare many different options on the market, but not all will work for the Territory Tracking and RestrictionSystem. The main considerations we took into account were the transmission range and range variation.Top Dog Technologies chose the Linx TXM-315-LR because the LADJ pin is used to change thetransmission range based on input voltage. The chip met our range and range adjustment requirements.The transmitters signal is sent at the frequency of 315MHz, this is a common frequency used in the USAand we should have used a different frequency. The TXM-315-LR runs off of 3.3V while the PIC we useruns off of 5V. This required several voltage regulators in our circuit to ensure the transmitter does notreceiver too much voltage. A feature we also liked about the transmitter was that it could be sleeped basedon a one or zero at the PDN pin. So when choosing a transmitter for a pet deterrent system, take into

    consideration the range, range adjustment, frequency, voltage and sleep potential.In the project requirements the team decided that the transmitter should have an adjustable area from athree foot diameter to a twenty foot diameter. A voltage divider using a resistor and a potentiometer isfound in the transmitter schematic to control this feature. We invested in a 1k multi-turn potentiometer tohave better precision. During the range tests the transmission range was mapped to different voltages atthe LADJ input pin on the transmitter. A ten foot radius was found to have 2V at the LADJ pin. Here arethe calculations required to determine the resistor that regulates the potentiometer to only change thetransmitter range from zero to ten feet. With zero feet determined when LADJ is grounded and when tenfeet is determined when LADJ is equal to V1. The variables may be adjusted to achieve different results.

    The sleep pin and data pin on the transmitter are connected to the PIC through a voltage regulator. TopDog Technologies chose Microchip PIC18F2455 because it had the correct number of I/O pins, had USB

  • 8/13/2019 FINAL Report Topdog

    15/41

    TAMU CPSC 483 Final Report 15/41

    capabilities and was used the previous semester. Most of the projects hardships came from programmingthe PIC due to strange configuration settings and the fact that none of us had done PIC programmingbefore. When determining which PIC to use for a pet deterrent system take into account the number ofI/O pins, USB capabilities and ease of programming.

    The PIC for the transmitter takes in the deter settings from four switches, generates the signal, and sendsthe signal to the transmitter data pin while it wakes the transmitter by sending a one to the PDN pin. Theconfiguration settings on the PIC are set to allow these pins to act in the following way.

    Pin Name Pin Number I/O Variable Variable Description

    AN0 Pin 2 Output pin_sig Signal sent to transmitter

    AN1 Pin 3 Output pin_sleep Value that sleeps the transmitter

    AN8 Pin 23 Input pin_det0 Deter setting

    AN9 Pin 24 Input pin_det1 Deter setting

    AN10 Pin 22 Input pin_det2 Deter setting

    AN11 Pin 25 Input pin_det3 Deter setting

    The program begins by initializing the configuration settings and then setting up the signal. A differentfunction is then called to initialize the signal into a global array. By changing the values being stored intothe array the signal is very easy to adjust. This portion of the code allows the programmer to alter anysegment of the signal including the ID of the transmitter.

    Once the pins have been initialized and the signal set up the PIC enters into an infinite loop that will last

    until the circuit is turned off. The program cycle wakes the transmitter, reads in the deterrent settings,sends the signal, sleeps the transmitter and delays before beginning the cycle over.

    The important aspect of the transmitter code is how fast the signal is sent. The signal baud rate isdetermined by a delay that happens after each bit is sent through the signal output pin. When we firstbegan sending the signal generated by the PIC, instead of a square wave generator, the receiver did notreceive it. On the data sheet for the receiver, RXM-315-LR, there is a data rate specification of between100 and 10,000 bits per second. This is information that must be checked to make sure the transmittersends data at the correct baud rate. A simple way to check the baud rate of data is to send a square wave

  • 8/13/2019 FINAL Report Topdog

    16/41

    TAMU CPSC 483 Final Report 16/41

    from the PIC and connect an oscilloscope to it for measurement. So that the delay amount on thetransmitter corresponds to the delay amount on the receiver the oscillator the PICs run off of must be thesame. Typically the internal default oscillator would work, however for the receiver to have USBcapabilities it had to run off of a faster external oscillator. This added the external resonator, twocapacitors and a resistor to the transmitter schematic.

    The signal transmitted is split into six portions. The first five bits create a square wave that is used to getthe baud rate in a good range to be distinguished by the receiver. Top Dog Technologies added thissection of the code when we noticed the beginning of the signal was not being received consistently. Thereceiver starts checking for a beginning sequence one a rising edge interrupt. Therefore the second portionof the signal consists of zeros so that when the beginning sequence starts the rising edge is not overlookedbecause the system was already in an interrupt. The third portion of the signal is the beginning sequence.The beginning sequence is used so that the receiver can verify that it is reading the signal from thetransmitter. Originally the sequence consisted of mostly ones, however we began receiving many falsepositives because noise is often registered as a one. The sequence is now 10000000 which rarely producesa false positive. The fourth portion of the signal is the four bit transmitter ID. The ID indicates whichtransmitter zone the receiver is in. When the receiver is connected to the client program, the transmitterID will allow the user to see which areas the pet traveled into. The fifth portion of the signal is thedeterrent settings. The PIC determines the deterrent settings according to four input pins connected toswitches. This allows the user to determine which pets are allowed in the zone. The ending sequence thatconsists of zeros is the sixth and final portion of the signal.

    The transmitter is an important part of the pet deterrent system. The design specifications given abovewill help build or adjust the transmitter. Unfortunately RF technology is inconsistent. There is a lot ofnoise and the signal strength varies. If a person places their hand between the transmitter and receiverthere is a good chance the signal will be obstructed and the receiver picks up bad data. Overall we feel thetransmitter was completed and achieves most of the objectives we specified in our project proposal.However, we do not feel the transmitter can be consistent enough to be a consumer product. If it is placedunderneath a couch, the receiver will probably not be able to read the signal consistently.

    Receiver

    The receiver is a complicated combination of technologies that revolve around the 18F2455 PIC we used.The receiver module will receive a signal on the RXM-315-LR-S receiver and then send the bit stream tothe PIC to be processed. Once processed, data parts will be parsed and certain parameters set based uponthis. Finally, a complete instance, including a timestamp, will be stored on the EEPROM memory moduleto be stored for later use. So, the receiver can be broken into basically four main parts: the data processingfrom the receiver, the code parsing and timestamps, the storage to memory, and the USB uploading.

  • 8/13/2019 FINAL Report Topdog

    17/41

    TAMU CPSC 483 Final Report 17/41

    In order for the PIC to even function correctly with all the things we need, a series of configuration bitsmust be set to get the PIC to not only function, but to oscillate accordingly with the USB. The bits for PICoperation are:

    #pragmaconfig WDT = OFF

    #pragmaconfig WDTPS = 256

    #pragmaconfig MCLRE = OFF

    #pragmaconfig LVP = OFF

    The LVP pin in this case is very important because it turns off a feature known as Low-VoltageProgramming. Unless you implicitly tell the compiler you do not want this feature, the PIC will not run,

    yet it will not give any errors in compilation, which makes it difficult to debug. For all of the USBmaterial we have to set the right oscillator to get it to work correctly. The internal PIC clock is only16MHz, which is not enough to power the 48 MHz required USB frequency. In order to get High-SpeedUSB working with our PIC, we must incorporate an external oscillator and run it through the PICs PLLwhich will implement a 48 MHz signal. Following the data sheets we added a 16 MHz ceramic oscillatorwith two 22 pF capacitors going to ground. These are run out of the OSC1/OSC2 pinouts on the PIC. Theconfiguration bits needed to run this setup are as follows:

  • 8/13/2019 FINAL Report Topdog

    18/41

    TAMU CPSC 483 Final Report 18/41

    #pragmaconfig USBDIV = 2

    #pragmaconfig CPUDIV = OSC4_PLL6

    #pragmaconfig PLLDIV = 4

    #pragmaconfig FOSC = HSPLL_HS

    #pragmaconfig VREGEN = ON

    Basically, these pins are telling the compiler that we need the 48 MHz USB frequency and that we have a16MHz resonator. The CPUDIV bit sets the frequency of the PICs normal operations to 16 MHz so thatthey are easier to work with for receiver processing. The VREGEN is an extremely important pin for USBas it sets the USB voltage regulation for the whole PIC. Without setting this bit you are disabling yourUSB functionality with very little debug help to find out why.

    The data processing is done on the PIC and it looks for certain patterns to tell when to look for data. Thisis because we feed in a series of start bits that lets the PIC know when real data is being sent. A lot ofresearch went in to knowing how to properly process the data. Since the receiver picks up a lot of noise, itis hard to distinguish a real data signal and a fake one. For this, we spent time researching something

    known as Manchester Encoding. This process parses data bit streams by edge detection. For instance, a 1is read as a rising edge while a 0 is read as a falling edge. For this to work on the PIC, in addition to twointerrupts running off of each other we would have to incorporate timers and measure distances betweenthe data. Considering the time constraints we had on our project and the issues we were experiencing withthe PICs we could not implement this fully. Instead, we took the idea of edge interrupts and played off ofthat. We setup edge detect interrupts to trigger whenever a rising edge was detected on the DATA in pinfor the PIC. When this edge was triggered, the following function was called:

    #pragmacode low_vector = 0x18

    voidlow_interrupt (void)

    {

    _asmGOTO LB _endasm

    }

    #pragmacode

    When the low interrupt is triggered it goes to this function and, using assembly commands, it calls ourfunction for processing data, LB(). The configuration bits to setup these are as follows:

    //Interrupt Initialization

    INTCON2bits.RBPU = 0;

    INTCON2bits.INTEDG2 = 1; //set rising edge sensitivity

    INTCON3bits.INT2IP = 0;

    INTCON3bits.INT2IF = 0; //turn flags off

    INTCON3bits.INT2IE = 1; //enable interrupts

    IRCONbits.IPEN = 1;

  • 8/13/2019 FINAL Report Topdog

    19/41

    TAMU CPSC 483 Final Report 19/41

    INTCONbits.GIEL = 1;

    INTCONbits.GIEH = 1;

    IPR2bits.USBIP = 1;

    When we get inside our LB function to process the data, we disable interrupts and begin checking forpatterns. The main idea behind our algorithm is polling. We send a beginning sequence of 1000000 eachbit being sent for about 300 clock ticks. This gives us enough time to process a data point. Once we findthe beginning sequence, we then poll the next bits for about 310 ticks a piece and guage whether its a 1or 0 based upon the percentage of 1s and 0s we polled. Once we have our 8-bit data stream, we parseaccording to the pet ID and then determine whether to deter or track.

    As mentioned in the transmitter section the first four bits of the data is the transmitter ID while the lastfour are hot-encoded data pins for pets 1-4, respectively. The PIC stores the 4 bits for the transmitter ID ina byte. Then, based upon which pet number the receiver is, it finds its particular hot-encoded bit. If the bitis 1, this means deter and for our demonstration we light a red LED. If the bit os 0 this is an allowed zonefor the pet and all we do is track. This single bit is also packed in the same byte as the transmitter ID aswell as the Pet ID. For storing purposes, we always store a deter occurrence, regardless of time. For

    tracking we only store once per minute.

    Another portion of the receiver is also the largest code-wise, the USB uploading. Whenever the userwants to logon and view where his pet has been, he plugs in the USB cable and uploads his pets dataonto the computer. The USB code was provided by PICCoder.co.uk and it uses the USB Generic Modulesfrom Microchip to produce a high-speed USB connection. This code required several modifications towork not only with our PIC, but in general. The code was written for the 4550 PIC, which happens to bein our same family, but still requires an overhaul for the 2455. For one, we had to modify the linker scriptas well as all the pin connections (the pinouts on the 4550 are different than that of the 2455). The one lastthing we had to change was to get the the power detection code in the program to work, which turned outto have several bugs in it. The USB has a power-detection module built-in. Meaning it can run the PIC offof a 5V source or straight from the computer. It has a sensor coded in that automatically detects which

    power to use. This code was buggy and it had to be modified for functionality. Basically, after readingthrough several hundred lines of code, all that needed to be fixed was to comment out the following twolines.

    //#define USE_SELF_POWER_SENSE_IO

    //#define USE_USB_BUS_SENSE_IO

    These modules are buggy and if you comment them out the USB sensor will work and your code will run.

    Once the USB is setup and the driver is installed, you are ready to send data streams to the computer. TheUSB Generic class send packets of data as an array of bytes. Basically we used a dyanmic array of bytesstructure called DATA_PACKET which was provided with the code. We modified it send array of 3bytes everytime the call signal was sent to the PIC. Three bytes are needed to be sent for each recording:the first for all the packed data (transmitter ID, pet ID, good or bad zone) plus two more bytes for thetimestamp.

    HDByteReadI2C(0xA0, htemp, ltemp, &temp1, 0x01);

    ltemp++; //increment the temp address

  • 8/13/2019 FINAL Report Topdog

    20/41

    TAMU CPSC 483 Final Report 20/41

    if(ltemp == 0x00)

    htemp++;

    dataPacket._byte[1] = 1;

    dataPacket._byte[2] = temp1;

    HDByteReadI2C(0xA0, htemp, ltemp, &temp2, 0x01);

    ltemp++; //increment the temp address

    if(ltemp == 0x00)

    htemp++;

    dataPacket._byte[3] = temp2;

    HDByteReadI2C(0xA0, htemp, ltemp, &temp3, 0x01);

    dataPacket._byte[4] = temp3;

    temp1 = 0x00;

    ltemp++; //increment the temp address

    if(ltemp == 0x00)

    htemp++;

    This section of code highlights how we send data to the PC across USB. The PIC pulls the 3 bytes off ofthe EEPROM and then packs them accordingly into the data packet. The second bit of the data packet isset to 1 in this example. As long as that is 1 the PC will continue to read off of the EEPROM. When thatis 2 it will stop sending requests. Thus, the data read will cycle through all recorded instances on theEEPROM and then stop at the end.

    When the receiver module is powered on and everything is initialized the EEPROM is also initialized

    with InitPICEEPROMfunction. This configures the serial clock and serial data lines, disables SMBusand Slew Rate control, enables MSSP Master mode and sets the baud rate for the clock that we use.

    Void InitPICEEPROM(void)

    {

    TRISBbits.TRISB1 = 1; //Configure SCL

    TRISBbits.TRISB0 = 1; //Configure SDA

    SSPSTAT = 0x80; //Disable SMBus & Slew Rate Control

    SSPCON1 = 0x28; //Enable MSSP Master

    SSPADD = 0x09; //Should be 0x09 for 400kHz

    SSPCON2 = 0x00; //Clear MSSP Conrol Bits

    }

    The EEPROM storage is done every time the receiver picks up a deter signal for its hard-coded pet collarID. If the signal is not set to deter the pet the zone instance is only recorded once a minute. This sets our

  • 8/13/2019 FINAL Report Topdog

    21/41

    TAMU CPSC 483 Final Report 21/41

    tracking resolution to one minute and our deter signal resolution is set by a delay in the receiver software.The basic idea is to signal the deterrent for a set amount of time and then delay for another period of timeallowing the pet to leave the zone before we deter it again.

    The basic flow for the storage logic is as follows. First, the signal is processed. An initial rising edge isdetected and after the starting high bit is sent a sequence of 7 lows are sent. This was chosen because

    most of the time noise is read as a high. After the initial sequence the receiver then begins processing theactual data section of the signal. The transmitter ID and pet deterrent settings are stored in local variables.Next, the deter bit for the collar ID is checked. If it is set to deter the deterrent is signaled, the byte isstored to the EEPROM using the current address, and the address is implemented. There is a delay afterthe store to make sure the PIC has time to properly store the information on the EEPROM. The currentaddress is incremented by incrementing a lower address and if there was an overflow incrementing thehigh address. The address is stored in this way because the EEPROM we have uses a two byte address.After the data is stored the PIC then stores the current timestamp to the EEPROM. This takes two calls tothe write function because the time stamp is two bytes. Again after each write the address is incrementedand there is a delay. Finally, the PIC waits to allow the deterrent to finish and then waits again beforelistening allowing the pet to leave the zone.

    if((dataArray[COLLAR_ID + 3] == 1) && (SentPacket != 0))

    { // deter the pet

    // signal the red LED

    LATBbits.LATB4 = 1;

    // Pack the Data

    SentPacket = SentPacket

  • 8/13/2019 FINAL Report Topdog

    22/41

    TAMU CPSC 483 Final Report 22/41

    // Store the current time

    HDByteWriteI2C(0xA0, haddr, laddr, H_byte);

    delay();delay();delay();

    laddr++; //increment the address

    if(laddr == 0x00)

    haddr++;

    HDByteWriteI2C(0xA0, haddr, laddr, L_byte);

    laddr++; //increment the address

    if(laddr == 0x00)

    haddr++;

    //Delay the deter signal

    // Turn off the Deter and delay again

    // allowing the pet to leave the zone

    }

    Client Software

    The software is composed of a GUI (graphical user interface) written in C# that allows the user to uploadand view data from the receiver. The software will interface with the reader through USB. Utilizing a C#file that includes a DLL which adds low level functionality for USB communication the software is ableto download all of the data containing the time and zones the pet entered since the data was last read fromthe receiver module. The software will be able to receive the pets ID from the data along with thetimestamps to associate the zone breach events with a specific pet. The timestamp for each event that isstored is determined in a clever way. Instead of syncing times between all of receivers and transmitterswith the users PC, we utilize a timestamp that is started at 0 once the receivers are initialized and continueincrementing this value. Once the information is downloaded the client software looks at the current timeand works backwards to determine the real time that each event took place at. Then the real times, as wellas transmitter IDs and the deterrent setting , are kept for later use in a file.

  • 8/13/2019 FINAL Report Topdog

    23/41

    TAMU CPSC 483 Final Report 23/41

    Example of the USB download

    Once the data is automatically saved to disk it is loaded into the software for display. The user can thenview the data in multiple different ways and apply several different filters. The first and mostrudimentary view is a list view. It is simple a spreadsheet view of the data organized chronologically andseparated into columns with all the relevant fields. Next, there is a tree view which allows the user toexpand each file loaded and continue traversing the tree from there. Then the software has three graphicaldepictions of the data. This is where the filters can be used. The first graphical view is a bar graph, thesecond is a pie chart and the third, and probably most useful, is a timeline view. Each of the views aredisplayed below the filter management section and have a legend and labels describing the informationbeing displayed. This effectively accomplishes our teams goal of having easy and straightforwardinformation communicated to the pet owner. There are four useful filters that the client software hasimplemented. The first allows a user to filter data based on the pet IDs. This way a user can choose onlythe dogs or a specific pet. The next filter is a filter based on transmitter IDs. This means a user can lookexclusively at all zones in the living room area or even home in on a specific zone of interest. A thirdfilter is selecting just deter instances or non-deter instances. Filtering the data this way allows the user tolook an only the tracking aspect of the data or only the pet training part. The final filter is a filter on thedate. This allows a certain range of time to be shown.

  • 8/13/2019 FINAL Report Topdog

    24/41

    TAMU CPSC 483 Final Report 24/41

    A sample pie chart view of the data

    One or more of the filters can be applied at a time and after each change in the filter management sectionthe user must click the generate button to update the view.

    The main structure of the program:

    Main Class Initializes the program and starts the GUI

    GUI Classes Contains the graphical user interface implementations and event handling

    Pet Class Contains the data for one pet, including: pet id, timestamps, misc. info

    Data Class Contains the data storage and retrieval functionalities

    5 Experimental resultsRange Test

    To begin with Top Dog Technologies is going to demonstrate the Territory Tracking and RestrictionSystem with one transmitter unit and one receiver unit. The receiver unit on the collar is set to portray pet1. The transmitter is now turned on and the range adjusted with the knob to a ten foot radius. Thedeterrent setting for pet 1 is set to deter. The collar should be moved to enter the ten foot radius and theLED on the collar should light up, indicating that the deterrent device is activated. This test must berepeated for different transmitter ranges.

  • 8/13/2019 FINAL Report Topdog

    25/41

    TAMU CPSC 483 Final Report 25/41

    The range tests were fairly successful. We charted the ranges that correlate to different voltages at theLADJ pin. The signal was not cut and dry, there tended to be a one to two foot fuzzy region beyond thedesignated area where the receiver occasionally picked up the signal. When data was recorded from thefuzzy range it had a higher probability of being garbled.

    Trial 1Pin 4 Voltage (V)

    Trial 1Boundary (ft)

    Trial 2Pin 4 Voltage (V)

    Trial 2Boundary (ft)

    0 0 0 0

    0.025 0.25 0.2 1.5

    0.05 0.5 0.4 3

    0.075 0.5 0.5 3

    0.1 0.75 0.6 3.5

    0.15 1 0.7 4

    0.2 1 0.8 4

    0.25 1 0.9 4

    0.275 1.5 1 4

    0.3 4.5 1.1 4.5

    0.4 4.5 1.2 5.5

    0.5 5 1.3 5.5

    0.6 4.5 1.4 6.5

    0.7 5 1.5 6.5

    1 5 1.6 8

    1.3 8 1.7 8

    1.5 8 1.8 10

    1.7 8 1.9 10

    2 10 2 10

  • 8/13/2019 FINAL Report Topdog

    26/41

    TAMU CPSC 483 Final Report 26/41

    Range Values

    0

    2

    4

    6

    8

    10

    12

    0 0.5 1 1.5 2 2.5

    Pin 4 Input Vol tage (V)

    TransmitterR

    ange(ft)

    Trial 1

    Trial 2

    These results indicate a linear upwards trend from 0 to 2 Volts that changes the range from 0 to 10 feet.Trial 1 (blue) and trial 2 (pink) were taken on two different days. The variation between the two trials is alittle unsettling because the system should have a consistent range from day to day so that the pet is not

    confused on what the off-limit zones are.

    Deterrent Test

    This test will begin with the receiver unit on the collar portraying pet 1 and the transmitter deterrentsetting should deter pet 1 but track the other pets. The collar must enter the zone and the red LED shouldlight up. The transmitter deterrent setting should now be adjusted to track pet 1 and deter the other pets.The collar must enter the zone and the green LED should light up. This test must be repeated with thereceiver unit on the collar portraying pet 2, 3 and 4.

    Receiver UnitDeter Mode

    Rate of Success

    Track Mode

    Rate of Success

    1 94% 95%

    2 89% 98%

    3 86% 93%

    4 95% 96%

    Overall the results of this test were successful. Occasionally when a hand or item separates the transmitterand receiver the data sent is mainly zeros and the green LED will be displayed even if the transmitter ison deter mode. Tracking is signified by a 0 bit so that it is less likely a pet will accidentally be deterredfrom a safe area. The rate of successes is lower when the distance between the transmitter and receiver is

    increased.

    Power Test

    The life of the power source in the transmitter and receiver can be calculated by measuring the amperagethe units need to run. The calculations assume the consumer is using average AA batteries which are ratedfor 800mAh. When 800mAh is divided by the mA needed to run the system the result is how long thebatteries will last.

  • 8/13/2019 FINAL Report Topdog

    27/41

    TAMU CPSC 483 Final Report 27/41

    The receiver needs 25.06mA on average to run. This means the life of the receiver is 31.92 hours. Thetransmitter needs 18.12mA on average to run, making the transmitter life 44.15 hours. We attempted tosleep the transmitter for longer durations to improve its lifetime. As found in the results, sleeping thetransmitter for a longer duration slightly improved the lifetime of the batteries until the time period levelsout at 44.86 hours.

    Percentage the

    Transmitter is on

    Amperage the

    Transmitter needs

    Lifetime of the

    Transmitter

    12% (Common case) 18.12mA 44.15 hours

    10% 17.95mA 44.56 hours

    8% 17.83mA 44.86 hours

    6% 17.83mA 44.86 hours

    4% 17.84mA 44.84 hours

    2% 17.84mA 44.84 hours

    There are a handful of ways the Territory Tracking and Restriction Systems battery life can be improved.There are more powerful batteries on the market that have a higher mAh rating. Currently the transmitteris the only IC component that sleeps, the receiver and PICs can be given a sleep schedule to cut down onpower. Another way to greatly improve the power consumption issue is to use better voltage regulators. Ifthese power saving techniques do not achieve the desire result there are other options for the project. Adocking station could be designed to charge the receiver portion of the collar every night. The transmitterscould run off AC electricity and be plugged into the wall. The power results of the current system areunacceptable according to our projects objectives. We believe that the problem could be overcome if wehad more time to implement some of these changes.

    Software Test

    After the hardware has been validated the software must be tested. To test the software the team membersmust keep a handwritten record of when the collar enters a zone and what the zone is set to. To begin thistest the receiver unit on the collar should be set to portray pet 1. The transmitter should have the ID of0001 and be set to deter pet 1. The collar should move into the transmitted zone multiple times while thetransmitter is being adjusted. The ID on the transmitter should occasionally be changed. The transmitterdeterrent setting should also switch between tracking and deterring for the pet. The collar should then beconnected to the computer and the data represented with the software must be checked for accuracy. Thistest should be done with the receiver unit portraying different pets.

    These tests were performed and the system consistently represented accurate data. We are looking intowhy the software crashed on one occasion when the USB was connected to the machine. Here is a record

    of one of our tests along with a screenshot of the results.

    Pet ID Transmitter Deter or Track

    1 11 Deter

    1 11 Deter

    1 11 Deter

  • 8/13/2019 FINAL Report Topdog

    28/41

    TAMU CPSC 483 Final Report 28/41

    1 11 Deter

    1 11 Deter

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Track

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

    1 11 Deter

  • 8/13/2019 FINAL Report Topdog

    29/41

    TAMU CPSC 483 Final Report 29/41

    The data shown on the client software has two inaccurate transmitter IDs and two inaccurate deterrentsettings. Since we visually watched the receiver LEDs during the test we can verify that the data isreceived incorrectly before being sent to the client program. The client program accurately displays thedata in list format, tree format, timeline format, bar graph format and pie chart format.

  • 8/13/2019 FINAL Report Topdog

    30/41

    TAMU CPSC 483 Final Report 30/41

    All of these tests will verify that our product works and meets the need to have a pet deterrent system thattracks pet movement throughout the house 24/7 by monitoring and documenting when a pet enters off-limit areas and deters the pet when needed. The tests have verified that the product runs correctly andmeets all needs with the exception of power consumption.

  • 8/13/2019 FINAL Report Topdog

    31/41

    TAMU CPSC 483 Final Report 31/41

    The Final Product

    This image shows the receiver on the left and the transmitter on the right. The transmitter and receiver arenicely laid out on experimental boards to be mobile examples of the products.

  • 8/13/2019 FINAL Report Topdog

    32/41

    TAMU CPSC 483 Final Report 32/41

    Here is a screen shot of the final client software system. The system shows the pet information in manyuseful ways.

    6 Users ManualsHardware Installation/ Usage

    The transmitter and the receiver modules are each pre-built and ready for consumer user provided batteryinstallation. Each module needs 4 AA batteries to operate correctly. To install, place 4 AA batteries insidethe attached battery holder on each module. Be sure to close the battery pack by screwing it shut whenyou are done.

    To turn on each module, flip the switch on the battery pack to the ON position. You will notice a blinkingLED on the transmitter and flashing lights on the receiver. To begin tracking and deterring on the petcollar, be sure to flip the switch from data transfer mode to Track/ Deter mode.

    When you want to connect to the PC to send data set the switch on the receiver to USB mode and connectto the computer. You should notice the flashing yellow light stay solid yellow, meaning a stable

  • 8/13/2019 FINAL Report Topdog

    33/41

    TAMU CPSC 483 Final Report 33/41

    connection via USB to the PC. When you are done uploading unplug the cable and set the receiver backto track mode.

    The transmitter has two modes to set: track or deter. Simply flipping the switch between the two will setthe transmitters function.

    Software Installation

    To install the Top Dog Pet Trackersoftware, click on the INSTALL.EXE file and follow the followinginstructions:

    Click Next.

  • 8/13/2019 FINAL Report Topdog

    34/41

    TAMU CPSC 483 Final Report 34/41

    Fill out your information and click Next.

    Choose an Install Path and click Next.

  • 8/13/2019 FINAL Report Topdog

    35/41

    TAMU CPSC 483 Final Report 35/41

    Click Install to install Pet Tracker software on your PC.

    Click Finish and you are ready to use our software!

  • 8/13/2019 FINAL Report Topdog

    36/41

    TAMU CPSC 483 Final Report 36/41

    Software Use

    To use our software, click on the Pet Deterrent icon and load up the suite.

    Click the logo to enter.

  • 8/13/2019 FINAL Report Topdog

    37/41

    TAMU CPSC 483 Final Report 37/41

    Go to Tools-> Connect to USB to grab data from collar.

    Click on the various tabs to observe all the different graphs and lists you can use to track and train yourpet. Your data is stored automatically on uploads so if you ever want to load an instance again simplyopen the file for that particular date.

    You can filter your observed data by date, pet, or transmitter as a means of organization.

    7 Course debriefingTeam Management Style

    Throughout this project our team management and our ability to work well with each other have allowedus to succeed. We divided the project equally amongst all the participants and kept up-to-date meetings

    and status reports so that everyone was on the same page. To keep our group on target with the presetschedule we had, we constantly set assignments to people so we could do as much as possible. Whenevera major issue came up, and that was common, some group members would stop their assignment and helpwhoever had an issue. The teamwork and the ability to help others really played out for us and took us towhere we are now. In the end, it really was the ability to interact and communicate successfully that led toour progress.

  • 8/13/2019 FINAL Report Topdog

    38/41

    TAMU CPSC 483 Final Report 38/41

    Thoughts on Repeating the Project

    If we had this project to do over again, the main thing we would do different is the receiver code and thepicking of the receiver/ transmitter pair. Due to all the issues we had with the PICs and getting them tooperate correctly we had little time to come up with a scheme to receive and process data. If we had goneinto this project with a good background on PICs we would have easily spent a month on sending and

    receiving data and coming up with the best possible way to do it. As mentioned in the receiver code, wejust use edge interrupts and poll data points for a specific number of clock ticks. Though this is functionaland appears to work very well with our system, there are still many different ways to do it that are muchbetter. When we were researching algorithms for picking out received data we stumbled upon manydifferent algorithms, one of which was the mentioned Manchester Encoding, that were hard to understandand implement, but very reliable and maintainable. If we had the knowledge we have about PICs now atthe beginning of the semester we would have been able to make a very reliable and sturdy systemimplementing the best possible algorithm for parsing and processing data.

    Another thing we would have done differently would be to find a different receiver/ transmitter pair.Though our setup has a very small range, the RF communication we are using is very noisy and appearsto be interfered with by obstructing objects. Since we needed to start testing and implement our design,we did not have enough time to fully research the parts we needed. I would have preferred looking more

    into what actual variable range transmitters the industry is using for our application. Certainly there is atechnology out there that will produce a clean, variable range transmitter that is only slightly affected byobstructing objects. We just need to research more and find the best one for our application.

    Safety and Ethical Concerns

    As of right now there are no safety concerns with our product. Though it is intended for a shocker ofsome sort to replace the red LED we use in deter mode, it should be worn only by pets. We cannot reallycontrol what a consumer does with this product in their own home. Obviously someone could misuse theintent of this product and use it on their children. In that case a child would be physically harmed by ourtechnology. Other than an obscure case like that, there is not any harm coming from our product, nor arethere any pushing ethical concerns. We operate well within the legal FCC frequencies on our chip so thereis no reason to interfere with something it might cause damage to.

    Testing the Product

    Testing is major issue that could use some adjustment for our project. Since all the technology we dealtwith was new to us we obviously spent a lot of time testing. This was all part of the learning process, i.e.getting the PICs to run, testing the ranges of the transmitter, etc. When we finally had a functional productat the end, we were still running into various technical difficulties and never got into any kind of in-depthtesting. There are a handful of shallow tests documented in the Experimental Results section of thisreport; however more thorough tests would have been completed if time was available.

    If we had the testing to do over and, once again, had a better knowledge of our technology and wereallowed more time we could have easily spent more time on repeated runs to measure data and find bugs.Besides more range testing, we would have liked to test out an actual situation that a customer might do.

    In the lab we did all our testing on a flat table top with nothing in between the transmitter and receiver.Obviously this is not a real case scenario. A user is probably going to want to conceal the transmitterdevice by placing it under a couch or behind some object that makes it out of view for someone to see.This kind of obstruction will lead to interference with the RF transmission and cause the receiver to notreceive the signal or receive a garbled signal. This will only confuse the owner and cause him to lose trustin our product.

  • 8/13/2019 FINAL Report Topdog

    39/41

    TAMU CPSC 483 Final Report 39/41

    Only by extensive testing will we truly get to know our product and root out any deficiencies it may have.If we did not run into issues that caused us to lose time we would have spent more time on this pressingissue and possibly have made a better product.

    8 BudgetsFor this project we were given a building budget of $500. This amount was for parts, service, and othergoods that were purchased with the intent of aiding in the success of this project. We compiled our goodsby either purchasing them through online vendors or, like most of our ICs, we ordered samples that costthe team nothing.

    Below is a complete list of all the products we ordered:

    Product Cost Vendor

    Pickit2 Programmer $97.38 Microchip Direct

    RF Transmitter (2) LR-315 $14.92 Digi-Key

    RF Receiver (2) LR-315 $27.12 Digi-Key

    Antenna (5) 315 MHz $4.40 Digi-Key

    16MHz Ceramic Res. $1.47 Digi-Key

    USB Type B Recept. $4.02 Digi-Key

    PIC18LF2455 Chips $34.55 Microchip Direct

    Strip Sockets Sing. Row $1.95 Mid-State Supply

    4 Packs AA Batteries $10.83 Radio Shack

    Battery Holder w/ Switch-2 $4.30 Radio Shack

    PicKit2 Programmer $97.38 Mouser

    As you could have noticed we did not include some of the ICs such as the other PICs, EEPROMs,voltage regulators, timers, resisters, etc. All of these products were either available to us by free samplefrom the original company (Microchip or Texas Instruments) or were attained free from the EEdepartment. As you can see we have listed the Pickit2 programmer twice on the list. Near the end of ourproject our programmer short circuited on us and we had half a week until the demo. We talked to the EEdepartment about our issue and they would let us program on theirs, but only on their site for a briefmoment, meaning we would have to go back and forth between the departments to program and debug.This was highly unacceptable and we were forced to order another program and overnight it. We went towww.mouser.com, since they have a shipping location in Round Rock, TX and ordered the part again. So,

    technically the additional $100 charged to our budget never should have happened. It is just part of theextenuating circumstances groups run into.

    We used other code in the production of this lab. The bulk of the USB and EEPROM code was providedby either an online source or directly from Microchip. Both of these sourced give permission to use theircode in your project provided you give due credit. Either way, the code is generic enough to implementthe portions yourself, given more implementation time.

  • 8/13/2019 FINAL Report Topdog

    40/41

    TAMU CPSC 483 Final Report 40/41

    The nicest part about our project is the reasonable cost of final production. Most pet deterrents on themarket cost around $100 and do not do nearly as many things as ours does. Our boards only use a few ICstotal, which allows for an affordable solution for pet-owners.

    The following charts outline the specifics of our final solution in mass quantities.

    The receiver cost analysis is listed below.

    Product Cost Vendor

    PIC 18F2455 $4.25 Microchip Direct

    24LC64 EEPROM $0.46 Microchip Direct

    Linx RXM-315 Receiver $13.56 Digi-Key

    Voltage Regulator $0.40 Texas Instruments

    Resistors, Capacitors, etc. Negligible Various

    Hybrid Dog Collar w/ Pop off

    switch for receiver

    - -

    USB Connector $1.34 Digi-Key

    So, excluding the hybrid the dog collar that needs to be made for our project, the total cost of parts for thereceiver in mass quantities would be $20.01. The hybrid dog collar we would like would be similar to anormal collar, except that it would have a connector on it where we could remove the receiver portion andthe user could take it to their computer to upload the data.

    The transmitter portions can be seen listed below.

    Product Cost Vendor

    PIC 18F2455 $4.25 Microchip Direct

    DIP Switches $2.79 Radio Shack

    Linx TXM-315 Transmitter $7.46 Digi-Key

    Voltage Regulator (3) $0.40 Texas Instruments

    Resistors, Capacitors, etc. Negligible Various

    Potentiometer $0.85 Digi-Key

    The transmitter, excluding outer casing, will cost around $15.75 in core parts. When you combine thiswith the receiver you are looking at around $40 in assembly for one transmitter and one receiver. Theseproducts have simple schematics and could be mass-produced rather quickly and efficiently. This is prettyclose to our presumed budget in which we estimated a low cost outcome that would be well short of the$500 limit.

    9 AppendicesIssue of Multiple Transmitters Operating in the Same Range

  • 8/13/2019 FINAL Report Topdog

    41/41

    In our intent of design we meant for each transmitter to operate within its region, but it is very possiblefor a customer to place two transmitters close enough to each other that a receiver could be in both zonesat the same time. RF communication in itself is very noisy and picks up a lot of interference. It is notuncommon for a signal as weak as ours (which transmits as low as 3 inches) to be interfered with by anysort of object and cause the system to malfunction and give bad data. So, when two transmitters aresending data off of each other it is virtually impossible for the receiver to parse. The best solution for this

    is to implement random sleep times in between data transmissions. Since the data stream is received andparsed in a few milliseconds, a sleep time range of 1-5 seconds chosen at random will be enough to throwoff the transmitted collisions and keep consistency.