Home

Radio Tag For Item Tracking - Introduction

image

Contents

1. Maximum current sourced by PORTC and PORTD combined Note 3 eese Note 1 Power dissipation is calculated as follows Pdis VOO 100 X 10H VOD VOR x Z VOI 104 2 Voltage spikes below VSS at the MCLR pin inducing currents greater than 80 mA may cause latch up Thus a series resistor of 50 1000 should be used when applying a low level to the MCLR pin rather than pulling this pin directly to VSS 3 and PORTE are not implemented on 16F873A 876A devices NOTICE Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the device This is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied Exposure to maximum rating conditions for extended periods may affect device reliability 2003 Microchip Technology Inc 05305828 173 Ramiz Ahmed Radio Tag for Item Tracking 73 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX N Relevant Pages from AM2000 RX 433 Receiver Module LPRS Data Sheet AM2000 Series Receiver Module This AM superhet receiver provides greatly improved sensitivity and rejection of out of band signals over super regenerative receiver
2. 24 Wuth aba ha b ben bm m bibet 25 I AE EN EN Oe A A ee 26 int Power int temp2 27 f 28 int Result 1 29 if temp2 0 return 1 30 else t 32 for i 1 i lt temp2 i 33 34 Result Result 2 35 36 return Result 37 PR n ert Binary To Decimal kekueku 41 42 int b2dec 43 int decimal 0 44 for templ 0 temp1 lt 8 templ 45 46 if TagNo tempi 1 47 decimal decimal Power tempi 48 49 return decimal 50 51 LII ssec 52 void main 53 dec TagNo 0 Initialize Tag No as Zero 54 55 ANSEL 0x00 56 INICON 0x00 57 PORTA 0x00 at Zero Logic Value 58 PORTB 0x00 at Zero Logic Value 59 TRISA 0b11111111 Input 60 TRISB 0b11011111 Input Expcept RB5 output 61 62 Figure 3 14 Initial Radio Tag Software Code Version 2 2 of 3 Figure 3 14 above shows the part of the software code where the power and conversion functions are defined Lines 24 to 38 see figure form the function where the power function is defined The function takes one integer input variable and returns an integer output The main
3. 36 4 2 2 AM2000 Receiver Circuit Design and 36 4 2 3 Complete Base Station 4400 400 37 4 3 Microcontroller Software Code sse nennen 38 4 4 ix uu ehe iE 43 4 4 1 Wired Serial Communication 44 4 4 2 Wireless RF Communication 45 46 5 COMCIUIS IO Migs u uu aa aaa 47 5 1 Project Outline and Achievements asa 47 5 1 1 System Hardware Design and Assembly 47 5 2 Project Time Plan and Costing sese 48 5 3 Recommendations for Further U 49 5 3 1 ee ee re 49 5 3 2 Base Eire cc 50 REFERENCES cm 51 BIBLIOGRAPHY u tcm 53 APPENDIX A Final Project Time uuu uuu u u u a 54 APPENDIX B Final Component Li St U esses entrent enses nnne 55 APPENDIX C Relevant Part of UK Frequency Allocation Table for Frequency Use 56 APPENDIX D Relevant Part of UK Frequency Allocation Table for Radiated Power 57 APPENDIX E Relevant Pages from PIC 16F88 Datasheet 58 APPENDIX F Relevant Information from EasyPIC4 Developm
4. k k k k k Define Functions Fe aao A eo I e e x x void pic setup Usart init 1200 Initialise Usart 1200 Baudrate 8 Bit No Parity Bit TRISB F7 0 Portb F7 0 TRISD 0x00 Lcd init amp PortD clear buffer BOK KR KK KK Clear Buffer RR AR RR AR 7 void clear buffer for 9 0 9 lt buffer length g rx buffer g 0 KOK KR RR Welcome Message KR ck ck ck ck ck KK k k k k k k k k k k k k k k k k k K KKK ke x A void welcome msg Lcd Cmd Lcd CLEAR Lcd CURSOR OFF Lcd out 1 1 Univ of Herts Lcd out 2 1 Tag Tracker 2 x 16 LCD out l 1 Tag Trac if Ls 16 LCD out 2 1 ker y 1 x 16 LCD delay ms 1000 k k K k k k k k k k k k k k ke k k k k k k k k k k Tag Scan Message k k k k k k k k k k k k k k k k k k k k k k void scan_msg Ramiz Ahmed Radio Tag for Item Tracking 68 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Lcd Cmd Lcd CLEAR Lcd out 1 1 Scanning For Tag delay ms 500 V k k k k k k k k k k ke k k k k ke k k k k k k ke k k k k NO Tag Message K k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k K void no tag Lcd Cmd Lcd CLEAR Lod out 1 1 No Active Tags delay ms 500 8K k k k k k k k
5. 11 3 2 1 MCU circuit Design and 4 2 0 11000 12 3 2 2 Micro Tx Transmitter circuit Design and 16 3 2 3 Complete Tag 18 3 3 Microcontroller Software 18 3 3 1 MikroC Compiler amp Software L Q 18 3 3 2 Software COGO a cst qasasqa dya 19 3 3 3 Final Software 25 3 45 E 26 3 5 1 Software Testing ect e Doa duda 26 3 5 2 Hardware u u u a bete an 28 3 5 3 Complete Tag Testing Let rie Ee ere DO Eua deu 30 SUMERET 32 4 Base Station RF 33 4 1 Hardware Selectloh otra tet ertt ERI Pt o kasqas 33 Ramiz Ahmed Radio Tag for Item Tracking iii University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 1 1 PIG TOES LIA 34 4 1 2 2000 RX 433 35 4 1 3 EasyPIC4 Development Board sese 35 4 2 Circuit Design and 36 4 2 1 Power
6. 11 Figure 3 5 Decoupling a PIC 16F88 MCU 13 Figure 3 6 Radio Tag Block 13 Figure 3 7 Pin Map for the Tag No using 8 Pin DIP Switch seen 13 Figure 3 8 A Typical SIL Network Resistor 9 14 Figure 3 9 Prototype MCU circuit with DIP switch and PIC 16F88 14 Figure 3 10 Final PIC MCU Circuit on Vero 15 Figure 3 11 Application circuit diagram for Micro Tx Module 22220 16 Figure 3 12 Complete Circuit for the Micro TX Transmitter Module 18 Figure 3 13 Initial Radio Tag Software Code Version 2 1 of 3 20 Figure 3 14 Initial Radio Tag Software Code Version 2 2 Of 3 21 Figure 3 15 Initial Radio Tag Software Code Version 2 3 of 3 24 Figure 3 18 Memory Usage Statistics for Initial Software Code Version 2 25 Figure 3 17 USART Terminal Window with Tag Serial Being Transmitted 27 Figure 3 18 Oscillator Output Waveform 9 8 MHzZ a 28 Figure 3 19 MCU Tx Pin Output Waveform 9 Serial 5 2 22 29 Figure 3 20 Frequency Spectrum for Micro Tx Transmitter
7. YI gt 2005 Microchip Technology inc Ramiz Ahmed Radio Tag for Item Tracking D830487C page 1 BEng Final Year Project Report APPENDIX E Relevant Pages from PIC 16F88 58 University of Hertfordshire School of Electronic Communication and Electrical Engineering PIC16F87 88 1 0 DEVICE OVERVIEW This document contains device specific Information for the operation of the PIC16FB7 88 devices Additional Information may be found in the FiCmicro MCU Family Reference Manual DS33023 which may be downloaded from the Microchip wed she This Reference Manual should be consklered a comple mentary document to this data sheet and is nighly recommended reading for a batter understanding of the device architecture and operaton of the peripheral modules The PIC 16F87 88 ee the PiCmicro devices Block diagrams of Ihe devices are shown In Figure 1 1 and Figure 1 2 These devices contain features that are new to the PIC 16 product line Low power modes RC RUN allows me core and peripherals to be clocked from the INTRC whlie SEC_RUN allows the core and peripherals to be clocked the low power Timert Refer to Section 4 7 Power Managed Modes for further detalls Internal RC oscilator with eight selectable frequencies Inciuding 31 25 kHz 125 kHz 250 kHz 500 kHz 1 MHz 2 MHz 4 MHz and 8 MHZ The INTRC can be configured as primary or secondary clock source
8. Instruction Set 35 Instructions RB2ISDO RXIDT 18 RBSISSITXICK Resets POR BOR 1 10 R84 SCKISCL Temperature Range 40 to 125 Figure 3 2 PIC 16F88 Pin Diagram Operating Voltage 2 to 5 5 Range V Pin Count 18 Ramiz Ahmed Radio Tag for Item Tracking Universityof Hertfordshire B School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 1 2 EasyPIC4 Development Board The EasyPIC4 development system is a development board for PIC Microcontrollers It is designed to allow students and engineers easily explore and test the capabilities of PIC microcontrollers The development board can be used to interface PIC microcontrollers with external circuits and a broad range of peripheral devices allowing a user to concentrate on software development 91191 Each of the components on the board is marked on the silk screen on both top and bottom sides of the board describing connections to microcontrollers and operational modes Since all the relevant information is printed on the board the board is very easy to use and no additional schematics are required Figure 3 3 illustrates the development board with its important components explained P The board can easily be connected to the USB port of a computer with an installed version of MikroC programming language using a USB 2 0 cable User can insert a PIC microcontro
9. Parameter Min Typical Max Units Frequency UK 418 000 418075 MHZ Module voltage 22 Input current space Effective Radiated Power ERP Maximum baud rate L 0 85x70x42 I 10 Pin Pitch 508 PatetPendng MicroTx doc Issue 1 5 00 P N x xx The Quantelec Group Page 1 of 1 Ramiz Ahmed Radio Tag for Tracking 63 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report LPRS Data Sheet Micro Tx Transmitter Module Fig 1 lication Circuits 184142 RF Ground 20F Fig 2 Typical Tuned Loop Transmitter PCB Layout Tuning Capacitor Encoding Circuits Notes The Transmitter module should ideally be placed over the ground plane as shown The loop aerial should be completely clear of the ground plane and all other components Do not place other components within the loop area For operation at low voltages 3V a 100uH RF choke should be placed in series with Rd This minimises RF energy being absorbed by low impedance drive circuitry A variable tuning capacitor is preferable to one or two fixed capacitors in series if maximum output power is required for all production transmitters This allows for various tolerances in the device MicroTx doc Issue 1 5 00 xxx The Quantelec Group Page 3 of 3 Ramiz Ahmed Radio Tag for Item Tracking 64
10. 433 MHZ 30 Figure 3 21 Frequency Spectrum for Complete Tag with serial 63 30 Figure 3 22 Output of the Radio Software Tag Serial 63 31 Figure 4 1 Conceptual Block Diagram of Base Station Reader 33 Figure 4 2 PIC 16F877A Pin DiagramP esset 34 Figure 4 3 Picture of an AM2000 RX 433 Receiver P3 sss 35 Figure 4 4 AM2000 RX433 Receiver Pin Diagram lv TTE 37 Figure 4 5 Complete Base Station 38 Figure 4 6 Base Station Software Code Section 1 a 39 Figure 4 7 Base Station Software Code Function Definition Section 42 Figure 4 8 Wired Communication Testing Setup with Radio Tag amp Base Station 44 Ramiz Ahmed Radio Tag for Item Tracking V University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Figure 4 9 Complete Base Station Figure 4 10 Wireless Comm testing setup with Tag amp Base Station Separate 45 Ramiz Ahmed Radio Tag for Item Tracking vi University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report GLOSSARY AM Amplitude Mo
11. poday 00 50016810415 yodey 0 500 9 1 2804 Dana 1 uonepuawajdtul aJeMpJeH EIS Jvawdojarag 202 uon ON sj werg 9 05 9 uongnuulg 9 u6iseq noil 191809 00 0 90 an 0021603901 skep 2 EDIS 9 1590 0 Jepuodsue 0018907 208 waysis 0188594 Uolssiwgng 9 015 5 93 3909 09019 unaa 10509015 15 1 YSE E A 0 A N gt fo 0 54 Ramiz Ahmed Radio Tag for Item Tracking Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX B Final Component List Name Man Code Distributor one Unit Price Quantity e Code Price EasyPIC4 Development Board microE N A 1 N A Micro Tx LQ TX433 LPRS 7 22 3 21 66 PIC 16F877A microE N A 1 N A PIC 16F88 Stores N A 4 0 DIL Switch Rapid 80 0312 0 51 3 2 04 8 0 MHz Crystal Oscillator Rapid 90 0180 0 38 4 1 52 4 Wave Whip Antenna ANT 433MR RS 532 4424 6 42 2 12 84 Antenna Connectors RS 616 3422 1 26 3 3 78 Network Resistor Stores N A 2 N A Breadboard Stores N A 3 N A Vero Board Stores N A 1 N A Total 56 30 Ramiz Ahmed Radio Tag for Item Tracking 55 University of Hertfordshire School of Electronic Communicatio
12. Display What Tags are active 37 void disp tag missing Display if a Tag Goes Missing 38 5 5 5 5 5 5 5 5 Figure 4 6 Base Station Software Code Section 1 Ramiz Ahmed Radio Tag for Item Tracking 39 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Table 7 below lists all the functions defined in the software code with the description of the functionality of each of the functions Table 7 Function Names and their operation Function Name Description Pis setup Runs Appropriate commands to configure interrupts ports and USART initialization welcome mso Displays a welcome msg Univ of Herts and then Tag Tracker scan msg Displays a message Scanning For Tags no tag Displays a message at start up No Active Tags clear buffer Clears the Receive Buffer Array ser rx Receives the Data Through USART and stores it in rx buffer disp tag active Displays message Tag Tag Active Tag is the tag number in buffer disp tag missing Displays message Tag Tag Missing Tag is the number of tag The important aspect of the text messages being displayed in different functions was the placing of the text on the LCD Screen Since the LCD being used to display messages was only a 2 rows by 16 columns
13. University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX H Radio Tag Circuit Schematic PIC16F88 and MicroTx Transmitter Schematic E 2 8 E 3 8 G Q A DIP Switches Ramiz Ahmed Radio Tag for Item Tracking 65 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX Radio Tag Software Code amp Data Flow Diagram ke ke RRR ke ke ARR ko ke ke ke IRR RA ke ke ke ke ke ke ke ke ke e e e e Radio Tag For Item Tracking Transmitter Side Code V2 Name Ramiz Ahmed DSCE 4 Supervisor Mohammed Jamro BEng Digital Systems amp Computer Engineering RRR RR kk kk oko kk ke AA eee A float dt float t unsigned char TagNo 0 1 Kk k u 7j Main Program void main ANSEL 0x00 INTCON 0x00 PORTA 0x00 Initialize Port A at Logical Zero PORTB 0x00 Initialize Port B at Logical Zero TRISA 0500001111 Initialize Port A0 A3 as Inputs A4 A7 as Ouputs TRISB 0500001111 Initialize Port B0 B3 Inputs B4 B7 as Ouputs USART init 1200 USART intiliazed 8 Baud Rate of MicroTx 1200 bps d
14. Up messages Welcome Msg Scanning Msg Flow Chart Version V1 Ramiz Ahmed Radio Tag for Item Tracking 70 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX L Colander Vero Board Prototyping boards Veroboand pattern with colander ground plane Sir use to the sand Vern and patem B ering te of Ul W tane pare ts prod ce matum saei onthe sie d e bai Features E 41404 Ccadrare carpets 200 DIN 41612 up ts 96 86 ways Meal Var hard wiring oF discrete components E Conde ground plane for maximum screening backplane compute Veron pake with pare Oring inte rration Board dns Hoke Order endo 100 2160 5 tpuypus 032008 Mab Mala grin 54 s 2 5dnro habe da 1 AZ and Stem gag an dsatb Na pA baas Square pad board A tags d offro tr derby od witarqos1druty fey cto of reanagping socket or rtrd pit can Be accepted ether X or Y panes Wa and OV ral may te da ned ron poet to post round tre toa te state n pews ras as m of Daud Festures 8 Maximum pecking derety Taal nay using herd wire or techniques DO4184csGarecsrgatis and DIN 41612 connector patien up tr 6 56 wie B h boh shes of board pai component you ant h asst wring E Wirow tep
15. tc ata e aiana aiaa EE i i ACKNOWLEDGEMENTS catt tone cu vue a ape Poux cun ii TABLE OF GONTENTS au u iii 2 B GLOSSARY vii 1 INTRODUCTION uska 1 1 1 Project Description sm 1 1 2 Project Objectives U a 1 1 3 Report Outline 2 2 PROJCECT PLAN AND WORK STAGES I 3 2 1 Feasibility St dy i i ries i ie dee E EACH ERE Red Du UH 3 2 1 1 REID T L l 3 2 1 2 Radio Frequency Bandwidth 4 2 2 Hardware Selection I n 5 2 3 Hardware Design and 5 2 TOSUN tai e ueni DE 6 3 Rado Tag BF Transmitter eiit 5 7 3 1 Hardware Selection 9 7 3 1 1 PIC 16F88 Microcontroller U enne 8 3 1 2 EasyPIC4 Development Board enne 9 3 1 3 Micro TX Transmitter 10 3 2 Circuit Design and
16. 104 Second Tag Line 105 106 tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt Figure 4 7 Base Station Software Code Function Definition Section Lines 109 136 contain the main function which forms the body of the whole tracking software At line 112 the pic_setup function is called which is used to configure the ports and USART in the microcontroller Within the function Port RB7 is declared to be used to activate the alarm as an output and initialized at logic zero 0 The USART is initialized at 1200 baud rate to match the data rate of the Radio Tags The LCD is initialized at port Port D of the microcontroller Usart init 1200 Initialise Usart 1200 Baudrate 8 Bit No Parity Bit TRISB F7 0 Portb F7 0 TRISD 0x00 Lcd_init amp PortD cleor_buffer At line 113 and 114 the welcome msg and scanning msg functions are called which display the appropriate messages on the LCD respectively Lines 116 135 contain the do while loop which performs the tag tracking function At the beginning of the loop is conditional IF statement that checks if there is any data ready to be read from the USART Ramiz Ahmed Radio Tag for Item Tracking 42 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report port if the data is available the statement is false and the program skips the commands within
17. Sensitive for 6dB S N 103 dBm Supply Current 8 mA Shutdown Current 25 uA Data Output logic 0 0 0 5 50k Load Volts Data Output logic 1 Min 4 5 50k Load Volts Size 40 x 15 4 Mm Operating Temperature 0 to 70 C Figure 4 3 illustrates a picture of the AM2000 receiver datasheet pages relative to the project have been added in Appendix N Figure 4 3 Picture of an AM2000 RX 433 Receiver 22 4 1 3 EasyPIC4 Development Board The Information about 4 development board has already been provided in section 3 1 2 and detailed information is added to Appendix F The development board was used to integrate the Base Station components together in one place The PIC 16F877A MCU was placed in the DIP40 socket of the board to be programmed and when the Base station was in operation The LCD used with the board was a 4 Bit 16 x 2 LCD which could display two rows of up to 16 characters each row Ramiz Ahmed Radio Tag for Item Tracking 35 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The Direct Port Access Pins P Appendix F on the board were used to connect the AM2000 receiver to the Microcontroller Further details about the base station design are given in the next section of this chapter 42 Circuit Design and Assembly The circuit design phase for the Base Station did not provide much technical challenge as all
18. the number of possible character to be displayed in each line was 16 Therefore special care needed to be taken to display the information so that none of the characters are overlapped and incorrect text being displayed on screen The problem was resolved by carefully choosing the text to be displayed A LCD Map was created and numbers of characters in each of the messages being displayed were counted and then their position was calculated Below is the list of the text messages that are displayed in the software and the number of characters and spaces in each message Table 8 Number of Characters amp Rows Required in Each Text Message Message No of Characters Spaces Total Characters Rows Required Univ of Herts 4 1 2 5 12 1 3 1 7 11 1 Scanning For Tags 8 1 3 1 4 17 2 No Active Tags 2 1 6 1 4 14 1 Tag XXX Active 3 1 3 1 6 14 1 Tag XXX Missing 3 1 3 1 7 15 1 The calculations above show that most of the message could easily be displayed on one row of the LCD and the second row could be used to display different information Since the Scanning For Tags message was just an informative message therefore it was divided onto two rows The real complication was in displaying the Tag XXX Active Missing messages Since the maximum number of possible tags to be tracked by the Base Station is 256 it was assumed Ramiz Ahmed Radio Tag for Item Tracking 40 Universityof
19. to pull MCLR to vpo rather than tying the pin directly to Von 2005 Microchip Technology Inc DS32487C page 163 Ramiz Ahmed Radio Tag for Item Tracking 60 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX F Relevant Information from EasyPIC4 Development Board User Manual MCU Sockets The development board has DIP40 DIP28 DIP20 DIP18 DIP14 and DIP8 sockets PIC 16F88 used in this project has an 18 Pin packaging body therefore it was placed into the DIP 18 MCU Socket prior to being programmed All the peripheral devices have parallel connections to the MCU Sockets therefore only one microcontroller was connected to the board at any time Power Supply The EasyPIC4 development board has multiple power supply options It could either be powered up using an external AC or DC voltage supply between 8V and 16V or it could be powered up using the USB cable connected to a USB port of a computer The external AC or DC power supply is regulated to a 5V DC supply using an LM7805 voltage regulator installed on the development board The power supply type is selectable using a jumper JP1 Since the development board had to be connected to a computer for the Microcontrollers to be programmed the USB was selected as the primary power source and the jumper JP1 was set into its appropriate position On Board USB 2 0 Programmer The EasyPIC4 develo
20. 0 Y Jaq amine me cote iv Frequency seta nre swa sme Scan tas E E zon E CES 4 pe gt Marker count Span DD MHz MI Network Analyzer Output Waveform Tag no 3 E Communication Terminal Settings Com Port Baud Stop Bits Communication Append Send Send Eie Start Logging CR LF Send as typing Clear History Format Oascil Connected to COM1 Received 1 Received 169 Data bits Commands RIS Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 169 Received 161 Received 161 Received 161 Status Send CTS DSR Receive Log Files Bead from White to iv ay ines m p T E 06n ivi Tien K USART Terminal Output during Radio Tag Software Testing Ramiz Ahmed Radio Tag for Item Tracking 67 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX K Base Station Software Code and Data Flow Chart BKK RRR RRR ARR RR RRR RAR Radio Tag For Item Tracking B
21. 50 Figure 3 11 Application circuit diagram for Micro Tx 5 As explained earlier in section 3 1 3 the Tx pin RB5 of the PIC 16F88 MCU provides a 5V supply voltage when its transmitting data and the Micro TX module could work on any voltage between 2 5 V and 13V The resistor value table provided in the datasheet was used to identify the value of the series Rd shown in the circuit diagram above The voltage range was chosen as 4 2V to 6 1V and hence the Rd value is 680 ohm The recommended value of RF choke in the data sheet is 100 uH The complete schematic of the Radio Tag including the Micro TX transmitter circuit has been added in Appendix H Table 3 Bill of Materials for Micro Tx Transmitter Circuit Item Description Quantity 1 Resistor 680 Ohm 1 2 RF Choke 100 uH 1 3 Capacitor 220 pF 1 4 Inductor 15 nH 1 5 Variable Capacitor 2 5 pF 1 6 1 4 Wave Whip Antenna 1 An important aspect to note is identifying the polarity of the transmitter module The package dimension diagram in the datasheet shows that there is a small hole or circle on the ve pin In actual although there is a small circle visible just above one of the pins of the module the actual ve pin is marked with a red line on that side of the module Ramiz Ahmed Radio Tag for Item Tracking 16 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Proj
22. Communication and Electrical Engineering BEng Final Year Project Report During code development the modular approach was again adopted and the code was divided into smaller functions and any repetitive tasks were distributed in loops Figure 4 6 below illustrates the initial part of the software code Different versions of the code were developed and tested before a working code was selected The code discussed in this report is the third version of the code As part of the normal code writing practice all of the important commands and functions were thoroughly commented to highlight function of each command line The initial lines in the code file were dedicated to list details about the file name name of the project function of the project programmer s name and code version The information has been enclosed by the standard C language comment operators and The next line code defines a constant which is the length of the buffer being used in the code to store the data received through USART Lines 19 26 define the different global variables being used within the program the variables include a look up array the indexes for different loops a char variable and an array with different tag numbers already defined in it Figure 4 6 below illustrates the initial section of the software code that has been explained above The part of the code between lines 29 and 27 contains the function prototypes for all the functions
23. PORTB F3 Switch to Port B Pin 76 77 USART 1200 nitiali USART baud rate of Micro Tx 1200 bps 78 79 dt 500 80 t dt 2 rand 100 81 dec TagNo b2dec Tag No 82 83 84 if dec TagNo gt 0 Condition TagNo 0 Not Transmitted omitted 85 86 while 1 87 88 USART Write dec TagNo Write Decimal TagNo on USART RB5 Pin 89 vdelay 90 91 92 Figure 3 15 Initial Radio Tag Software Code Version 2 3 of 3 The next part of the code lines 68 75 maps the individual pins of Port A and port B to their corresponding values of TagNo array and the values are read into the array A pin map is already given in Figure 3 7 Section 3 2 1 An important aspect in using USART data transmission is to initialize the USART port in the beginning of the main program body The USART is initialized at 1200 baud rate no parity bit no stop bits by writing the following command at line 77 The baud rate of 1200 bps is used to match the data rate with the transmission data rate of the Micro TX Transmitter module see section 3 1 3 USART_init 1200 Initialize USART baud rate of Micro Tx 1200 bps Code line 80 is used to store variable delay value in variable t The variable delay value is created by adding a modulus 96 of a pseudo random number generated by a library function rand in the software to the predefined time value which in this case is dt 2 250ms The rand
24. Refer to Section 4 5 Interna Oscillator Block for further detalls The Timer module current consumption has been greatly reduced 20 uA previous PIC16 devices to 1 8 pA typical 32 kHz at 2V which Is idea tor real time clock applications Refer to Section 7 0 Timer Modula for uriner detalls Extended Watchdog Timer WDT that can have programmable period from 1 ms to 2635 The WOT nas its own 16 bit prescaler Reter to Section 15 12 Watchdog Timer WDT for further detalls Two Speed Start up When the oscilator is configured for LP XT or HS Oscilator mode this feature will clock the device from the INTRC while the oscifator is warming up This In turn will enable almost immediate code execution Refer to Section 15 12 3 Two Speed Clock Start up Mode for turiner details Fal Safe Clock Monitor This feature will allow the device to continue operation the primary or secondary clock source falis by switching over to the INTRC The A D module nas a new register for PIC16 devices named ANSEL This register allows easier configuration of analog or digital 1 0 pins Ramiz Ahmed Radio Tag for Item Tracking TABLE 1 1 AVAILABLE MEMORY IN PIC16F87 88 DEVICES There are 16 I O pins that are user configurable on a pin to pin basis Some pins are muttipiexed with other device functions These functions Include External interrupt Change on PORTE interrupt Timer Clock Input Low Power Time
25. Year Project Report Once satisfied the microcontroller circuit was then transferred over to a Vero board Appendix L All of the circuit components were through hole components and therefore no problem was encountered in placing any of the components on to the board An 18 pin DIP Socket was soldered in place of the microcontroller and the microcontroller was then placed in the socket This was done to assist in the programming phase of the project where microcontroller could easily be taken out of its socket and re programmed with a new version of program software code The components were carefully placed on to the board and their connection tracks were checked before soldering all of the components to the Vero board All the tracks between the adjacent DIP switch pins and DIP socket pins were carefully cut using a track cutter This was done to avoid any short circuit between the sensitive components especially the microcontroller and the oscillator After the soldering stage all the connections were checked under a 7x microscope to check for any dry joints or bridged connections A multi meter was then used to check for any short circuits Any resulting errors were corrected and soldering was completed and given a thorough check again before powering up the MCU circuit for the first time Since the circuit was built to work as a prototype standard 5V power supplies in the labs were used to power up the circuit this avoided adding extra batte
26. a detailed discussion of the achieved results modified project time plan and component costing as well as recommendations for further work in the project area Ramiz Ahmed Radio Tag for Item Tracking 2 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 2 PROJCECT PLAN AND WORK STAGES This chapter provides a brief overview of the initial research carried out on the project topic and discusses the key elements that were essential to achievement of project aims and objectives 2 1 Feasibility Study T he initial stages of the project required a detailed feasibility study of the project objectives in order to highlight important aspects in the previous research in the related project field and challenges that could be anticipated in the initial phases of the project The feasibility study also included development of a project time plan providing an approximate time plan and work stages within the project A copy of the final project time plans has been added in Appendix A Since the project was part of the development on a research project started in the previous year much of the initial research had been done by the previous year student This included research on the RF frequency to be used and the choice of the RF components however none of the components except a development board used in the previous year were available the project report had insuff
27. and assembly was done to the best possible professional approach and all special care was taken to reduce costs and create an efficient hardware prototype Figure 3 4 below shows the final hardware circuit the main schematic for the Radio Tag hardware is also given in Appendix H The important components in the hardware have been labelled in the diagram below Figure 3 4 Complete Radio Tag Hardware Ramiz Ahmed Radio Tag for Item Tracking 11 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report In order to avoid mistakes in final circuit and allow for modular testing the circuit assembly was divided into two stages e Microcontroller MCU circuit assembly e Micro Tx circuit assembly Details of the circuit assembly stages have been discussed in the later sub sections of this chapter 3 2 1 MCU circuit Design and Assembly The first step in power management of the circuit was to check the voltage and current usage of all the components in the circuit The table below details the power budget for the Radio Tag circuit The microcontroller voltage and current consumption values were obtained from the relevant datasheets given in Appendix E The microcontroller works with 5V DC supply and any of its input output I O ports can source or sink up to 25mA current Therefore pin 14 Vpp pin of the microcontroller was connected to the 5V DC power supp
28. and low cost AM Transmitters Each of the component circuits were carefully designed and tested and has been discussed in detail in relevant chapters of this report The Base Station was constructed to keep track of the radio tags by detecting RF signals transmitted by the Radio Tags All the hardware and software design development and testing stages have been discussed in detail in relevant chapters of this report Ramiz Ahmed Radio Tag for Item Tracking i University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ACKNOWLEDGEMENTS would like begin with thanking God Almighty for giving me strength and knowledge to finish this project would also like to wish my sincere gratitude to Dr Mohammed Jamro for supervising the project and providing guidance to smooth the project work would also like to thank Dr David Lauder for answering my endless questions and correcting silly mistakes Special thanks to Mr John Wilmot and Mr lan Munro for dealing with my endless requests in the lab work Finally would like to thank my family especially my mother for their continuous support and blessings during all my time in university Ramiz Ahmed Radio Tag for Item Tracking ii University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report TABLE OF CONTENTS DECLARATION STATEMENT
29. iteration the Result variable has value of 2 in it As shown in example below in the successive iterations this has an effect of raising the number 2 to its power the number of iteration in the loop Loop 1 Result Result 2 2 um Loop 2 Result Result 2 Du 2 Loop 3 Result Result 2 4 2 8 22 Loop 4 Result Result 2 8 2 16 2 Loop 5 Result Result 2 16 2 32 2 After the loop terminates the value stored in the Result variable is then returned to calling function Lines 42 till 50 form part of the Binary to Decimal conversion b2dec function This function does not take any inputs but returns an integer value stored in its decimal variable for temp 1 0 temp1 lt 8 temp1 if TagNo temp1 1 decimal decimal Power templ The main part of this function is a FOR loop The FOR loop starts at zero and terminates at the value of 7 The reason for the 8 loops is the fact that there are 8 switches connected to the microcontroller and the array storing the values of those pins is 8 values long The code in the loop picks a value from the TagNo T array the value corresponds to the loop iteration and does a conditional check on the value If the value in the array is equal to zero switch at that pin is OFF i e logical zero input the code skips the rest of the code and goes to the next loop However if the value is 1 switch at the pin is ON i e logical 1 input then the next line i
30. longer period of time e Cost The cost was to be a major factor in the design of the tracking system Although active tags are expensive than conventional passive tags the actual cost of the components was to be kept to be a minimum to relate the project to its potential market value The maximum budget allowed for the project by the School of Electronic Communication and Electrical Engineering was 50 while most of the RF components had higher costs and the development board being used for the receiver side alone was approximately 80 However the costing problem was solved by using the EasyPIC4 development board used in the previous year project This allowed the budget money to be used to purchase the HF transmitters and receiver components from specialist manufacturers The microcontrollers Ramiz Ahmed Radio Tag for Item Tracking 5 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report and other smaller components were sourced from within the university stores which helped in keeping the prototype development costs to minimum A concise cost list has already been listed in section 2 2 Post hardware design stage the hardware assembly was carried out whilst adhering to professional circuit assembly practices and the hardware size and weight criterion 2 4 Testing Once the hardware design and assembly phases were successfully complete the system was te
31. module the RF communication could not be achieved between the radio tag and the base station However module manufacturer was contacted and a suitable receiver module was identified In order to complete the Base Station circuit and the tracking system the first step should be to transfer the MCU LCD and Receiver onto a smaller circuit board ideally a PCB The stand alone base station could then be powered up using a battery Extra components including the alarm siren could be added onto the circuit board Instead of using a Receiver a Transceiver Transmitter Receiver at little added cost could be attached to the Base Station which could assist in later stages of the project when handheld tracking station would be developed The recommended receiver is an EASY RADIO 433 4MHz Receiver P see Appendix O manufactured by Low Power Radio Solutions LPRS LPRS also manufacture a number of transceivers which could be used in both the tags and base station Further research in these transceivers is recommended for development in the project The module has only slight cost difference from the original module and it has features like built in radio software as well as USART support Ramiz Ahmed Radio Tag for Item Tracking 50 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report REFERENCES 1 2 3 4 5 6 7 8 9 10
32. ms 100 Figure 4 7 below shows the section of the code where the text display messages are defined Ramiz Ahmed Radio Tag for Item Tracking 41 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 63 Led out 2 1 Tag Tracker 2 x 16 LCD 64 Lcd out 1 1 Tag Trac 1 x 16 LCD 65 Lcd out 2 1 ker 1 x 16 LCD 66 delay ms 1000 67 68 tttttttttttttttttttttttttt Tag Scan Message ttttttttttttttttttttttttttttttt 69 void scan msg 70 71 Lcd Cmd Lcd CLEAR 72 Lcd out 1 1 Scanning For Tag 73 delay 500 74 75 Eee eee NO Tag Message s s s s 559555 Lud 76 void no_tag Tz I 78 Lcd Cmd Lcd CLEAR 79 Lcd out 1 1 No Active Tags 80 delay ms 500 81 82 tttttttttttttttttttttttttt Tag Active Message tttttttttttttttttttttttttttttt 83 void disp tag active int number 84 85 Lcd Cmd Lcd CLEAR 86 Lcd Cmd Lcd CURSOR OFF 87 byteToStr number tag temp 88 First Tag Line 89 Lcd out 1 1 Tag 90 Lcd out 1 4 tag temp 91 Lcd out 1 9 Active 92 delay ms 100 93 Second Tag Line 94 95 tttttttttttttttttttttttttt Tag Missing Message 96 void disp tag missing 97 98 Lcd Cmd Lcd CLEAR 99 Cmd Lcd CURSOR OFF 100 101 Lcd cut 1 1 102 Lcd out 1 5 tag temp 103 Lcd out 1 9 Active
33. on 16 December 2008 Available at http www mikroe com pdf mikroc c syntax v101 pdf Microchip PIC 16F877A Microcontroller Datasheet Downloaded on 23 October 2008 Available at http ww1 microchip com downloads en DeviceDoc 30292c pdf PIC 16F877A on Microchip 2008 online Accessed on 14 April 2009 Available at http Awww microchip com wwwproducts Devices aspx dDocName en010242 LPRS AM2000 Rx 433 Receiver Module Datasheet Low Power Radio Solutions Downloaded on 23 October 2008 Available at http planet farnell com cpcdatasheets HK00494 PDF LPRS Easy Radio 433 34MHz Receiver Low Power Radio Solutions 2009 Available At http www lprs co uk product_info php cPath 21 amp products id 54 Datasheet Available at http www lprs co uk datasheets ER400TS 02 pdf Ramiz Ahmed Radio Tag for Item Tracking 52 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report BIBLIOGRAPHY Kalonji William Ngoy April 2003 Final Year Project Report RFID Tagging University of Hertfordshire Richard Balaam April 2006 Final Year Project Report RFID for Baggage Handling Systems University of Hertfordshire Laurence E Larson 1996 RF and microwave circuit design for wireless communication Artech House publishers UK Frequency Allocation Table 2007 Issue No 15 available at ofcom org Web Address http www ofcom org
34. size free development tools and serial programming re programming with flash memory capabilities The microcontroller also has some special features which were particularly useful considering the scope of the project A pin diagram of the PIC 16F88 has been included below also see Appendix E for relevant MCU information The special features included 9 1 e 100 000 erase write cycles in flash program memory EEPROM Data Retention gt 40 years e In Circuit Serial Programming M ICSP via two pins e Extended Watchdog Timer WDT e Wide operating voltage range 2 0V to 5 5V e Low power consumption e Variety of Oscillator Modes with 8 user selectable frequencies 31 KHz 8 MHz e Addressable Universal Synchronous Asynchronous Receiver Transmitter AUSART SCI with 9 bit address detection Table 1 PIC 16F88 Specifications Parameter Name Value PIN Diagram Program Memory type Flash Program Memory KB 4x14 CPU Speed MIPS 5 368 x 8 EE s 17 Data EEPROM bytes 256x8 RAAIANAITOCK 16H lt RA7 OSC1 CLKI Timers 2 x 18 bit 1 x 16 bit RASIMCLRIVPP e 4 15 RAB OSC2 CLKO ADC 7 ch 10 bit i 5 ss 14 22 omparators P REOINTICCPI ae a RB7IANGIPGDI Serial Comms USART a FI Z a FBBIANSIPGCI Ports Ports A B SELON ee 1050 11
35. software also generated a sound signal which could be listened to using the speakers the pitch of the sound increased as the tag number was increased to a higher decimal number indicating that more number of data bits were being transmitted Ramiz Ahmed Radio Tag for Item Tracking 31 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 5 Summary At the end of the Radio Tag development phase an Active Radio Tag was successfully designed assembled and tested using a PIC 16F88 microcontroller and a Micro Tx Transmitter Module The tag operates at an Amplitude Modulation AM frequency of 433 MHz the radio circuit was first assembled and tested on a prototype breadboard and later on the design was transferred over to a Vero board Different software versions were designed and tested during the software development phase and at the end of the testing stage a smaller more efficient tag code was chosen as the final code for the tag microcontroller Below are the changes that were made to the Radio Tag hardware and software during the testing stage e A100 uF capacitor was added to the Vpp pin of the microcontroller to stabilise the power supply e The 100 uH RF choke used in the Micro Tx application circuit was changed to a 1 uH RF choke to make its use resistive rather than capacitive e The tag serial number reading technique was changed to bit manipulatio
36. that are used in the code 19 ViiGdGdGpXppSXPiPlllblllblllllllfllflfflflflflflflfdfffflflflflflflfdf 2 Radio Tag For Item Tracking 3 Base Station Code 4 rr kk ok ok o k r k r k r k k ooo o o k o k r k k k k oko o o k r a r k r k k k A AAA AAA AAA k r HHH S Filename Tag Rx c 6 Date 04 03 09 7 File Version 3 0 8 Compiler MikroC Compiler 9 Programmer Ramiz AHmed 10 Course BEng Digital Systems amp Computer Engineering 11 ttttttttttttttttttttttttttt Variables tttttttttttttttttttttttttttttttttttttttt 12 char text0 Tag 13 char textl Tracker 14 char text2 Active 15 char text3 Tag 16 char text4 Missing 17 define buffer length 35 18 19 int rx buffer buffer length 20 int tag lookup 3 2 21 int column 0 22 int row 0 23 char tag_temp 4 24 int g 25 int i 26 int 3 27 28 int tag array 3 2 1 0 2 0 3 01 29 fe Functions tttttttttttttttttttttttttttttttttttttttt 30 void pic setup Initialise Port amp USART Values for PIC 31 void welcome msg Displays a Welcome Message on Pover Up 32 void scan msg Displays Message Before Scanning for Tags 33 void no tag Displays Message if No Active Tags 34 void clear buffer Clear the Receive Buffer 35 void ser rx void Receive the Data from the Receive Port 36 void disp tag active int number
37. the components could easily be fixed onto the development board and no separate circuit diagrams were required in the MCU circuit part of the base station However an important part of the Base Station hardware design was the integration of the RF Receiver and the MCU The AM2000 receiver required separate circuit design to ensure accurate operation The product datasheet 22 was consulted to identify the right pin connections and instructions to enable the receiver The detailed information about the circuit design and assembly of the receiver is given in section 4 2 2 4 2 1 Power Management During stand alone operation the EasyPIC4 development board could either be powered up by an external power supply between 8V 16V or by a USB connection to the computer 5V The power supply to the MCU was therefore provided through the development board The AM2000 Receiver requires clean 5V DC supply and draws 8mA current during normal operation The development board has 10 Direct Port Access Pins that can be used to access the individual pins on the MCU The 10 pins also include the Vcc 5V and Ground OV pins and since the individual MCU I O pins can source up to 25mA of current the AM2000 receiver was powered up through those pins The whole Base Station hardware was therefore powered up through the development board The development board in turn was powered up through a USB connection to the computer 4 2 2 AM2000 Receiver Circuit D
38. the detailed technical specifications of the module Ramiz Ahmed Radio Tag for Item Tracking 10 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Table 2 Micro Tx 433 Transmitter Absolute Maximum Ratings P Parameter Typical Units Frequency UK 433 92 MHz Module Voltage 2 2 3 0 Volts Supply voltage RD 680 Ohms Input Current mark 3 0 4 6 mA Input Current space 0 mA Effective Radiated Power ERP 6 dBm Maximum Baud rate 1200 bps Range with suitable receiver 100 Metres Dimensions 8 5 x 7 0 x 4 2 10 mm Pin Pitch 5 08 mm Operating Temperature 10 40 deg C Storage Temperature 40 85 deg C Matching Receiver AM2000 Receiver N A Relevant pages from the module s datasheet have been added into Appendix G During circuit design multiple changes were applied to the application circuits recommended in the datasheet The changes have been discussed in later sub sections of this chapter 3 2 Circuit Design and Assembly The circuit design stage for the Radio Tag was completed after detailed project research and by consulting the data sheets for the PIC microcontroller and the Micro Tx module A number of reference books and internet sources were consulted to identify the right components for the microcontroller circuit and follow the manufacturer s guidelines The hardware design
39. the pin s digital state The switches and LED s are connected to the microcontrollers PORTA PORTB PORTC PORTD and PORTE The groups of LED s for the ports could be enabled disabled using the DIP switch SW2 The switches could be setup to provide either a 5V or GND logical 1 or logical 0 respectively supply to the microcontroller s ports by setting the jumper 17 to its right position There is also a RESET push button switch next to JP17 that can be used to RESET the microcontroller The Push Button Switches and LED s proved very useful during the software testing phase of the project as it was very easy to check or change the state of the microcontroller pins by just checking the LED s and Switches respectively LCD 2 x 16 in 4 bit Mode A 2 x16 LCD could be attached to the EasyPIC4 development board on the LCD pins in the left hand side of the board The LCD could display two lines of 16 alphanumeric characters each made up of 5x8 pixels The LCD was used as data visualization component when the development board was being used as part of the Base Station phase of the project The Base Station is explained in the later chapters of this report RS 232 Communication RS 232 communication is generally used in point to point data transfer The EasyPIC4 development board has a RS 232 communication port and a MAX232 voltage converted built into it for voltage conversion The RS232 port can be used to enable serial data communication micr
40. uk radiocomms isu ukfat ukfatO8 pdf Morton John The PIC Microcontroller Your Personal Introductory Course electronic resource 3 Edition Elsevier 2005 Bates Martin P Programming 8 Bit Pic Microcontrollers in C with interactive Hardware Simulation electronic resource Elsevier 2008 Predko Michael 123 PIC Microcontroller experiments for evil genius Myke Predko McGraw Hill 2005 Predko Michael Programming and Customizing the microcontrollers 27 Edition McGraw Hill 2005 Ramiz Ahmed Radio Tag for Item Tracking 53 S s 4 E v 53 2 2 lt BEng Final Year Project Report School of Electronic Communication and Electrical Engineering APPENDIX A Final Project Time Plan soro sl no em gg 09 OVO RU ITUR RT WF at isi 60808003 Borozan siepe 60 70 00 UON 00 70 00 VON fep 60 70 00 UON 00 70 00 VON fep Siep g UON 60 0 ep 0 806010203 s tp c 60010203 60060 UON PAM PAN fep 6020 03 Siep h 80 70 10 PAM PAN fep BOILOIEZ U4 Siep 0 9002001 5 62 7 BOIZH80 UON 8 2 0 5 GOQUILUJ SHEP h fep yag 9504 804 958 1850 10 Uofeue deu 9001691001
41. 003 Microchip Technology Inc Ramiz Ahmed Radio Tag for Item Tracking Analog Features 10 bit up to 8 channe Analog to Digita Converter A D Brown out Reset BOR Analog Comparator module with Two analog comparators Programmable on chip voltage reference VREF module Programmable input multiplexing from device inputs and internal voltage reference Comparator outputs are externally accessible Special Microcontroller Features 100 000 erase write cycle Enhanced Flash program memory typica 1 000 000 erase write cycle Data EEPROM memory typical Data EEPROM Retention gt 40 years Self reprogrammable under software control In Circuit Serial Programming ICSP via two pins Single supply 5V In Circuit Seria Programming Watchdog Timer WDT with its own on chip oscillator for reliable operation Programmable code protection Power saving Sleep mode Selectable oscillator options In Circuit Debug ICD via two pins CMOS Technology Low power high speed Flash EEPROM technology Fully static design Wide operating voltage range 2 0V to 5 5V Commercial and Industrial temperature ranges Low power consumption DS395828 page 1 BEng Final Year Project Report 72 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report PIC16F87XA 17 0 ELECTRICAL CHARACTERISTICS Absolute Maximum Ratings T Ambi
42. 11 12 Jamro M University of Hertfordshire BEng Project Guideline University of Hertfordshire 2008 09 Ahmed R FYP Feasibility Report on Radio Tags for Item Tracking University of Hertfordshire 2009 Wikipedia 2009 online Ofcom Accessed on 14 April 2009 Available at http en wikipedia org wiki Ofcom Ofcom UK Frequency Allocation Table Issue 15 pp 84 Accessed 14 April 2009 Available At http www2 ofcom org uk radiocomms isu ukfat ukfat08 pdf LPRS Micro TX Transmitter Module Datasheet Low Power Radio Solutions Downloaded on 23 October 2008 Available at http www lprs co uk datasheets LQ TX433 pdf Microchip 16F88 Microcontroller Datasheet Downloaded on 23 October 2008 Available at http ww1 microchip com downloads en devicedoc 30487c pdf PIC 16F88 on Microchip 2008 online Accessed on 14 April 2009 Available at http Awww microchip com wwwproducts Devices aspx dDocName en010243 2 mikroElectronika EasyP C4 Development Board User Manual Downloaded on 23 October 2008 Available at http www mikroe com pdf easypic4 easypic4 manual pdf EasyPIC4 Development Board at mikroElectronika Website 2009 Accessed on 14 April 2009 Available at http www mikroe com en tools easypic4 Kundert Ken Power Supply Noise Reduction by Designer s Guide Consulting Inc 2004 Available at http www designers guide org Design bypassing pdf Wi
43. 12 35 lt 10Hz TDS 1002B 12 29 12 20 03 2009 Figure 3 18 Oscillator Output Waveform 8 MHz Ramiz Ahmed Radio Tag for Item Tracking 28 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The time division settings were set to 100ns per square box So each measurement unit in the box is 20ns As it can be seen from the figure one time period takes 6 5 measurement units Theoretically a Time Period T of the 8 MHz Clock should be 1 1 8x 10 125 ns If we consider the readings from the oscilloscope in the figure above 20ns x 6 5 125 ns Which confirms the oscillator is operating at correct clock speed The smooth waveform also suggests that oscilloscope operation is also stable The next step was to monitor the output from the Tx RB5 pin on the MCU Again the oscilloscope was used to observe the binary output signal from the MCU The figure below shows the output waveform when the tag serial number was set to 15 Tek Auto M Pos 200 005 CH1 Coupling BW Limit 60 Volts Div 1 4 Probe 1 Voltage Invert CH1 5 00V M 2 50ms CH1 Z 2 48V 20 Mar 03 12 44 lt 10Hz TDS 1002B 12 37 31 20 03 2009 Figure 3 19 MCU Tx Pin Output Waveform Serial 15 Further Tests results for the output waveform at the Tx Pin of the MCU with different serial numbers have been added into Appendix J The circui
44. 13433 MHz version Sensitivity for S N 5 Bm X 868 MHz version RF PassBand Tma Net 7 LFPassBand 5 15 25 kz Nt T Supply Current 8 9 9 jNoe3 77 Shutdown Current 5 44 Tobe characterised Data output logic 0 90 1 05 Vots 45 Volts S0kload Sze 0654 mm Notes low noise amplifier LNA and SAW filter provide additional RF selectivity 2 The bandwidth selectors are by default set to SELO jow and SEL1 Low 3 The shutdown pin must be pulled down to Gnd to enable the module NB The module is fitted with an internal 10K pull down resistor to ensure that if the Shutdown pin is left floating the module will be enabled This has the undesirable effect of increasing the shutdown current by 500uA when it is pulled up to the positive supply This resistor should therefore be removed from the board if the shutdown facility is being utilised Modules can be supplied without this resistor fitted by special request Bandwidth Selecf The bandwidth of the demodulator can be configured by solder blob pads on the track side of the See Mechanical drawing for location During manufacture these jumpers are set to SELO Low 0 and SEL1 Low 0 SELO SEL1 Bandwidth kHz eee eee O j 0 42 O j o 27 0 1 s y Lo 1 j 1 j v OB Users should co
45. 5 GHz 100 mW Devices operating in 24 05 24 15 GHz must employ a 2 MHz mS minimum sweep m b 2 Tracking Tracing and Data Acquisition 7 dBuA m 10 169 400 160 475 MHz Note 2b for Meter Reading ing and tracing 3 Wideband Data Transmission Systems c Ramiz Ahmed Radio Tag for Item Tracking 57 University of Hertfordshire Datasheet MICROCHIP School of Electronic Communication and Electrical Engineering 16 87 88 18 20 28 Pin Enhanced Flash MCUs with nanoWatt Technology Low Power Features Power Managed modes Primary Run RC oscillator 76 pA 1 MHz 2V RC RUN 7 pA 31 25 kHz 2V SEC RUN 9 pA 32 kHz 2V Sieep 0 1 pA 2V Timer1 Oscilator 1 8 pA 32 KHz 2V Watchdog Timer 2 2 pA 2V Two Speed Oscilialor Start up Oscillators Three Crystal modes LP XT HS up to 20 MHz Two Extemal RC modes One External Clock mode ECIO up to 20 MHz Internal oscillator block 8 user selectable frequencies 31 KHZ 125 kHz 250 kHz 500 kHz 1 MHz 2 MHZ 4 MHZ 8 MHz Peripheral Features Capture Compare PWM CC module Capture Is 16 bit max resolution Is 12 5 ns Compare is 16 bit max resolution is 200 ns PWM max resolution Is 10 bit 10 bit 7 cnannel Analog to Digital Converter Synchronous Serial Port SSP wiin Ser Master Siave and lC Slave Addressable Universal Synchronous Asynchronou
46. BACHELOR OF ENGINEERING DEGREE WITH HONOURS IN DIGITAL SYSTEMS AND COMPUTER ENGINEERING Final Year Project Report School of Electronic Communication and Electrical Engineering University of Hertfordshire Radio Tag for Item Tracking Report by Ramiz Ahmed Supervisor Dr Mohammed Jamro Date May 2009 DECLARATION STATEMENT certify that the work submitted is my own and that any material derived or quoted from the published or unpublished work of other persons has been duly acknowledged ref UPR AS C 6 1 Appendix Section 2 Section on cheating and plagiarism Student Full Name Ramiz Ahmed Student Registration Number 05102934 Date 20 April 2009 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ABSTRACT This report details the designing building and testing stages of a Radio Tag Tracking System which was undertaken as a final year project by the author of this report The project consisted of the development of the above said system components namely the Radio Tag and a Base Station Each of the components had to be developed according to a specified criterion involving size weight operation and communication methods The design and development stages of each of the components have been discussed separately in this report During the project an active Radio Tag was designed and developed using PIC Microcontrollers
47. Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report the number cannot be more than 3 digits long However the data being received through the USART was of integer data type and the LCD display library in MikroC can only display characters Therefore the tag serial number data needed to be converted to a character string before it was passed to the LCD display library In each of the display messages listed in Table 5 above the LCD cursor was turned off and screen was cleared using the following commands Led_Cmd Lcd_CLEAr Led_Cmd Lcd_CURSOR_OFF The text was then passed to the library function by using the LCD_out command as shown in the examples below Led_out 1 1 Univ of Herts Lcd out 2 1 Tag Tracker 2x 16 LCD In case of the Tag Active Missing messages rather than displaying the words on the current cursor position the position of each of the words was specified The position for the converted tag number was also specified as shown in the example below Lcd out 1 1 Tag Lcd out 1 4 tag temp Lcd out 1 9 Active The number 1 in the message above specifies the row and the numbers 1 4 9 in each of the messages specify the exact column where the word should start Each of the messages were displayed for a specific period of time using a delay function shown below after the delay the handle of the processor is returned to the main program delay
48. IC Microcontroller are absolutely correct i have used circuit board with ample ground plane to ensure its properly grounded but the module isnt working properly am trying to recieve data through USART port on my PIC MCU i checked the voltages at the pins on the RF module and the Data Out pin only had 2 volts on it is this the voltage that pin operates on because the data sheet doesnt say anything about the votages at pins the PIC MCU works on 4 5 volts takes it as valid logical input Do you think this could be one of the reasons i am not receiving anything at the MCU could you please check if you have any information about this issue about this MCU lt div gt div lt div gt lt div gt could you also please confirm if the AM2000 Rx module is DC coupled lt div gt div lt div gt Ramiz Ahmed Radio Tag for Item Tracking 76
49. Map for the Tag No using 8 Pin DIP Switch The DIP switch is connected to RAO RA1 RA2 RA3 and RBO RB1 RB2 RB3 pins of the microcontroller The input of the DIP switch is connected in parallel to the 5V Power Supply to the microcontroller providing 5V to each of the switches If any of the 8 switches is turned to Ramiz Ahmed Radio Tag for Item Tracking 13 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ON position then the 5V volts are applied to the corresponding pin of the microcontroller The above stated pins on the microcontroller were declared as inputs in the microcontroller s program code which allowed the tag serial number to be read in to the program see section 3 5 1 for examples of Tag serial numbers If any of the switches were turned off in any particular tag serial number the MCU pins connected to these switches would be left floating This has an undesirable effect of stray micro volts being fed into the MCU pins and a wrong resultant tag number being read into the MCU In order to eliminate this effect a 4 7 kilo ohm pull down resistor was connected to each of the microcontroller pins and ground OV Connection of the resistor with MCU means if any of the DIP switches are off then the corresponding MCU pin is pulled down to ground and a constant OV is read at that pin Adding individual resistors to the pins meant extra wiring connection
50. OxSF 210 0000 1101 1101 0000 0000 0010 0000 0010 1101 0010 0xD2 In order to avoid the possibility of collision between transmissions of short bursts of data being transmitted by different tags the software code was modified to change the random time delay between 250ms to 750ms The rana function has been explained in detail in section 3 3 2 As detailed in section 3 5 1 the software was tested for its accuracy using multiple testing techniques and then the microcontroller was programmed with the final software code 3 4 Testing Much of the initial Tag hardware testing was done during the circuit assembly phase of the project The same was applied to the software code development phase but some amount of time in the project time plan was also dedicated to the final testing of combined Radio Tag hardware and software The major testing phase of the Radio Tag was therefore divided into two phases which are described in the following sub sections 3 5 1 Software Testing The software testing was performed by using the RS232 Communication Port on the EasyPIC4 Development Board The development board also has push button switches for each of the pins on the board which could be used to apply 5v DC to any of the port pins 81 also see Appendix F MCU was placed the 18 way socket on the board and the RS232 port on the board was connected to the serial port on the PC using a standard serial cable The USART T
51. SR Communication Send File DEC D Send as typing Send as number Append CR CLF Format O ASCII Q HEX Connected to COM1 Received 2 Received 2 Received 2 Received 2 Received 16 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 154 Received 24 Figure 3 17 USART Terminal Window with Tag Serial Being Transmitted During the testing it was observed that in initial software code the DIP switches had to be put in right positions for expected serial number before powering up the circuit If the tag serial number was to be changed the MCU had to be reset The final software code was Ramiz Ahmed Radio Tag for Item Tracking 27 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report restructured to eliminate this effect and the command lines reading the tag serial number were put inside the While 1 loop This allowed the tag number to be changed without resetting the MCU circuit One of the features in the software was that the MCU would stop transmitting if all the switches are off or the tag serial number is zero 0 The test confirmed that MCU did not transmit any serial number when the Tag number was zero The figure also confirms that the sof
52. ag serial numbers were used to ensure correct operation of the software code Figure 4 9 below shows the result observed on the LCD screen when the tag number on the Radio Tag was set to 83 Figure 4 9 Complete Base Station Ramiz Ahmed Radio Tag for Item Tracking 44 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 4 2 Wireless RF Communication Testing After successful completion of wired testing phase the wireless RF communication link was tested The wireless communication link was attempted by connecting the AM2000 RX receiver to the EasyPIC4 development board The complete radio tag MCU TX was powered up using a standard 5V laboratory power supply Both the circuits were powered up and the LCD screen was observed for any signal reception Figure 4 10shows the setup for the RF Communication Link Testing i Pica Figure 4 10 Wireless Comm testing setup with Tag amp Base Station Separate After multiple testing sessions RF communication link between the two system components could not be established The Radio Tag had already been tested and its correct operation was already confirmed therefore the Base station circuit was checked for any abnormalities and wrong connections The module datasheet was again consulted but no fault could be identified The communication link was attempted again a
53. al Year Project Report APPENDIX G Relevant Pages from Micro Tx Transmitter Module Datasheet LPRS Data Sheet Micro Tx Transmitter Module The Micro TX is a Type Approved AM radio transmitter module operating at UHF frequencies It is compatible with both low cost super regenerative and AM superhet receivers By providing excellent RF performance in a Type Approved module the Micro TX minimises design costs and delays The sub miniature two pin package ensures that the module can be fitted into any convenient space on the user s board This makes it ideally suited to keyfob designs where space is often limited due to the demand for ever more compact designs The unique design Patent Pending of this module allows operation on any supply voltage between 2 5 and 13V simply by changing one external resistor Users requiring high performance from a compact transmitter will appreciate the efficient operation of the module when driving a tuned loop or short whip antenna Up to 6 dBm radiated power can be achieved with a 90 mm whip just over half the length of the usual 1 4 wave antenna It is compatible with most encoding ICs operating from 3V to 12V Features Applications Type Approved to MPT 1340 Low cost key fob designs Ultra compact two pin package Car alarm blippers Wide supply voltage 2 5 to 13 V Garage door openers Lighting controls Package Dimensions e T 8 5mm Technical Specification Ambient Temperature 20
54. amp Marker 70 Counter T Hz Res Ift Center Noise Mkr D Line x3 RefLvl E n de Down IE CF Step T Frequency Hz Fixed Level aly 0 0d8m P Time aly Os 00 Center 443 MHz Span 100 MHz Figure 3 20 Frequency Spectrum for Micro Tx Transmitter 433 MHz After confirming that the transmitter circuit and its output is satisfactory the Transmitter circuit was then connected to the MCU circuit and the complete tag was tested 3 5 3 Complete Tag Testing The complete tag was tested using two different techniques Initially the complete tag was powered up and the Tektronix Network Analyzer was used to observe the frequency spectrum output at different tag serial numbers Figure 3 21 below shows a screenshot of the output waveform observed at the network analyzer when the tag serial number was set to 63 Frequency Ampitude Marker Measure RBW LN 300kHe Mi 431 MHz 79 0 dBm VBW 1MHz M2 MHz dBm Center aly 443MHz SWT 55 13ms Ref 20 0 dBm Att OdB Span av 100MHz Level aly 20 0d amp m 23 Y x amp amp dem RBW 300 kHz 30 Frequency Start ala 393mhz 40 Stop alvi 493MHz CF Step aly 12MHz Span 50 Full Zero ak Last Zoom Signal Tracking amp 60 15 a Marker 70 ii zr Excu
55. ase Station Code K k Kk K K Kk k Kk k k k k KK KKK KK KK KK KKK KK KKK KK KK KK ck Filename Tag_Rx c Date 04 03 09 File Version 3 0 Compiler MikroC Compiler Course BEng Digital Systems amp Computer Engineering Programmer Ramiz AHmed KKK KKK KKK ck ck ck kk Sk ke ke kk kx A A x kx ko ko Variables OKCKCKkCkCk ck ck ck ckck kk ko ke kk kk kk kk ok kk ek ke kk koe ke ke ke ke ke char textO0 Tag char textl Tracker char text2 Active char text3 Tag char text4 Missing define buffer length 35 int rx buffer buffer length int tag_lookup 3 2 int column 0 int row 0 char tag_temp 4 int a int i aint Jy int tag array 3 2 1 0 2 0 3 01 k k k k k k k k k k k k k k Functions k k k k k k k k k k k k k k k k K k k k k k k k KOK k K K eek void pic setup Initialise Port amp USART Values for PIC void welcome msg Displays a Welcome Message on Power Up void scan msg Displays Message Before Scanning for Tags void no tag Displays Message if No Active Tags void clear buffer Clear the Receive Buffer void ser rx void Receive the Data from the Receive Port void disp tag active int number Display What Tags are active void disp tag missing Display if a Tag Goes Missing 8K Ck RRR k koe k oko
56. be used in the Base Station The MCU also supports USART communication making it useful for communication between radio receivers The table below highlights the most important features of the MCU relative to the project For detailed information about the MCU architecture its datasheet should be referred Table 5 PIC 16F877A Specifications Parameter Name Value PIN Diagram Program Memory type Flash Program Memory KB 14 40 Pin PDIP MCLRIVPP gt O 1 RB7 PGD CPU Speed MIPS 5 RAD ANO _ 2 RBEGPGC RAM Bytes 368 RA1 AN1 3 RB5 RA2 AN2 VREF ICVREF 4 RB4 Data EEPROM bytes 256 RA3 AN3 VREF 5 RB3 PGM RA4 TOCKIICIOUT lt 6 RB2 Timers RAS AN4 SSICOOUT 7 amp RBI bit REO RD ANS 8 5 RE1 WR ANG 4 VDD ADC 8 ch 10 bit RE2 CS AN7 3 4 Vss VDD gt 5 lt RD7 PSP7 Comparators 2 VSS RD6 PSP6 z OSC1 CLKI gt RDS5IPSP5 Serial Comms MSSP USART OSKO RD4IPSP4 1 0 Ports Ports A B C D E RCO T1OSO T1CKI RC7IRXIDT i RC1 T1OSI CCP2 RC6 TXICK Instruction Set 35 Instructions 2 1 RC5S SDO RC3 SCK SCL RC4 SDI SDA Resets POR BOR RDO PSPO lt gt lt RD3 PSP3 Temperature Range C 40 to 125 RDI PSP1 RD2 PSP2 rating Vol Operating Voltage 2105 5 F
57. dulation Input Output MCU Microcontroller Unit Ofcom Office of Communication RF Radio Frequency RFID Radio Frequency Identification Rx Receiver Tx Transmitter Ramiz Ahmed Radio Tag for Item Tracking vii Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 1 INTRODUCTION This report details the steps taken and the methodologies adopted in order to achieve the aims and objectives for the project This document is intended to be read by electronic engineers or technologists and contains complete details of project research design and testing of Radio Tags for Item Tracking 1 1 Project Description Radio Frequency Identification RFID is no longer an emerging technology in today s world Billions of tags are manufactured and used every year around the world These tags not only just provide an alternative to traditional barcodes as form of automatic identification but they are also an efficient way to reduce human intervention and space required to identify track and trace items The most common implementation of the technology is by using a RFID Tag and a RFID reader the two components interact with each other using Radio Frequency RF in order to store and remotely retrieve data The key aim of this project was to develop system to detect when an item is removed from the area where it should be kept The system should be suitable for
58. e Vero Board to hold the AM Receiver This was done to avoid soldering the sensitive pins of the Receiver on the board and potentially damaging the circuitry due to excessive heat during soldering This also provided modularity in the circuit as the receiver module could easily be taken off from the circuit board if required 4 2 3 Complete Base Station Assembly The complete Base Station was assembled by connecting the AM2000 RX module with the EasyPIC4 development board by using a 3 wire cable The cable was made by soldering three colour coded wires to a 10 pin connector The two wires Red and Black were used for the power supply BV and OV respectively to the receiver circuit The third wire purple was used to transmit data signals between the receiver and the microcontroller One end of the end of the 3 wire cable was connected to the direct port access pins for PORT C The RC7 Pin of the MCU see figure 4 2 is the RX Pin which is used to receive the USART data The data cable used in the interconnection was therefore connected between the RC7 pin and the DATA pin on the AM2000 RX module The figure illustrates the complete Base Station hardware with important components indicated using pointers Ramiz Ahmed Radio Tag for Item Tracking 37 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Figure 4 5 Complete Base Station 4 3 Microcontrolle
59. ect Report The antenna used with the module is a 1 4 wave whip antenna which was recommended in the product datasheet for best performance The whip antenna is a monopole antenna with a single driven element and a ground plane The antenna is stiff but flexible wire mounted and their length determines their wavelength although it could be shortened with a loading coil anywhere along the antenna Whips are generally a fraction of their actual operating wavelength with half wave and quarter wave whips being more common ner They are particularly useful in situations where flexibility is an important issue and the antenna shouldn t break when struck The characteristics of antenna were also feasible for the application criteria of the radio tags In order to achieve low impedance return path for power and signals at all frequencies in RF system an effective ground plane is always required In ideal RF systems all pointes connected to the ground must be at the same potential but in active RF systems it is not deemed an easy task due to presence of high frequencies Common PCB s have effective inductance at their ground tracks To overcome the effects of inductance problem a continuous conductive ground plane board can be used In a ground plane prototype board one side is dedicated to running all of the necessary interconnections between components The other side is a continuous copper layer and all ground connections are made to the
60. elopment data acquisition conversions displays communications etc Ramiz Ahmed Radio Tag for Item Tracking 18 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report e Monitor the program structure variables and functions in the Code Explorer Generate commented human readable assembly and standard HEX files compatible with all programmers e Inspect program flow and debug executable logic with integrated Debugger Get detailed reports and graphs on code statistics assembly listing and calling tree e Availability of plenty of examples to expand develop and use as building bricks in projects One of the other features of the MikroC is its integrated tools One tool of special interest in relation to this project is the USART Terminal the USART Universal Synchronous Asynchronous Receiver Transmitter communication terminal for RS232 communication it The tool was used during the testing stages of the project to verify the output of the microcontroller used in the Radio Tag Further information about the MikroC compiler and development tool could be obtained by referring to its user manual and documentation 9 9 Although the University had a full licence of the MikroC software much of the software code was developed using the demo version of the software The demo version has almost all the operational features of the full version except the usage of some
61. en compete Mak Comparon grits aopa bb fh Board 65 1741 hasa af BIAT pa lan alga ef h oea CANDEL 127 m afta nd Aot nadar Sgan pag board Ordi ng information No of Pads Order wah deo 102 2391 3 03 0026 100x220 m Buy gass 0327555 2 34 18 2 Epig past 03 0111 84 0 E Eyga 09 27556 134122 5 Ts Epro pass 03 27657 Mab Hola grit 2 542254070 Hab 1 Aem 353p gap an Mura boards Square pad board with colander ground plane A singie Eurocard simis 90 the srandand square pad bas dbu ateringtne 0011021 advantage at OV colender ground pare Festures 8 Maimun derety using herd wire ar wre wrapping 18 Colander ground pne hr maximum screening DIN4184 share carpit and DIN 41612 connects patien up tu 66 86 wig Gidrerenpestp teh sites df bord eps ani o 1535 wiring B tedpene compat 9 Bond TL Basa Onder won cote TRG 34 092000 sales 44 0 87 9505 salesQ verotech co uk www verotl com VER TECHNOLOGIES 7 Ramiz Ahmed Radio Tag for Item Tracking 71 University of Hertfordshire School of Electronic Communication and Electrical Engineering APPENDIX M Relevant Pages from PIC 16F877A Datasheet MICROCHIP PIC16F87XA 28 40 44 Pin Enhanced Flash Microcontrollers Devices Inc
62. ent Board User Manual 61 APPENDIX G Relevant Pages from Micro Tx Transmitter Module Datasheet 63 APPENDIX H Radio Tag Circuit Schematic nenne 65 APPENDIX I Radio Tag Software Code amp Data Flow 66 APPENDIX J Radio Tag Testing Results U 67 APPENDIX K Base Station Software Code and Data Flow 68 APPENDIX L Colander Vero Board 71 APPENDIX M Relevant Pages from PIC 16F877A Datasheet 72 APPENDIX N Relevant Pages from AM2000 RX 433 Receiver Module 74 APPENDIX O Email Correspondence with LPRS about AM2000 Receiver Module 76 Ramiz Ahmed Radio Tag for Item Tracking iv University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report LIST OF FIGURES Figure 1 1 Conceptual System Block Diagram sees 2 Figure 3 1 Block Diagram of the Radio Tag seen 7 Figure 3 2 PIC 16F88 Pin Diagram 1 8 Figure 3 3 Diagram for EasyPIC4 Development Board explaining key components 9 Figure 3 4 Complete Radio Tag
63. ent temperature under bias sienne ener d 55 to 125 C 3E 85 C to 150 C Voltage on any pin with respect to VSS except VOD MCLR and 4 0 3V to VOD 0 3V Volkage VOD wifi respect lo VEO JU ULU UY Ai i tera REI E s D 3 to 7 5V Voltage on MCLR with respect to VSS Note 2 to 14V Voltage on RA4 with respect to Vss Tota power dissipation Note 1 U to 8 5V Medmunm cures out of VES UU UUUUUUUU J LLLLUUUU UU ULU U L Qu uu Maximum current into VDD pin Input clamp current HK VI lt 0 or VI gt Vpp Q L20 mA Output clamp current IOK VO lt 0 or gt VDp0 U U U u 20 Maximum output current sunk by any IO Maximum output current sourced by any pin Maximum current sunk by PORTA PORTB and PORTE combined Note 3 Maximum current sourced by PORTA PORTB and PORTE combined Note 3 Maximum current sunk by PORTC and PORTD combined Note 3
64. ept port RB5 are declared as input as well RB5 in Port B is declared as output since this is the RB5 Tx pin of the MCU Following the port declaration is a FOR loop at lines 63 66 see figure below The FOR loop starts at zero and terminates at value 7 The purpose of the FOR loop is to initialize all the values in the TagNo array to zero This is necessary because otherwise the compiler would store random values in the array and this could result in unexpected code behaviour or wrong Tag serial number during program execution During each iteration the following line stores zero at that corresponding value of the array TagNo j 0 Assign O Value in all values of TagNo Array Figure 3 15 below illustrates the last part of the version 2 of the initial software code Ramiz Ahmed Radio Tag for Item Tracking 23 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 63 for 3j 0 j lt 7 3 64 65 TagNo 3 0 Assign 0 Value in all values of TagNo Array 66 67 68 TagNo 0 PORTA FO Assign ist Dip Switch to Port A Pind 69 TagNo 1 PORTA F1 Assign 2nd Dip Svitch to Port A Pini 70 TagNo 2 PORTA F2 3rd Dip Svitch to Port A Pin2 71 TagNo 3 PORTA F3 Switch to Port A Pin3 72 TagNo 4 PORTB FO Switch to Port B Pino 73 TagNo 5 PORTB F1 Switch to Port B Pini 74 TagNo 6 PORTB F2 Svitch to Port B 2 75 TagNo 7
65. equirements to high the internal and external current draws inside the chip change which produce fluctuations in the internal voltage levels of the microcontroller chip causing it to lock up reset Ramiz Ahmed Radio Tag for Item Tracking 12 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report or behave unpredictably in other ways The decoupling capacitor filters the power fluctuations and provides a stable power supply for the chip 4 Therefore a 100uF electrolytic capacitor was connected between the all the Vpp pins and wired to ground as shown in Fig 3 5 below FIC 16F88 MicroController Decoupling Capacitor a it Figure 3 5 Decoupling a PIC 16F88 MCU The circuit design involved connecting an 8 pin DIP switch see figure 3 6 below to the microcontroller As described in Section 2 1 the DIP switch is used to input the Tag serial number into the microcontroller DIL Switch Microcontroller Battery Figure 3 6 Radio Tag Block Diagram Since the microcontroller would read the DIP switches as individual binary numbers the 8 Switches could provide us with a possible 2 1 255 different tag numbers A pin map of the DIP switch with the microcontroller ports and their equivalent decimal value is given in figure 3 7 below MCU Port No Decimal Value Figure 3 7 Pin
66. erminal tool in the MikroC programming software was used to test different outputs of the software Ramiz Ahmed Radio Tag for Item Tracking 26 Universityof Hertfordshire B School of Electronic Communication Electrical Engineering BEng Final Year Project Report After connecting the serial cable to the PC and setting up the USART terminal tool at the correct baud rate and COM port the Development board was powered up and then the push button switches were used to test pre calculated tag numbers Different combinations of push buttons were pressed to check for expected Tag Number The process was repeated for multiple tag numbers until the results were deemed satisfactory The table below shows different switch combinations and expected Tag numbers in decimal and hexadecimal Figure 3 17 shows a screenshot of the USART Terminal window when different button combinations were pressed Table 4 Examples of Tag Numbers according to DIP Switch Orientation DIP Switch Orientation Decimal Tag Hexadecimal Tag 81716151413 21 1 2 0X02 1 16 0x10 1 0 0 1 1 101 11 0 154 0 9 010101 1 1 01 010 24 0 18 Communication Terminal Settings Com Port Baud Stop Bits Parity Data bits Commands RIS Of Status Send e Log Files Read from Write to Receive e DTR Off On Disconnect CTS D
67. esign and Assembly The AM200 receiver circuit was assembled on a Colander Vero Board see Appendix L to ensure good ground plane was provided to the receiver for RF frequency operation The 1 4 wave antenna used with the Receiver was identical to the antenna used with the Micro Tx module The antenna was mounted on the top side of the Vero Board on the ground plane using a SMA connector The connector legs were again bigger in the diameter than the through holes and therefore the holes on the board were enlarged by drilling through them Figure 4 4 below shows the pin diagram for a In order to enable the receiver module following steps were taken in the circuit assembly Ramiz Ahmed Radio Tag for Item Tracking 36 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report e GND Pin 10 and RF GND Pin 1 pins of the module were connected to the OV earth plane on the board e The Shutdown pin Pin 12 was also pulled down to enable the module e The bandwidth selector jumpers SEL 1 and SEL 0 were already set to logic low 0 to enable the bandwidth selection of 1 25 KHz to match 1200bps data rate of the Tag 22 Figure 4 4 AM2000 RX433 Receiver Pin Diagram In order to eliminate any unwanted oscillations in the circuitry on the Vero Board the receiver and the antenna were placed as close to each other as possible A 10 Pin socket was soldered into th
68. evelopment was chosen as the ideal hardware solution to incorporate all these components in one prototype The development board comes with a PIC 16F877A microprocessor and a 16 x 2 LCD The PIC MCU was therefore chosen as the MCU for base station and LCD was used to display data The development board also has 36 LED s see Appendix G which could be used to indicate any circuit operation The development board has separate 10 pin port access pins which could be used to connect the RF Receiver and alarm system to the microcontroller After hardware research and consultation with experts the AM2000 RX433 receiver was chosen as the suitable RF receiver to interpret the signals from radio tags The AM2000 receiver works at the UK Licence exempt frequency of 433 MHz and uses Amplitude Modulation Technique to interpret the radio signals The Receiver is manufactured and recommended by the manufacturers of the Micro Tx Transmitter Module used in the Radio Tag The following sub sections further detail the features of the components used in the Base Station Ramiz Ahmed Radio Tag for Item Tracking 33 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 1 1 PIC 16F877A The PIC 16F877A microcontroller is a FLASH based 8 bit microcontroller manufactured by Microchip The MCU used in the base station comes in a 40 pin package and has a string of features that make it ideal to
69. function generates a returns a pseudo random number between 0 32767 However by taking a modulus of the random by dt 500 the value of the random number is limited to 0 500 and therefore the final random time delay is always in between 250ms 750ms Line 81 stores the decimal value of the tag serial number by calling the b2dec function The next line in the code does a conditional check on the decimal value of Tag No Although in practical cases there will not be a radio tag with serial number 0 this conditional check was added for exceptional cases and for software testing purposes If the Tag number is zero the program goes back into a loop However if the tag number is greater than zero then the tag number is transmitter through the USART port using USAHT write command Following the Ramiz Ahmed Radio Tag for Item Tracking 24 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report write command there is a variable delay in milliseconds before the program goes into another loop The variable delay is used as an anti collision technique to avoid signal collisions when multiple tags are transmitting to the same base station simultaneously Much of the anti collision technique is discussed in the Testing part of this chapter The EasyPIC4 board mentioned in 3 1 2 has on board P CFlash2 Programming software which was used to program the PIC mic
70. ground plane In the case of through hole mounted components a plated through hole is normally provided whereas for surface mounted components or prototype construction components can be soldered directly to the ground plane 2131 To achieve the best possible performance and reliability in RF system the transmitter circuit was assembled on a Colander Vero board The Vero board is made of epoxy glass with a colander ground plane for maximum screening see Appendix L Since the circuit is an Ultra High Frequency UHF RF system all the components were soldered as close to each other as possible to avoid unwanted oscillations and impedance from the circuit board A SMA connector was mounted on top of the circuit board to fix the antenna vertically down and the connection between the antenna and the inductor in series with the module was established by soldering the connector pin onto the circuit board The SMA connector legs were too big in diameter for the through holes on the board so the holes were enlarged by drilling through them The connector legs were then soldered onto the ground plane to ensure good grounding A picture of the completed circuit for the Micro TX Transmitter module is given in the figure below Ramiz Ahmed Radio Tag for Item Tracking 17 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Figure 3 12 Complete Circuit for the Micro TX T
71. icient detail misleading circuit schematics and the software code was insufficient for the operation of the whole tracking system It was therefore chosen to start the project from scratch by doing the research on the RF frequency to be used and evaluation of the components used in the previous year 2 1 1 RFID Tags The most common implementation of RFID Technology is in RFID Tags used for tracking and or identifying objects whether material or human The Radio Frequency RF Tags usually consist of at least two essential parts an integrated circuit to store and process information RF modulation demodulation etc And an antenna for receiving and transmitting the radio signals According to the number of components the Radio Tags could then be classified as Read Only The data stored on the tag could only be read if the tag is within the range of the reader and cannot be edited in anyway Read Write Tags The data on these tags can be edited added to or completely rewritten but again only if the tag is within the range of the reader Ramiz Ahmed Radio Tag for Item Tracking 3 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The Tags are then further classified in the types depending on the type of power circuitry These types include 22 e Active Tags These contain a battery that powers the microchip and allows the tag to transmit periodic signa
72. igure 4 2 PIC 16F877A Pin Diagram Range V Pin Count 40 Due to the fact that the MCU was supplied with the development board the sourcing cost for the MCU could be considered negligible Details of Electrical Characteristics of the microcontroller have been added in Appendix M along with datasheet pages related to the project Ramiz Ahmed Radio Tag for Item Tracking 34 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 1 2 AM2000 RX 433 Receiver The AM2000 RX 433 Receiver is a simply to apply AM receiver for operation at frequencies of 418MHz 433MHz and 868MHz The low radiated emissions from the receiver ensure compliance with EMC requirements The module requires only a clean DC supply of 5volts an antenna and a suitable device for decoding the incoming digital data All transmitters and receivers require antennas in order to work efficiently the AM2000 receiver also requires a 1 4 wave whip antenna approximately 16cm for best performance The antenna however should be mounted in free space and well away from any conductive objects or surfaces 22 Table 4 2 details the absolute maximum ratings and performance specifications of the AM2000 Receiver 221 Table 6 Absolute Maximum Ratings of the AM2000 Receiver 22 Parameter Name Value Units Supply Voltage 0 3 to 5 25 Volts Receive Frequency 433 92 MHz
73. inal costs of the project according to market point of view The last section of this chapter discusses the recommendations on the supplementary work related to the overall Radio Tag Tracking System and also highlights precautions regarding certain components and overall project progress 5 1 Project Outline and Achievements The main aim of this project was to develop a system which could track the radio tags associated with the system The main part of the project was the development of a suitable radio tag and consequently a base station which could keep track of the base system As explained in chapter 1 certain operational criterion was set for both the radio tag and the tracking system The criterion for the radio tag included the compact size battery operation and RF frequency operation The criterion for the Base Station required a display an alarm system and a suitable RF signal receiver The selection of suitable RF Frequency to work on required a careful research to identify a low power licence exempt frequency The 433 MHz operating frequency was chosen after consulting the documentation on communication regulation imposed by the local regulation authority OFCOM 5 1 1 System Hardware Design and Assembly The Radio Tag hardware was selected after considering all the operational requirements A PIC16F88 microcontroller was used to read in the tag serial number selected using 8 DIP switches the miniature Micro Tx transmitter worki
74. ire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report considered individual numbers and thus a wrong set of values would ve been transmitted through the USART One of the possible approaches towards transmitting the tag number correctly was to convert the individual binary bits in the array to a decimal number and then sending that decimal number or its hex value through USART But the limitations in the demo version of the MikroC software didn t allow the user of the power function 181 convert individual binary numbers to their corresponding decimal number As a solution to the demo version limitations a binary to decimal conversion function along with a binary power converter function were written within the software code This slightly increased the memory usage and function call number in the overall program but since the overall program execution was very efficient addition of these extra functions did not have any noticeable effect on operation of the microcontroller The initial software code has been added in the figures below The code is distributed into three figures to assist in explanation of the functionality of the code The complete software code has been added into Appendix K C Users RizMeistro Tag Tx Tag_Tx c 14 04 2009 02 39 25 FRR ERE e de ARERR RRR RRR EAR RR float unsigned short TagNo 8 int i 2 dnb 347 int tempi int temp2 in
75. items such as furniture that need to be moveable within their normal area of use and cannot easily be fitted with a security cable It could also be used for computers whether desktop or portable Unlike security tags used in shops this system was not to require a barrier or arch to detect when tags are moved out of the permitted area 1 22 Project Objectives In order to progress towards the aims of this project certain objectives were highlighted and carefully planned tasks were devised Further detailed specifications for the tracking system were then highlighted in the following points Design and development of a low cost compact and battery operated Tag e System should have a base station that can receive signals from up to 256 tags e The distance should be adjustable in the range 1 20 metres e The alarm should include a siren and a programmable voice announcement e There should be two types of tags a simple transmit only tag and more advanced transmit receive tag e There should be a portable receiver that can be used to locate tags that have been removed from the permitted area by searching for the radio signals from the tag e Inthe case of a transmit receive tag there should be an option to send a command to the tag to emit a beeping sound Ramiz Ahmed Radio Tag for Item Tracking 1 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Pro
76. ject Report Figure 1 1 Below Illustrates a conceptual block diagram of the Tracking System that was envisaged during the feasibility study stage of the project plan The feasibility study is discussed in detail in the second chapter of this report RF E e I I Hi Antenna LEO Alam Communication Fi 8 er Easy PIC4 Development Kit a Battery Antenna Base Station Figure 1 1 Conceptual System Block Diagram 1 3 Report Outline The main focus o this report is to facilitate the reader with all the details of the project research design testing and implementation in the development of the Tag Tracking system The different chapters in this report discuss the following project stages e Chapter 2 provides a brief overview of the initial feasibility study on the research topic the project stages and project time plan The initial literature and hardware research done in accordance with the project time plan is also discussed in the later sub sections of this chapter e Chapter 3 covers a detailed description of the project management aspects of the Radio Transmitter Tag part of the tracking system It details the hardware design hardware assembly software design and testing of the Tag e Chapter 4 details the second part of the tracking system and details hardware and software design of the Rx Base Station part of the Tracking System e Chapter 5 provides
77. k k k k k k k k k k k k k ke K k K K K Tag Active Message k k k k k k k k k k k k k k k k k k k k k k k k K void disp tag active int number Lcd Cmd Lcd CLEAR Lcd Cmd Lcd CURSOR OFF byteToStr number tag temp First Tag Line Lcd out 1 1 Tag Lcd out 1 4 tag temp Lcd out 1 9 Active delay ms 100 Second Tag Line BOK kk kk koe ke ko kk koe ke ke e ee Tag Missing Message aaa ke eee A void disp tag missing Lcd Cmd Lcd CLEAR Lcd Cmd Lcd CURSOR OFF Lcd out 1 1 Tag Lcd out 1 5 tag temp Lcd out 1 9 Active Second Tag Line void main ANSEL 0x00 pic setup welcome msg scan msg dot while Usart data ready If no Data on USART Display No Tags amp Sound Alarm no tag portb f7 1 lcd cmd lcd clear clear buffer if USART Data Ready Keep looping until no more chars Portb F7 0 for 1 0 1 lt 1 rx buffer i USART Read put char in element amp then increment index disp tag active rx buffer i while 1 Ramiz Ahmed Radio Tag for Item Tracking 69 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Receiver Basic Data Flow Chart Initialise Ports Display Start
78. kipedia 2008 Decoupling Accessed on 14 April 2009 Available at http en wikipedia org wiki Decoupling Malik Z Radio Communication Link for Unmanned Aircraft System 0 5 Final Year Project Thesis University of Hertfordshire 2008 Ramiz Ahmed Radio Tag for Item Tracking 51 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 13 14 15 16 17 18 19 20 21 22 23 Lauder D 2008 09 RF Engineering 3ELE0073 Lecture Notes distributed in the topic Practical Design Issues at Radio Frequencies University of Hertfordshire Predko Michael Programming and Customizing the PIC Microcontroller Edition McGraw Hill c2001 Chapters 1 3 Network Resistor Picture amp Theory online Accessed on 14 April 2009 Available At http hobby elec piclist com e resistor htm Wikipedia 2008 Whip Antenna online Accessed on 14 April 2009 Available at http en wikipedia org wikiWhip antenna LPRS 14 Wave Whip Antenna Product Datasheet Low Power Radio Solutions 2008 Available at http docs europe electrocomponents com webdocs 0685 0900766b80685dac pdf mikroElektronica MikroC Reference Manual 2005 Downloaded on 16 December 2008 Available At http www mikroe com pdf mikroc mikroc manual pdf mikroElektronica Reference Guide for MikroC Downloaded
79. ld be used to reduce component costs Tag Circuit on PCB would mean the PCB loop antenna could be Ramiz Ahmed Radio Tag for Item Tracking 49 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report used for RF transmission this could further reduce extra costs incurred in external antennas and would significantly reduce the overall Tag size Microchip the manufacturers of PIC 16F88 microcontroller also manufacture MCU s with Built in RF Transmitters One such low cost RF microcontroller is XXX which operates at the licence exempt frequency of 433MHz Further research into the operation of this microcontroller is recommended prior to development of a PCB for the Radio Tag If the above said MCU is found feasible for the project application this could not only reduce the project costs and size it could improve the potential for industrial application of this research project To summarize transfer of Tag circuit to a PCB is strongly recommended however this should only be done after exploring the possibility of low cost RF microcontrollers during the feasibility study stage in the future project 5 3 2 Base Station The current Base Station circuit is currently assembled onto an EasyPIC4 Development Board which requires that it should always be connected either to a mains power supply or a computer for operation Due to selection of a wrong type of receiver
80. lity of type approved components from manufacturers within the UK and low power radiation meant less battery usage and limited range communication 2 2 Hardware Selection The feasibility study also included the initial costing for the project detailing the components that could be required to complete the project and costs for each of the components A table detailing costs of the main components used during the project is included later in this section A detailed component list has been added in Appendix B 2 3 Hardware Design and Assembly The hardware design and assembly was also divided into two stages The first stage involved design and assembly of the Radio Tag part and the second stage involved design and assembly of the Base Station interface of the project The selection of hardware components was based on a range factors which were essential to project aims and objectives and time plan The selection depended on e Radio Frequency Licensing The RF frequency being used should be license exempt in UK and or EU and the components operating at those frequencies should also be certified by OFCOM and have low transmission power Size Since the tags were to be used on movable items the size of the tag was to be kept minimal with as little components as possible e Power Consumption The power consumption of the components was to be kept significantly low in order for tags to be operated using a standard battery over a
81. ller into its relevant socket and then program it through the USB connection using the P CFlash2 Programming software supplied with the development board PI RS232 communication with selectable TX and MikroElektronika TooLs CommLsns BooKs Worn cni RO 6 External power supp from 8 p 16 V ACDC USB communication for MCU with USB support Pins RAO RAS can be con nected to potentiometers P1 and P2 keyboard input 23 Ps le gea Jen v2 12 woj Seven segment ds plays in muitipiex mode for displaying values For micsocon silers in DP28 and DIP18 package For miooonyoiers in DP20 DP14 and DIPS package Choose between external or USB power supply With USB power supply selected you dont need external sup py Very fast and fexibie USB 2 0 programmer on Port A is connected to a resistor network using switches SW1 If a switch is in the OFF position the appropriate pin has neither pull up or pull down resistor attached board with mikrolCD In Circut Debugger Turns ON or OFF the LEDs on ports A B C D and E Turns ON or 777 OFF seven segmnet displays DS1820 temperature sensor can be conneced to RE2 or RAS pin Reset circuit Choose how pressng the button will affect the pin high state or low state DEVELOPMENT TOOL FOR MICROCHIP PIC MCUs Figure 3 3 Diagram for EasyPIC4 Deve
82. lopment Board explaining key components Ramiz Ahmed Radio Tag for Item Tracking i i i Graphic LCD connector GLCD LCD contrast MIKROELEKTRONIKA MICROCONTROLLERS DEVELOPMENT Setting jumper to the upper position sets pins of the appropriate x port to logical one put up If jumper set to lower postion pins are set to logical zero put down EasyPIC4 supports microcontroller in DIP8 DIP14 DIP18 DIP20 DIP28 and DIP40 package which means you are ready to use almost the entire range of Microchip Microcontrotiers CowPiLERS Books 8 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The EasyPIC4 development board features a number of peripheral devices and therefore in order to enable these devices before programming any PIC microcontroller it is important to check if appropriate jumpers or switches have been properly set Although the board has numerous components and peripheral devices components relative to this project have only been explained in Appendix F For further information about board operation the user manual for EasyPIC4 development board should be consulted 81 3 1 3 Micro TX Transmitter Module Micro TX is a low cost type approved RF transmitter which works at UHF Ultra High Frequency manufactured by Low Power Radio Solutions The module is co
83. ls to the reader e Passive Tags These kinds rely solely on the power generated by the electromagnetic waves transmitted by the reader the waves are absorbed by the antenna within the tag to generate current for microchip to start transmitting information This means these tags have to be within the range of the Reader for detection which would generally be a barrier or Arch e Semi Active or semi passive Tags These contain a battery to run the circuitry of the chip but need to draw power from electromagnetic waves in order to communicate with the reader The addition of battery in active tags makes them considerably expensive compared to passive tags Their overall life time is also reduced since battery s have only finite amount of electricity in them However Active Tags have better application potential since they do not require any barrier or arch to detect them It was after this initial research it was decided to use Active Tag circuit methodology for the Radio Tags in the project The active tags allow flexibility in design aesthetics like cost design size and weight as they do not specifically need to be miniature in size 2 1 2 Radio Frequency Bandwidth Selection The allocation of radio spectrum in UK is regulated by the standardization organisation Ofcom The body defines and monitors the allocation of radio frequency bandwidths and classifies them in different applications like radio and TV broadcasting for teleco
84. luded in this Data Sheet PIC16F873A PIC16F874A PIC16F876A PIC16F877A High Performance RISC CPU Only 35 single word instructions to learn single cycle instructions except for program branches which are two cycle Operating speed DC 20 MHz clock input C 200 ns instruction cycle Up to 8K x 14 words of Flash Program Memory Up to 388 x 8 bytes of Data Memory RAM Up to 258 x 8 bytes of EEPROM Data Memory Pinout compatible to other 28 pin or 40 44 pin PIC18C XXX and 1 microcontrollers Peripheral Features 0 8 bit timer counter with 8 bit prescaler Timer1 16 bit timer counter with prescaler can be incremented during Sleep via external crystal clock Timer2 8 bit timer counter with 8 bit period register prescaler and postscaler Two Capture Compare PWM modules Capture is 16 bit max resolution is 12 5 ns Compare is 16 bit max resolution is 200 ns PWM max resolution is 10 bit Synchronous Serial Port SSP with SPI Master mode and 7 Master Slave Universal Synchronous Asynchronous Receiver Transmitter USART SCI with 9 bit address detection Paralle Slave Port PSP 8 bits wide with external RD WR and CS controls 40 44 pin only Brown out detection circuitry for Brown out Reset BOR Program Memory Device i SRAM Single Word 6102 0102 2
85. ly rail As all the electronic devices need a ground connection to work pin 5 Vss of the microcontroller was connected to ground OV rail The ground rail was made a common ground between all the components on the circuit board The microcontroller has a MCLR pin 4 RA5 MCLR Vpp which could be used to RESET the microcontroller so that it should start executing its program code from the beginning Since the project aims and objectives did not require the Tag to be reset at any time in operation no Reset button was added to the tag circuit However the MCLR pin needs to be pulled to the Vpp 5V in order to allow the microcontroller to start working But voltage spikes at the MCLR pin can cause the processor to latch up so rather than tying the pin directly to VDD a series resistor of value 10 kilo ohm was used to pull MCLR to VDD l One important step during the power supply management of the circuit was to ensure decoupling of the power supply rails Most power supplies sometimes supply an AC signal superimposed on the DC power line such noise signals are mostly undesirable in powered circuits 111111 and in RF systems these noise signals can easily result in unwanted oscillations A common RF decoupling technique is to feed the DC supply to each stage through a path that has high impedance at signal frequencies but low impedance at DC 121151 During transition of the circuits from one state to another and from low current r
86. mmunication operators for defence forces and for civilian use Generally in order to use a classified radio frequency band a formal permission from the governing bodies is a pre requisite The standardization of telecommunication equipment and network in Europe is controlled by European Telecommunication Standards Institute ETSI l Office of Communication Ofcom mainly controls the standardization of RF spectrum within UK it overlooks industries like telecommunications broadcasting intelligent transportation professional and amateur radio broadcasting and etc Ofcom has allocated some frequency bands in the UK RF Spectrum with licence exempt classification without licence approval The band allocations have carefully been allocated and listen in the official RF Spectrum Allocation Table and extract from the Issue 15 of the allocation table has been added into Appendix C It was after carefully consulting this Ramiz Ahmed Radio Tag for Item Tracking 4 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report allocation table the Radio Frequency of 433 MHz was chosen as the suitable frequency for communication for this project The frequency band 432 438 is licence exempt and the frequencies in the lower end of the band have maximum radiated power of only 1 mW The frequency was deemed suitable for application in this project because of ready availabi
87. mpatible with low cost super regenerative and AM superhet receivers The datasheet for the module was consulted before purchasing the module to ensure it s electrical and hardware specifications were in accordance with the project aims The module has a sub miniature two pin package which makes it very useful to be applied in circuits where space is limited and the overall circuit design is compact Since one of the aims of the projects was to create a radio tag which is compact in size the Micro TX module passed the selection criteria The unique design of the module allows it to be operated on any supply voltage between 2 5 and 13V simply by changing one external resistor and it is compatible with most encoding ICs operating from 3V to 12V The transmit pin on PIC 16F88 microcontroller works at 5V DC which ensured the electrical specifications of the module were compatible with the microcontroller The module works at 433 845 MHz frequency and can achieve up to 6 dBm radiated power with a 90mm whip antenna however its best operational performance could be achieved by using a standard 1 4 wave whip antenna The antenna used with the module was therefore chosen as a wave whip antenna to allow for best operational performance The datasheet for the module also stated that it has an operational range of up to 100 metres P That ticked another of the selection criteria of tag range to be from 1 20 metres Table 2 details
88. n and Electrical Engineering BEng Final Year Project Report APPENDIX C Relevant Part of UK Frequency Allocation Table for Frequency Use Frequency Allocation Band with 433 MHz frequency allocation shown Region 1 Region 2 Region 3 420 430MHz FIXED MOBILE except aeronautical mobile Radiolocation 5 260 5 270 5 271 430 432MHz 430 432MHz AMATEUR RADIOLOCATION RADIOLOCATION Amateur 5 274 5 272 5271 5276 5 277 5278 5270 5 273 5274 5275 5 276 432 438MHz 432 438MHz AMATEUR RADIOLOCATION RADIOLOCATION Amateur Earth exploration satellite Earth exploration satellite active 5 2794 active 5 270 5271 5276 5 277 5138 5271 5272 5276 5277 5 280 94 5282 278 5270 5 281 5 282 438 440MHz 438 440MHz AMATEUR RADIOLOCATION RADIOLOCATION Amateur 5271 5273 5274 5275 5271 5276 5 277 5278 5270 5 276 5 277 5283 Ramiz Ahmed Radio Tag for Item Tracking 56 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX D Relevant Part of UK Frequency Allocation Table for Radiated Power Radiated Power Allowed in 433MHz Band ia me oma 13553 13567 kHz 42 dBuA m 10 40 66 40 7 MHz Sm Um im Ceweexnwe C mw J sw 868 868 6 MHz 868 7 869 2 MHz 860 4 860 65 MHz 860 7 870 0 MHz 2400 0 2483 5 MHz 5725 5875 MHz 24 00 24 2
89. n the code calls the power function the input to the function is the iteration number in the Ramiz Ahmed Radio Tag for Item Tracking 22 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report FOR loop The returned value from the power function is added to the current value of the decimal variable and the resultant value is stored back to the decimal variable All of these operations are done in one code line i e decimal decimal Power temp1 After termination of the FOR loop the final value in the decimal is returned to the calling function The main body of the program starts at line 52 Lines 53 60 contain the code which configures the registers ports and interrupts in the PIC microcontroller The following lines ANSEL 0x00 INTCON 0x00 Disable the analogue to digital converter and interrupts within the PIC MCU as they are not necessary in the operation of MCU in this particular application The next lines configure the pins in PORTA and PORTB as inputs outputs individually and initialize them at logical value zero PORTA 0x00 Initialize Port A at Zero Logic Value 0 00 Initialize Port B at Zero Logic Value TRISA 0611111111 Declare Port A as Input TRISB 0611011111 Declare Port B as Input Except RB5 output All the pins in Port A are declared as inputs and all the pins in Port B exc
90. n to reduce code size and increase efficiency The following are the additions made to the Radio Tag hardware during the testing stage e AGreen LED was connected to the Tx RB5 pin of the MCU to indicate the data transmission e Awire was soldered close to the Tx RB5 pin on the Vero board to be used as test point while testing the output of MCU and for testing using serial data link Ramiz Ahmed Radio Tag for Item Tracking 32 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 Base Station RF Receiver Reader The Radio Tag Tracking System required a Base Station which according to project aims was expected to keep track of the Radio Tags associated to it The base station or receiver was supposed to raise an alarm if any of the radio tags was missing The following sections in this chapter detail the steps taken in design assembly and testing of the Base Station 4 1 Hardware Selection Just like the Radio Tag the hardware selection for the Base Station had an important role in this phase of the project According to conceptual system block diagram Figure 4 1 a base station was expected to have a microcontroller LCD Screen an RF Receiver Antenna and an alarm system LCD Display PIC Microcontroller AM Receiver Module Figure 4 1 Conceptual Block Diagram of Base Station Reader The EasyPIC4 development board used during Radio Tag d
91. nd voltage levels on each of the pins on the AM2000 RX Module were monitored and the waveforms were observed on the oscilloscope but no significant activity could be identified After all unsuccessful attempts the manufacturers for RX module were contacted to confirm any known issues with the module It was then the manufacturers responded with the fact that the AM2000 Rx Module does not support USART the receiver module did not have any radio software as well and therefore the data received on the module was nothing more than RF noise and the microcontroller could not detect it The module is a recommended receiver for the Micro TX transmitter and the product datasheet BI does not mention anywhere whether or not the module supports USART transmission Therefore the manufacturer s word had to be believed to justify the incompatibility of the Receiver Module Due to lack of time sourcing of a new correct receiver module was not pursued Although a new correct receiver module was recommended by the manufacturers which is discussed in Ramiz Ahmed Radio Tag for Item Tracking 45 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report the Conclusion chapter of this report A copy of the email communication between the author of this report and the module manufacturers has been added in Appendix O for evidence and reference to the recommended Radio Receiver 4 5 Summar
92. nfigure these jumpers to refiect the data rate being used for encoding decoding Shutdown Input The shutdown input can be used to reduce system power consumption by duty cycling the receiver for power critical applications such as battery powered pager receivers An internal pull up resistor is provided on the module and this pin should normal y be pulled down to ground to enable the module 2000 issue 1 3 Dec 03 Page 2 of 4 Ramiz Ahmed Radio Tag for Item Tracking 75 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report APPENDIX O Email Correspondence with LPRS about AM2000 Receiver Module Google Mail re Contact X v Google Mail re Contact fi y htp mailgooglecom mail h af2nrxzeh8sl v pt amp th 1205d3 Br re Contact from Low Power Radio Solutions 3 messages E Richard Hathaway richard hathaway glprs co uk To Ramiz Ahmed lt ramiz ahmed gmail com gt Dear Ramiz have attached several data sheets on evaluation kits will will help you with circuits etc Please let me know how you get on Best regards Richard Hathaway Product Manager gt Hello i recently bought your Low cost AM MicroTx and AM2000 433 Rx have had a look at the data sheets and figured out a way to fix the transmitter into my RF circuits i have been trying to get the receiver to work with a PIC 16F88 MCU but it doesn
93. ng at AM 433 MHz frequency manufactured by Low Power Radio Solutions was selected as a suitable RF transmitter A 1 4 wave antenna was used for transmitting radio signals from the transmitter The prototype radio tag was built in two stages the MCU circuit was assembled onto a prototyping Vero board and the Transmitter circuit was developed on a Colander Vero Board which had sufficient ground plane The two circuits were then combined using wires The complete Radio Tag hardware Ramiz Ahmed Radio Tag for Item Tracking 47 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report and software were tested using different instruments and techniques and a successful radio transmission was achieved The Base Station hardware selection did not require extensive research as most of the components were already available The EasyPIC4 development board was used as the base station backbone a PIC 16F877A microcontroller was used as the control logic microcontroller and it was plugged into the board along with the LCD screen The AM2000 RX433 Receiver module manufactured by Low Power Radio Solutions was selected as a suitable RF signal receiver The hardware assembly for the base station as most of the components were simply plugged into their sockets on the development board The AM2000 receiver was mounted into a socket soldered onto a colander Vero Board The circuit board als
94. o had a suitable 1 4 wave antenna mounted on it for reception of the radio signals The hardware and software testing phase of the project was divided into two phases the initial base station performance was tested by creating a wired communication link between the Radio Tag and the Base Station The Direct Port Access pins on the Development board were used to connect the Transmit pins of the radio tag to the base station microcontroller Successful wired communication link was created after conducting multiple tests at different times using variable radio tag serial numbers During the second testing stage the wireless RF communication link between the Radio Tag and the Base Station was attempted The testing stage was unsuccessful as a Radio transmission could not be achieved This was due to the reason that the AM2000 Receiver did not have any radio software and did not support USART communication and therefore valid data could not be transferred between the receiver and the microcontroller The recommended receiver module was carefully analysed and is discussed in the recommendations section Due to lack of time in the project a replacement receiver was not purchased and therefore the RF Communication stage of the project is still incomplete 5 2 Project Time Plan and Costing The project was managed according to the tasks outlined in the initial time plan created at the commencement of the project Throughout the duration of the p
95. ocontroller and a PC In order to enable RS232 communication a jumper was placed at RC7 for RX line in Jumper Group 7 and a jumper was placed at RB5 for TX in Jumper Group 8 The RS232 communication was very useful during the software testing phase of the project as the board was connected to a PC and the output from the microcontroller was observed at the computer using the hyper terminal window in MikroC programming software Direct Port Access All microcontrollers input output pins can be accessed via 10 pin connectors on the right hand side of the EasyPIC4 development board There are 5 different 10 pin connectors for each of the PORTSA E of PIC microcontrollers Each of the 10 pin connectors have two pins for VCC and GND respectively which could be used to power up peripherals connected to the microcontroller The direct port access option was used during the base station development phase of the project as the RF receiver module was connected to the microcontroller using the PORTC 10 pin set Further details of the base station are available in the relevant chapters in this report All of the information about the different components of the EasyPIC4 development board has 8 been extracted after referring to its user manual which could be consulted for further information Ramiz Ahmed Radio Tag for Item Tracking 62 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Fin
96. operation of the function is to convert the binary number in to its corresponding value The bits in any binary number ascend the order of the power of binary numbers e g 2 2 2 2 etc in order to convert a binary number to decimal number it is important to convert the binary number at that bit correctly to its decimal value value of 2 raised to its power the power is the position of the bit in the whole binary number The first part of the function is a conditional if statement which checks whether the input given to it is zero or not If it is zero i e 2 then the function returns the value of 1 to its calling function by default Ramiz Ahmed Radio Tag for Item Tracking 21 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report if temp2 0 return 1 However if the input value is not integer 0 then the statement is false and the program goes to the else part of the conditional statement The else part contains a FOR loop which starts from 1 and terminates at the value input to the function temp2 for i 1 i lt temp2 i Result Result 2 return Result The loop iterates the code in which it multiplies the value stored in the Result variable by 2 and then stores the resultant value back to Result variable The value is then used in the next iteration and so on until the loop terminates After the first
97. pment board has a very fast on board USB2 0 programmer which eliminated the use of specialist programming hardware to be used for programming PIC Microcontrollers The on board programmer also resets the MCU after programming it which proved useful during the project as there was no need to reset the MCU The on board programmer also proved very useful during the software development and testing phase of the project as microcontrollers could be programmed and tested with newer versions of software code very easily and efficiently whilst plugged into the development board Oscillators The development board has two different oscillators to work with the large number of MCU sockets on the board Each oscillator was connected to a separate range of MCU sockets The DIP18 socket has a connection with OSC1 which is an 8 MHz crystal oscillator supplied with the development board The oscillator provides the clock signal to the microprocessor while it is plugged in the development board for programming or normal operation Push Button Switches amp LED s The EasyPIC4 development board has 36 push buttons which can be used to change states of digital inputs to the microcontroller s ports The board also has 36 Light Emitting Diodes Ramiz Ahmed Radio Tag for Item Tracking 61 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report LED s which serve the purpose of displaying
98. r Clock Osciliator Capture Compare PWM 10 bit 7 channe A D Converter PIC16F88 only Servio Two Analog Comparators AUSART TACUR RAS be configured as an Input Table 1 2 details the pinout of the devices win descriptions and detalls for each pin BEng Final Year Project Report 59 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report PIC16F87 88 18 0 ELECTRICAL CHARACTERISTICS Absolute Maximum Ratings t Ambient temperature under bias 40 C to 125 C Storage temperature 65 C to 150 C Voltage on any pin with respect to Ves except Voo and MCLR 0 3V to 0 3V Voltage on with respect to Vss _ 0 3 10 757 Voltage on WEIR witn respect to Ves Note 2 0 310 14 Total power dissipation Note 1 Maximum current out of Vas Input clamp current Vi lt O or M gt VOD Output clamp current lox Vo lt 0 or Vo gt Vpo Maximum output current sunk by any VO pin Maximum output current sourced by any UO pln Maximum current sunk by PORTA Maximum current sunk by PORTE Maximum current sourced by PORTS Note 1 Power dissipation is calculated as follows Pdis Woo x Vo Von x lon EVOL x loc 2 Voltage spikes at the MCLR pin may cause latch up A series resistor of greater than 1 should be used
99. r A w ede 1 Center Noise Mkr D Line a 9 EN de Down I il CF Step alvi Fixed Level 0 0dem 30 m Center 443 MHz Span 100 MHz Figure 3 21 Frequency Spectrum for Complete Tag with serial 63 Ramiz Ahmed Radio Tag for Item Tracking 30 School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The spike shown in the figure above is at 433 MHz confirming that the tag was operating at the right frequency In order to check whether the output from the tag was correct the ICOM Radio Software was used to detect the output from the tag The radio software also provides the sound output of the received signal and its software interface provides related information about the received signal Figure 3 22shows a screenshot of the radio software when the tag was transmitting at tag serial 63 IC K 1000 Ej File F View V mi ese scc Ef 433928888 21 1 27173 1415 6 9 0 CE SCAN CONTROL DELAY TIME m 5 auro Condition _5 sc _vsc AF GAIN 519 ake SSB cw AM ooo m mE Emri Figure 3 22 Output of the Radio Software Tag Serial 63 As it is clear from the figure the received signal was at AM frequency of 433 928 MHz The
100. r Software Code The program code for the PIC 16F877A was also written using the MikroC programming software Details about the programming software could be acquired from its user manual 18 The program code was initially written to display the data received during wired communication between the Radio Tag and the Base Station The software code explained below is capable of receiving data either wirelessly or through wired connection but after the testing stages as explained in section 4 4 the software code was not expanded to include algorithms for tracking more than one radio tag Just like the Radio Tag software code the first step towards developing the software code from the base station was to identify the software requirements and produce a basic data flow diagram for the system The data flow diagram for the software code has been added into Appendix l The main objectives identified for the software code included e Display Text Messages including information about active tags missing tags e Activate an alarm if any of there are no Active Tags or if a Tag is Missing e Store and Process data received through USART e Time the two consecutive signals from a tag and if time difference is more than a pre defined time limit activate the alarm e Code feasible for data received through wireless and or wireless communication Ramiz Ahmed Radio Tag for Item Tracking 38 Universityof Hertfordshire School of Electronic
101. ransmitter Module 3 2 3 Complete Tag Assembly The task of complete tag assembly was completed by connecting the two circuit boards MCU circuit board and Micro TX circuit board together by using electrical wires One wire was connected between the Tx pin RB5 of the microcontroller and the resistor Rd on the module circuit board The other wire was used to connect the ground plane on the transmitter circuit board to the common ground on the MCU circuit board A picture of the final Tag Hardware has already been added in Figure 3 4 3 3 Microcontroller Software Code The software program for the PIC 16F88 used in Radio Tag was written using mikroC programming software which is a well known software development tool for PIC microcontrollers The compiler has been designed to facilitate users with easiest solutions to develop embedded applications without compromising performance or control 1191191 Different versions of software code were created to ensure effective usage of the speed and memory space of the microcontroller The two most noteworthy versions of the software code including the final version have been discussed in the following subsections 3 3 1 MikroC Compiler amp Software mikroC has a variety of options that allows its users to quickly create and test complex applications The important features include e Write C code using highly advanced Code Editor e Use the included MikroC libraries to speed up the dev
102. reduce hardware components and improve costing in future project work 5 3 Recommendations for Further Work Since the entire project objectives were not achieved at the end of the project duration There is still a lot of room for further work in the project A major part of the Radio Tag and base station development work was completed during the project Further work could be done in improving the overall performance of the system hardware and achieve Radio communication as explained in the following sub sections One recommendation on the further work is to divide the complete project in two sub projects The Transmit only Radio Tag and Base Station development part should be allocated as one sub project and the Transmit Receive Tag and Portable Tag Tracker development part should be allocated as a different sub project 5 3 1 Radio Tag The software code for the Radio Tag is complete and very efficient The software could be improved to introduce data encryption to enhance the security aspect of the Radio Tags Special attention should be given to improvement of the Tag circuit The best thing to reduce the circuit size would be to transfer the complete tag circuit onto a Printed Circuit Board PCB The prototype only works on power supply from standard lab power supply therefore a battery power supply feature could also be added to the tag prototype Spare components PIC16F88 MCU and 2 x Micro Tx Transmitters from the current project cou
103. rocontroller The microcontroller was placed into its appropriate 18 way DIP socket and then the board was connected to the computer using a USB 2 0 cable provided with the board and the Build Program option in the mikroC software environment was used to generate a HEX file and program the MCU The memory usage statistics for the microcontroller are shown in the figure below xif Messages Find BConvertor Line Column Message No Message Text Unit 0 0 100 Success Release Build 0 0 101 Used ROM 1268 30 Used RAM 60 16 0 0 102 Free ROM 2827 70 Free RAM 308 84 4 m l Figure 3 16 Memory Usage Statistics for Initial Software Code Version 2 Since the all microcontrollers and electronic boards are sensitive to static charge the board was placed on an anti static mat and anti static bands were used while inserting removing the MCU from the board After programming the MCU was placed into its circuit socket and the operation of the code was tested which is explained in Testing part of this chapter 3 3 3 Final Software Code After conducting further research in possible approaches to reading the tag number from DIP Switch the final code version was created Instead of using an array to read in the tag number and then converting the binary value to decimal values a simple Bit Masking approach was applied in the code This reduced the code length from 92 lines to just 35 lines The new code does not req
104. roject the task deadlines were adhered to and project tasks were updated upon completion Some of the tasks suffered minor delays due to certain academic commitments but overall project progress was satisfactory Ramiz Ahmed Radio Tag for Item Tracking 48 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The Project Time plan given in Appendix A shows some of the tasks are still in progress This is because of the fact that due to lack of time the Base Station hardware testing phase stage could not be completed Since the radio tag project has certain industrial application potential the component expenditure was carefully monitored and all necessary care was taken to reduce the overall component costs The School of Electronic Communication and Electrical Engineering has a maximum budget allowance of 50 While the overall component costs were a lot higher from the allowed budget the costs were reduced by sourcing the costly EasyPIC4 Development Board from within the School This allowed the 50 budget to be spent on purchase of Micro Tx transmitters and AM2000 Receiver Some of the spare money after the major component purchase was used to purchase the antennas and other small but important components The table in Appendix B lists the costing and quantities of all the hardware components used within the project The table could also be used to rearrange or
105. ry component costs to the overall project budget Two wires red for 5V and black for OV GND were soldered onto the power supply rails on the Vero Board which were then connected to the laboratory power supply to power up the circuit During the hardware testing stages an LED was connected in series with the data output pin RB5 11 of the microcontroller Since the I O ports of the MCU can only source up to 25 mA current and the Micro Tx transmitter module draws 4mA current a 330 ohm resistor was also added in series between the LED and the MCU pin to limit the current being drawn by the LED The LED was added to indicate if the MCU is powered up and is transmitting any data to the RF transmitter The final MCU hardware circuit is shown in Figure 3 10 below Figure 3 10 Final PIC MCU Circuit on Vero Board Ramiz Ahmed Radio Tag for Item Tracking 15 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 2 2 Micro Tx Transmitter circuit Design and Assembly The main task in designing the Micro Tx transmitter circuit was identifying the right application circuit in its datasheet Appendix G and then identifying the right components according to the MCU circuit specifications The right application circuit diagram from the relevant data sheet Pl is given in the Figure 3 11 below Short Whip Antenna Short Whip Antenna 15nH 220p RF Ground 2
106. s It is ideal for upgrading car alarm domestic alarm or other low cost applications that require improved range and more consistent operation Low radiated emissions ensure compliance with EMC requirements The receiver operates from a single 5V supply and is pin compatible with many industry standard devices It is available for operation on 418MHz 433MHz and 868MHz Features Applications SAW based Front End Filter for selectivity Car alarm receivers Crystal controlled synthesiser Domestic alarm receivers Shutdown Input and wakeup output Garage door openers Duty cycle power saving possible Pager receivers Small size PCB Mounting Single in Line SIL style RF Amp SAW Filter Data Slicer RF Gnd RF in Vec Data Block Diagram Mechanical Detail Notes Pin Function Gnd and RF Gnd must b connected to OV earth plane on the mother RF Gnd board NC Pins are No electrical Connection 9 NA shutdown pin must be pulled down to Gnd to enable the module 10 7 131 ve Application The AM2000 series receiver is simple to apply requiring only a clean DC supply of 5 Volts an antenna and a suitable device for decoding the incoming digital data The ground pins should connected to a substantial copper area that will act as a ground plane The receiver and its antenna must be kept well away from any circuitry that may generate harmonics that could extend into the UHF region Even a simple crystal o
107. s Recelver Transmitter AUSART SCI with 9 bil address detection 85 232 operation using intemal oscilator external crystal required Dual Analog Comparator module Programmable on chip voltage reference Programmatic input multiplexing tom device inputs and internal vozage reference Comparator outputs are extemally accessible Pin Diagram 12 PDIP SOIC T 2 gt RAUM d 7 RAAJANAITOCKO RADUAND RAMOS UVCLE RASMC RP 14 WS TAANSTGDE om USOVSDA 7 2 e L 27 Tosa ice gt 5 RISSISSIDUCK Note 1 The CCP detemised by Ihe OCPMX bt ia Configureten Word rese Special Microcontroller Features 100 000 erase wnte cycles Enhanced Flash program memory typical 1 000 000 typical erase write cycles EEPROM data memory typical EEPROM Data Retention gt 40 years In Circult Serial Programming ICSP via two pins Processor read write access to program memory Low Voltage Programming In Circult Debugging via two pins Extended Watchdog Timer WDT Programmable period from 1 ms to 2635 Wide operating voltage range 2 0V to 5 5 10 bit Timers Sing e Word ELM AID AUSART Comparators enat instructions bytes vies see 2s ve s
108. s from the microcontroller to the ground To avoid cluttering the circuit board with multiple resistors an 8 pin 4K7 15 Figure 3 8 A Typical SIL Network Resistor network resistor was used 15 The network resistor assists in reducing the number of components and soldering pins in the circuit The 8 pins were therefore connected in parallel with MCU s Pins and the common pin was connected to the ground OV connection All microcontrollers need a clock signal to work with The PIC 16F88 microcontroller has internal oscillator but for better performance an external oscillator could be used with the microcontroller To achieve better and accurate performance an external 8 MHz crystal oscillator was connected to the RA7 OSC1 and RA6 OSC2 pins of the microcontroller As stated in the product datasheet two 22 pF capacitors were connected between the oscillator pins one each on each pin of the oscillator and the Ground to allow for a basic start up time and stable oscillator operation 4 The MCU circuit was first assembled on a prototyping breadboard The prototype was then used to test the overall operation and stability of circuit design including the DIP switch and the oscillator operation A picture of the prototype MCU circuit is added below in Figure 3 9 Ramiz Ahmed Radio Tag for Item Tracking 14 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final
109. scillator on a microprocessor clock can do this Particularly troublesome are externally bussed microprocessors and switched mode power supplies that can radiate significant energy into the ether Good practice and testing will reduce this likelihood which will generally manifest itself as reduced range or lack of sensitivity Antenna All transmitters and receivers require antennas in order to work efficiently the 2000 receiver is no exception to this law of physics 1 4 wave whip antenna approximately 16cm will provide the best performance It should be mounted in free space and well away from any conductive objects or surfaces 2000 issue 1 3 Dec 03 Page 1 of 4 Ramiz Ahmed Radio Tag for Item Tracking 74 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report LPRS Data Sheet AM2000 Series Receiver Module Maxi Rati Supply Voltage Vcc Pin 11 0 3 to 5 25 Volts Operating Temperature 0 C to 70 C Commercial Storage temperature 10 to 85 C Performance Data Supply 45 0 Volt 5 Temperature 20 C Parameter Min Typical Max Units Notes Supply Voltage 475 50 55 vots Receive frequency fo 41800 MHz Receive frequency fo 43392 MHz UK amp Euope Receive frequency fo 868350 2 UK amp Europe Sensitivityfor6dB S N 5 dBm 4
110. specialist libraries and the code length is limited to 1000 lines The limited usage of libraries resulted in some problems during the software development which is explained in the later subsections however the code length of 1000 lines was never an issue for this project as much of the code was only 100 or less lines long The first step towards writing the software code for the PIC 16F88 microcontroller for radio tag was to create a basic data flow chart The aim for developing the flow chart was to show the flow of information within the micro controller modularize the code and makes the code understandable The Basic data flow diagram for the Radio Tag part of the system has been added into Appendix G 3 3 2 Initial Software Code The PIC microcontroller provides the feature of reading individual port pins in the software code instead of reading the whole 8 pins of the port Since the 8 pins of the DIP switch were connected to individual microcontroller pins the binary values of those pins were read into a variable array The main aim in software development was to read in that binary number correctly into the microcontroller and then transmitted periodically on the USART port RB5 Tx Pin The USART port however transmits data using hexadecimal values If the array holding the tag number was to be transmitted using USART the individual elements would have been Ramiz Ahmed Radio Tag for Item Tracking 19 University of Hertfordsh
111. sted to ensure its performance was according to the expected criteria The testing was done using different analysis criteria and instruments The testing was done in conditions similar to normal operational conditions of the tags with high level of noise and distance losses The results were then analysed to confirm the overall system performance and chalk out any hardware and software errors Ramiz Ahmed Radio Tag for Item Tracking 6 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 Radio Tag RF Transmitter The project specifications required the battery operated Tag to be able to transmit an RF beacon after specific time intervals in order to be tracked by the base station M This provided certain challenges in the interface design of tag s hardware and software Both of the design aspects with possible solutions and final design specifications are discussed in the sections below During the feasibility study it was decided that the tag would consist of a microcontroller and an RF transmitter The microcontroller would perform all the number crunching regarding tag number detection and then would transmit the tag number to an RF transmitter which would transmit the data using amplitude modulation technique 3 1 Hardware Selection The hardware selection for the radio tag was an important stage in the whole project time plan Much of the research on
112. t 500 t dt 2 rand 100 Mod of a Random Number to Create a Variable Delay delay ms 1000 while 1 TagNo PORTB lt lt 4 PORTA amp Ox0f BitMasking PortA amp B Store TAgNO if TagNo gt 0 Condition TagNo 0 Not Transmitted USART Write TagNo Put TagNo on RB5 Tx Pin through USART vdelay ms t USe the variable delay as delay in transmission Data Flow Diagram Power On P Y Initialise Ports v Initialise USART Read DIP Switches for Tag Y Convert Tag No from Binary to No Decimal Write Tag No on USART Tx Port Y Variable Delay Ramiz Ahmed Radio Tag for Item Tracking 66 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering APPENDIX J Radio Tag Tes AUTOSET CH1 Mean 3 30V M Pos 0 0005 Tek JL Auto Undo Autoset M 10 0ms CH1 0 000 23 Mar 03 17 00 lt 10Hz TDS 1002B 16 54 33 23 03 2009 CHI 2 00V Tag Output Tag Serial Number 7 oela BEng Final Year Project Report ting Results M Pos 0 000s AUTOSET CH1 Mean 438V Tek N Auto 1 Undo Autoset M 10 0ms CH1 0 00 23 Mar 03 17 02 lt 10Hz TDS 1002B 16 56 00 23 03 2009 CH1 2 00V Tag Output Tag Serial Number 255 pue Mi Mw IM Ref
113. t dec TagNo m 2 3 4 5 6 7 8 9 10 11 12 3 4 9 6 8 9 0 b2dec Fun 1 Convert Binary to Decimal Power int i Fun 1 1culate Decimal Value of Each Binary No NNNP p p po ge geo N P Figure 3 13 Initial Radio Tag Software Code Version 2 1 of 3 Figure 3 13above shows the first few lines of the version 2 of the initial software code Much of the code is self explanatory and detailed comments have been used to identify the functions of each command line Lines 1 6 are commented lines providing details about the code file including the project title code type programmers name and version of the software code Lines 10 17 declare different global variables being used in the program The code line unsigned short TagNo 8 Ramiz Ahmed Radio Tag for Item Tracking 20 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report is the declaration of the array TagNo with length of 8 to store the 8 binary numbers being read into the code Since the values being read are only binary either 1 or 0 the data type of the variable is declared as unsigned short variable array Lines 20 and 21 declare the two functions created later in the software to do the binary to decimal conversion mentioned in the beginning of this section 23
114. t for the Micro Tx transmitter was tested separately before connecting it with the MCU circuit The transmitter was given a plain 2 5 Volts DC supply using a standard power supply During initial testing it was observed that the behaviour of the 100 uH RF choke recommended in the product data sheet BI was capacitive rather than being resistive It was then decided to reduce the size of the RF choke and a 1 uH RF choke was used instead The Rhodes and Schwartz Network Analyzer was used to verify that the frequency output of the Micro Tx transmitter is at 433 92 MHz Figure 3 20 below shows the screenshot of the waveform at the network analyzer The oscilloscope marker in the figure is set at 433 MHz waveform spike Ramiz Ahmed Radio Tag for Item Tracking 29 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Frequency Amplitude Marker BW Sweep Trace Trigger Measure RBW LN 300kH2 Mi 433 857143 MHz 73 1 d m VBW 1MHz M2 MHz dBm Center alw ibo SWT S5 13ms Ref 20 0 dBm Att 09 span alwi 100 Level 20 0dBm m y lt a amp amp pi aw 3 dem RBW 300 kHz 30 Frequency Start ajv 393MHz 40 eee Stop aly 493MHz CF Step aly 12MHz Full ga Zero 2 Last E amp zoom A Signal Tracking amp 80 SA
115. t seem to be receiving anything Could you please forward me any detailed information on typical application circuits for the AM2000 RX or do you have any known issues with the Receivers comptability with PIC MCU s i have followed the installation instructions in the data sheet but that doesnt seem to help alot there are discrepancies in the actual circuit and the mecahnical drawing in the datasheet as well waiting anxiously for your reply Ramiz Ahmed Google Mail re Contact v Google Mail re Contact Qe fis http mail google com mail h qf2nrxzeh8sl v pt amp th 1205d3 gt D Richard Hathaway richard hathaway glprs co uk Tue Mar 31 2009 at 4 48 To Ramiz Ahmed lt ramiz ahmed gmail com gt Dear Ramiz Thank you for your email The AM2000 does not have a UART and therefore cannot be connected to your USART PIC All that comes out of the receiver is RF noise as it is a raw data module No packeting has been done for the data If you need a module that does have UART feature then our Easy Radio ER400TS and RS modules would be ideal Please look at our website at http www Iprs co uk product info php cPath 21 amp products_id 54 Best regards Richard gt div Hello Richard div div lt div gt div Thankyou very much for your kind reply and the datasheets i have had a look at them and compared the circuit diagrams with mine the connections between the AM2000 Rx and my P
116. the conditional statement and executes to the next conditional statement However if there is no data on the USART to be read the statement is true and the program executes the following commands no_tag portb f7 1 Icd cmd Icd clear clear buffer In these commands a message No Active Tags is displayed on LCD the receive buffer is cleared and the Alarm Output Pin is Asserted After skipping the first conditional statement the program then comes to the second conditional statement at line 125 This line again checks whether data is available on USART If data is available the code within the statements is executed otherwise the program skips the command lines and goes through the loop section again Within the conditional statement commands listed below the program goes into another FOR loop Portb F7 0 for i 0 i lt 1 i rx buffer i USART_Read put char in element amp then increment index disp tag active rx buffer i Within the FOR loop the data available on the USART is read to the rx buffer array and at the same time the same data element from the rx buffer is passed on to the disp tag active function which in turn converts the received integer data to characters and displays the active tag message on the LCD After completing the FOR loop the program escapes the second conditional statement goes through the do while loop again The program was carefully debugged and after s
117. the hardware components was done during the feasibility study stage and further literature research was carried out whilst considering different hardware characteristics and final component selection done The microcontroller to be used for the tag number detection was chosen to be a PIC 16F88 microcontroller and Micro Tx Transmitter from Low Power Radio Solutions was chosen as the RF transmitter The AM Amplitude Modulation transmitter works at 433 92 MHz Frequency which is low power and licence exempt in UK Pl Appendix C The microcontroller software code was written using MikroC programming language and it was programmed using an EasyPIC4 Development Board All the hardware components are described in detail in the later sub sections of this chapter A block diagram of the Radio Tag has been added below DIP Switch PIC Microcontroller Battery gt v v v v 4 Figure 3 1 Block Diagram of the Radio Tag Ramiz Ahmed Radio Tag for Item Tracking 7 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering 3 1 1 PIC 16F88 Microcontroller PIC 16F88 is an 18 pin 16 Bit MCU Micro Controller Unit from the Mid Range family of the PICmicro devices by Microchip 1 The microcontroller was chosen as the control logic for BEng Final Year Project Report the tag circuit because of its low cost compact
118. tware was working as expected A separate screenshot of another test session has also been added into Appendix J 3 5 2 Hardware Testing The hardware testing for the radio tag was performed after completing the software testing phase of the project The MCU hardware was tested using a digital multi meter and an oscilloscope connected to a computer to capture screenshots of the waveform outputs on the oscilloscope screen During circuit assembly all the component connections were thoroughly checked and any short circuits due to poor soldering and Vero board tracks were removed before powering up the circuit for the first time Once powered up the voltage level at all the inputs to the MCU and DIP switches were checked using the voltmeter The first step in MCU hardware testing was to verify the stable operation of the external oscillator The circuit was powered up and a 1x probe as used to connect the RA7 OSC1 pin of the MCU to the oscillator The oscilloscope settings were adjusted to display the right sinusoidal waveform and then measurements were taken to ensure the clock is operating at the right frequency of 8 MHz and its operation is stable Figure 3 18 below shows the clock signal observed at the oscilloscope and the measurement of the clock frequency Tek Auto M Pos 200 01 CH1 Coupling BW Limit SUR ETAT p Volts Div 1 Time Period Probe 1X Voltage Invert CH1 2 00V M 100ns CH1 2 48V 20 Mar 03
119. uccessful compilation the code was downloaded on to the PIC 16F877A microcontroller The program was tested in the testing stage detailed in the next section of this chapter 44 Testing The testing phase of the Base Station was conducted in two stages In the first stage A radio tag was connected to the Base station using a wired communication link However in the second stage the wireless communication through RF Frequency was attempted The details of both test stages are given below Ramiz Ahmed Radio Tag for Item Tracking 43 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 4 1 Wired Serial Communication Testing During this stage the radio tag prototype was connected to the Base Station using a serial wire connection As shown in figure 4 8 below the Tx Pin of the MCU in the Radio Tag was connected to the RC7 pin in the direct port access pins on the Development board LITTLE 5 th Figure 4 8 Wired Communication Testing Setup with Radio Tag amp Base Station The Radio Tag was powered up by a standard laboratory 5V power supply whereas the 5V power supply to the development board was provided by using the USB2 0 cable After Powering up both the circuits the DIP switches on the Radio Tag were altered to specify a tag serial number and the expected output on the Base Station LCD was observed Different combinations of the t
120. uire any binary to decimal conversion and there are no function declarations The complete source code has been added into Appendix K The final code has no difference in the microcontroller configuration and the variable delay The only difference is the way tag serial number is read into the system The command used to read the serial number into the program memory is TagNo PORTB lt lt 4 PORTA 6 0 04 The variable used to store the tag number is declared as a character data type In the code line above the data read in three stages In the first stage the data read from Port B is Ramiz Ahmed Radio Tag for Item Tracking 25 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report arithmetically shifted 4 places to the left In the second part the data read from Port A is used to do a logical and with OxOF binary 00001111 Then in the last part the result from first stage is used to do a logical OR with the result from the second stage The table below gives a few examples to further highlight the bit masking methodology used Actual Tag Port lt lt 4 Tag No Port input Port lt lt 4 Port A input Port A amp OxOF Number Port A amp OxOF In Hex 2 0000 0000 0000 0000 0000 0010 0000 0010 0000 0010 0x02 15 0000 0000 0000 0000 0000 1111 0000 1111 0000 1111 0x0F 63 0000 0011 0011 0000 0000 1111 0000 1111 0011 1111
121. y During the Base Station development stage of the project plan a Radio Tag tracking base station was developed The Base Station was based on the components installed on the Easy PIC4 development board the microcontroller used in the system was a PIC 16F877A microcontroller For Receiving RF signals the AM2000 RX433 Receiver Module 22 was used manufactured by Low Power Radio Solutions The circuit was assembled using professional circuit assembly practices the code for the microcontroller was also developed using best possible approach towards problem solving The Base station was testing in two stages the wired communication testing stage was successfully completed however the RF communication testing stage could not be completed due to an absence of USART port in the Receiver Module Further details about recommendation on the new receiver module are discussed in the next chapter of this report Ramiz Ahmed Radio Tag for Item Tracking 46 Universityof Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 5 Conclusion This chapter provides a brief summary on the work carried out during the project and discusses the overall outcome of the project The successful achievement of project objectives and tasks set at the beginning of the project is also discussed This chapter also comments on the efficiency of the overall project management provides overview of the f

Download Pdf Manuals

image

Related Search

Related Contents

ハウスマイルネットワーク ご利用ガイド  Remington's Rifle/Shotgun SPR 94 User's Manual  RAID 6 がなぜ必要か!  Presione para Descargar  Installation and Operations Guide PDF  厚生労働大臣が基準を定めて指定する医療縲 (平成 ー7 年厚生労働省  010609 Zeitschaltuhr DT CH  Massive Wall light 45563/30/30  

Copyright © All rights reserved.
Failed to retrieve file