Home

Untitled - Universiti Teknologi Malaysia

image

Contents

1. electrical characteristics over recommended ranges of supply voltage and operating free air temperature unless otherwise noted see Note 3 and Figure 4 TEST CONDITIONS MIN MAX UNIT e D TAII typical values are at Voc 5 V and Ta 25 NOTE 3 Test conditions are C1 C4 1 uF at Vcc 5V 0 5 V C 57 58 APPENDIX D Serial LCD User Manual Cytron Technologie DS LCD SRL162 Serial LCD User s Manual V1 1 December 2007 Information contained in bis publication regarding device applications and the like i micnded thrush seggestion only amd may be uprnalal by spdala i your rexpoesilwly to cease thet your appbcaioe meets wih your specficationx No memain or Warranty is given and no kability u zoiznal by Cytron Technologics Incorporated with sexpect to the accuracy or usc of yach informatica or infringement of peca or oher intellectual property rights ating from wach use or otherwise Use of Cytus Technolugies s products as critical components in life support syslerm is mot authorized except wil oprem wribez approval by Cytron Tadrmologica No licenses spe comveyal implicitly oc otherwise ander aty intelectual property rights 59 Cytron 5 product use EDT HEAD to TOE 2 2 Display Location Size and DDRAM Address 18 5MAXc10 0MAX5 9 866 5 E 7 i 29 J 0 7 fe is ici dise To J ea 14 04 3 645203 71 3205 m gt e ny
2. Unmarked tolerance xx 0 20 WHIT EL BI WHIT LED BA 0 3 WITHOUT BIL Di play location A C G J L N DDRAM Address 3 4 7 A C Di play location DDRAM Address 40 42 43 44 46 47 49 4A 4B 4C 4D 2 1 Column 1 Column 2 Figure 2 2 shows the display location for character on the senal LCD while Table 2 1 shows the DDRAM address for display location on column and column 2 User may program the LCD based on the display location and DDRAM address Please refer chapter 4 Getting Started for the command to program the LCD Cytron ROBOT HEAD to TOE Technolog Product User s Manual Serial LCD 3 PRODUCT LAYOUT Figure 3 1 Label LE mn CI TON bottom view C PadNol Vs H D PadNo2 Vo I PadNo 7 LEDA E PadNo Vo J PaNoesIEDK Table 3 1 60
3. vo inc rcut debugger and ICEP programming data i5 a bidrectonsi VO port RCUTIOSOYTSCKI RCI vo T1080 Timer oscillator output TICK Timert extems clock input RCUT1OSVOCE2 RCI Digits vo T10SI Timert Input 2 Capture input Compare cutput PWC output RC2ICCP1 Digit LO Capture input Compare output PWIM output 10 Synchronous serial clock nputiouput for SPI mode Synchronous serial clock nputoutput for FC mode vo SPI data In PC dam vo vo SPI data out vo USART asynchronous transmit USART synchronous clock 10 USART asynchronous receive USART synchronous data 2 55 F Groundreterence and iO pra 2 z supply tr egc and vo pre l O oput VO inputioufput P power eNotused TTL input ST Schmit Trigger input This buffer iz a Schmitt Trigger input when con gured as the extemal rtemupt This buffer is a Schmitt Trigger input when used In Serai Programming mode This buffer is a Schmitt Trigger input when configured In RC Oscillator mode and a CMOS input otherwise 49 PIC16F87XA EXAMPLE 4 1 INITIALIZING PORTA 4 0 WOPORTS Some pins for these VO ports are multiplexed with an alternate function for the peripheral features on the device In general when a peripheral is enabled that may not be used as a general purpose VO pn Additional information o
4. Not Logic RE 3 N ae PIC16F877A Figure 3 7 Crystal Resonator Operations for LP XT HS Mode In this project High Speed Crystal HS mode is selected a high speed crystal of 20Mhz will be used as the oscillator XTAL showed in Figure 3 7 will be 20Mhz and the capacitor values of C1 and C2 for this project are 22pF 3 3 1 2 Reset MCLR The function of reset Master Clear MCLR is to reset the microcontroller to the start of the program this process is similar to reset a computer 8 877 differentiates between different kinds of resets which include a Power on Reset POR b MCLR during normal operation c MCLR during Sleep d Watchdog Timer WDT reset during normal operation e WDT Wake up during sleep f Brown out Reset BOR Some registers are unaffected by reset that will be referred as unknown on POR but most of the registers are affected 22 3 3 1 3 Analog to Digital Converter ADC The integrated ADC in the PICI6F877A is 10 bit in size and has a total of 8 channels which means that the conversion of an analog input signal may results in up to 10 bit digital number The ADC module has high and low voltage references input that 15 software selectable with some combination of VDD VSS RA2 or RA3 There are four registers in the ADC module which are a AD Result High Register ADRESH b AD Result Low Register ADRESL c AD Control Register 0 ADCONO d AD Control Register 1 AD
5. 35 35 35 35 36 37 37 38 39 40 42 42 42 5 3 Recommendations 43 REFERANCE 44 APPENDICES A D 46 60 Table 3 1 Table 3 2 Table 3 3 Table 3 4 LIST OF TABLE TITLE Part of PIC16F877A Device Features Baud Rate Formula Voltage Range of RS232 and TTL Part of AT Commands Set for Data Transmission xi PAGE 19 23 25 31 FIGURE NO Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 2 5 Figure 3 1 Figure 3 2 Figure 3 3 Figure 3 4 Figure 3 5 Figure 3 6 Figure 3 7 Figure 3 8 Figure 3 9 Figure 3 10 Figure 3 11 Figure 3 12 Figure 3 13 Figure 3 14 Figure 3 15 Figure 3 16 LIST OF FIGURE TITLE Types of Lightning Strike Main and Return Stroke Development Electric Field Strength Variations Rotating Electric Field Mill OSI Models Block Diagram of the Proposed System Schematic of the Hardware Design PIC Microcontroller PIC16F877A Pin Diagram of PIC16F877A Flowchart of Programming a Microcontroller Crystal Resonator Operations for LP XT HS Mode SK40C Development Board MAX232 Integrated Circuit Pin Diagram of MAX232 Integrated Circuit Serial LCD MOD 9001D RS232 GSM GPRS Module Algorithms for Programming PIC Microcontroller Program Flow for Microcontroller MySOL Database Control Panel PHP Language Access Diagram xii PAGE 15 17 17 18 19 20 21 24 25 26 26 27 30 32 33 34 Figure 4 1 Figure 4 2 Figure 4 3 Figure 4 4 F
6. and then an electric streamer will be formed from the clouds to the earth with 1 10 of the speed of light The streamer will progress about distance of 50 m before the light or bright flash emitted 1 A lightning strike and electrical discharges consists of few separate discharges started from leader discharge then main and return stroke discharges Stepped leader is streamer repeating its performance and it is not the actual lightning strike but it provides the channels between cloud and earth which the electrons travel during discharge As the electron from step leader approach the ground positive charges accumulated under the leader core This give rise to the electric field intensity on the ground and build up the path The return stroke follows when the leader touched the ground then large current will flow through the path This will heats the surrounding air causing it to expand and creates a shockwave which we observe as lightning 1 Development of the main or return stroke is as showed in Figure 2 2 Figure 2 2 Main and Return Stroke Development 1 During the lightning strike both electrical and magnetic induction will occur even in significant distance from the strike location 3 Magnetic coupling from lightning strike can induce high voltage surge to conductor and cause damage While the electric fields generated before lightning strike can go up to approximately 500kV m within 100m range of strike 4 The e
7. c Compiler MPlab HI TECH C HEX file ICSP Programmer Figure 3 13 Algorithms for Programming PIC Microcontroller 3 4 2 AT Commands AT is actually the abbreviation of attention and every command line will starts with or at AT commands are set of instructions that used to control a modem It is a string of characters sent from a Data Terminal Equipment DTE to the modem When AT command sent into the GSM module it will respond accordingly and terminating by a carriage return and the default terminator is the enter key CR character 20 In this project all AT commands will be sent from PIC microcontroller to GSM module by the C language programming Parts of selected AT commands will be identified as shown in Table 3 4 will be included in the C program and will be sent to the GSM module so that the wireless data transmission can be done 31 Table 3 4 Part of AT Commands Set for Data Transmission Command Description AT CGATT To attach to GPRS network AT4CDNSORIP Connect with IP address or Domain Name Server AT CDNSCFG Configure Domain Name Server AT4CIFSR Get Local IP Address AT CSTT Set APN User Name Password AT CIPSEND Send data to server AT CIPSHUT Shut down previous connection 3 4 3 PIC Microcontroller Program Flow The program flow of the project for PIC16F877A is as shown in Figure 3 14 Initially the initialization process of the prog
8. 16 characters Furthermore full control over the LCD features allowed the cursor to be moved anywhere by proper configuration The serial LCD communicates with the microcontroller by using the Serial Peripheral Interface SPI The enable signal E of the microcontroller need to be set to high so that the data can be sent to LCD through pin S D For the data to be sent completely to LCD the duration of high need to be long enough which is at least 16 clock cycle plus 100ns for data hold time And once the data sent completely the enable signal triggered to low for a short period approximate 50us In this project the LCD is mainly used to display the steps of the data transmission from the initialization of connection until the data transmitted successfully 3 3 5 MOD 9001D RS232 GSM GPRS Module Figure 3 12 MOD 9001D RS232 GSM GPRS Module MOD 9001D RS232 GSM GPRS module is convenient for network data communication due to its easy setting up in Single Chip Micyoco SCM The size of the module is small that it can fit into both embedded and external peripheral equipment In addition the data connection can be done by using just AT command set and RS232 interface without any extra circuit control Some of the features of the GSM module are as following 28 a Chinese and English SMS data communication b Tri band GSM 900 1800 1900 MHz and GPRS Class 10 c Support TCP IP stacks d Standard extended open AT commands e R
9. Device PIC16F877A User IDs FF FF FF FF Checksum FA14 NVDDPICkt2 nes verv BankCneek Source C iCO318iDesktopiGSMIGPRSv WGPRSv1 hex Figure 4 5 Programmer s Output 40 Output Build Version Control Find in Files MPLAB SIM Build CAUsers ken DesktopFY PGPRS oodingYGPRSvI IMGPRSvIYGPRSvI for device 16F877A Using driver C Program Files x86 HI TECH Software PIOC 0 81 Win pioc exe Make The target CAUsers ken Desktop F YP GPRS codingGPRSvl_1GPRSvIGPRSv1 pl is out of date Executing C Program Files 86 HETECH Software PIOC 9 81 Win pioc exe passl C Users ken Desktop FYP GPRS coding GPRSv1_1 GPRSv1 GPRSv1 c q chip 16F877 P runtime Warning 356 C Users ken Desktop FYPYGPRS coding GPRSv1_1 GPRSv1 GPRSvl 202 42 implicit conversion of float to integer Warning 356 C Users ken Desktop FYP GPRS coding GPRSvl_1 GPRSv1 GPRSvl c 204 42 implicit conversion of float to integer Warning 356 C Users ken Desktop FYP GPRS coding GPRSvl_1 GPRSv1 GPRSvl c 206 42 implicit conversion of float to integer Executing C Program Files 86 Software P IOC 6 81 hin picc exe oGPRSvI oof mGPRSvI map surarnary default psect class mem hex outputedefavlt inhx032 GPRSw pl HI TECH C Compiler for PIC10 12 16 MCUs Lite Mode 79 81 Copyright C 2010 Microchip Techn
10. TTL operates in between OV to 5V which is approximate OV to 0 8V for low state and 42V to 5V for high state as shown in Table 3 3 Table 3 3 Voltage Range of RS232 and TTL RS232 GSM Module TTL USART of Microcontroller 15V 3V 42V 45V 43V 15 OV 0 8 The maximum voltages for the RS232 signal levels are far too high for TTL electronics component Furthermore RS232 signal has negative voltage that is unable to interface with the TTL electronics Thus for TTL to receive the data from RS232 the peak voltage has to be reduced and the negative voltage has to be inverted to positive 26 level On the other hand for TTL to send data over RS232 the logic voltage must be boost up and invert to negative voltage MAX232 integrated circuit possesses the function to invert and boost the voltages The pin diagram of the MAX 232 is as shown in Figure 3 10 In this project MAX232 is used to boost up the voltage as discussed previously The complete interface of MAX232 between the PIC microcontroller and GSM module is shown in Figure 3 2 MAX232 Figure 3 10 Pin Diagram of MAX232 Integrated Circuit 3 3 4 Serial Liquid Crystal Display LCD LILLELEEELEEEEEEEE EI Figure 3 11 Serial LCD Serial LCD is a low cost and functional LCD that made by Cytron Technologies It can be easily controlled by microcontroller and the display provides basic text 27 wrapping with two lines with
11. established or terminated and there is no guarantee of the success of the data transfer for this service Example of connectionless layer service is Open System Interconnection OSD 13 2 6 1 Open Systems Interconnection OSI Model The OSI model is an abstract concept of data communication dividing the functions of information exchange into layers services access points and standard protocols 13 This model consists of a total of seven layers with each of the layer has 12 own functions and services The model is separated into two categories which are the transport layer and the upper layer as shown in Figure 2 5 First layer in the OSI model physical layer is the communication interfaces of the system in which the electrical mechanical and procedural interfaces to the communication media Then for the data link layer is performing the flow control data recovery error detection and correction Network layer used for the information address route and relay Next the layer four transport layer which is the end to end mechanism of information exchanges between the processes or systems Layer five session layer where the dialog between applications established and controlled Presentation layer the sixth layer of the model provides the data format structure and representation according to predefined syntax Lastly application layer which is the process of OSI layered environment accessed by the application Upper layer
12. reduced by selecting some low cost electronic components and software that used for the project is free of charge thus the system developed is cost effective on collection of data from sensor located at remote area effectively Then the long range wireless connection is successfully established by using the GSM module with the wide coverage to cover all the area which the sensor located Besides that by converting all the data collected from the REFM sensor from analog to digital the losses suffered for long range transmission are minimized successfully The online database MySQL is customized successfully which all the data is stored and displayed on the web server The database come with a secret authorize key required to gain access to the data with this the data is secured and protected from non authorized person to misuse the data 43 5 3 Recommendations In this project the speed of the system is very crucial The accuracy of the atmospheric electric field detection depend on the speed of the data logged in the server this means that the system need to get as much data as possible during a cycle Thus the cycle time for every transmission can be further minimized Besides that external memory can be used for temporary data storage which the data from the REFM sensor can be store directly to serve as a backup data bank this is to further reduce the data losses during the transmission and having a backup storage when th
13. register FIGURE 5 1 CLKO Fosci4 PIC16F87XA Counter mode is selected by bt TOCS OPTION REG lt 5 gt in Counter mode Timer wil Increment either on every rising or faling edge of pin RAA TOCKI The Incrementing edge Is determined by tne Timmer Source Select Dt TOSE OPTION REG L gt Clearing bit TOSE selects the ris Ing edge Resrictons on the external clock input are discussed In detall in Section 5 2 Using Timer with an External Clock The prescaier Is mutually exclusively shared between the Timerd module and the Watchdog Timer The prescaler Is not readable or wri3ole Section 5 3 Prescaler detalis the operation of the prescaer 3 1 Timer0 Interrupt The TMRD interrupt Is generated when the TMRI register overtows from FFh 10 This overflow sets bit TMROIF INTCON lt 2 gt The imemupt can be masked by cearing bt TMROIE 5 gt TMROIF must be cleared in software by the Timen module Intemupt Service Routine before re enabling this Imemupt The cannot awaken the processor from Sleep since tne timer is shut off during Sleep BLOCK DIAGRAM OF THE TIMERO WDT PRESCALER Set Flag bit TMADIF on Overtow 50 WOT Tme out Note TOCS TOSE PSA PSZPJO are OPTION REG S 2 10 0 ADDRESSABLE UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER USART The Universal 5 Recelver Transmitter USART module is one of the two serai VO modues USART Is also kno
14. that they had given to me Nevertheless my great appreciation is dedicated to Faculty of Electrical Engineering UTM for the support given throughout the project Besides I would like to thank my friends and individuals whom involve directly or indirectly with this project There is no such meaningful word than Thank You So Much ABSTRACT Data transmission is a crucial part of every system as the method of data transmission can affect the efficiency of the system Different methods of data transmission will be fit in to different application due to the range of transmission and losses factor suffered by the transmission method Data transmission can be divided into two categories which are wired and wireless This project presents a research on the data transmission of the REFM network through a hardware group and program modules The main function of the proposed system is to transfer data between sensor and PC wirelessly For this purpose PIC16F877A microcontroller will be used as the central processing of the project and SIM300 GSM module is used to send the information from REFM sensor via GPRS function Then the data collected will be store in an online database MySQL for monitoring and analyzing purpose vi ABSTRAK Penghantaran data adalah bahagian yang amat penting dalam setiap sistem kaedah penghantaran data boleh menjejaskan kecekapan sesebuah sistem Kaedah penghantaran data yang berbeza akan diguna untuk aplikasi s
15. the baud rate and timer calculation in the C program are very accurate However this test is only run with one out of four of the systems so when there are increases in the number of systems the accuracy may drop The second test is mainly on the ability of the analog to digital converter function of the PIC microcontroller The test is conducted with all four sets of hardware as well to 41 test the functionality of the whole system Analog data from the function generator is successfully converted to digital and all the data are successfully transferred and stored in the online database MySQL To increase the accuracy of the conversion the C program of the converter is set with a looping of two thousand times for getting an average value for transmission Then the time intervals for the transmissions are accurate even all four sets of hardware run at the same time which is very close to one minute for every consecutive transmission However the long period of time consumed when initializing the connection to internet using the packet data thus a random period of time is needed so that all the hardware is ready to transmit Chapter 5 CONCLUSION AND RECOMMENDATIONS 5 1 Introduction This chapter will conclude the project based on the project objectives and recommendations were provided in order to improve the design 5 2 Conclusion In conclusion all of the objectives of the project are achieved Hardware cost is
16. time division multiple access TDMA and code division multiple access CDMA In the previous generation which is the first generation systems are using analog radio signal Up until today GSM network is popular since cellular phone is still using this network as the protocol of 2G networks support the voice and some limited data communications such as faxing and short messaging services SMSs 7 Thus it is on the market for a long time and now it is offering varieties of features and having users of more than 5 billion people more than 80 of earth population 8 9 In addition GSM is offering low cost ownership and worldwide coverage as this technology has been existed for more than 20 years 9 However GSM has several shortcomings which it is unable to perform transmitting and receiving data concurrently and the unsatisfactory real time ability 10 10 2 4 2 General Packet Radio Service GPRS With the shortcoming of the 2G network then it further develop into 2 5G which is the GPRS network GPRS is a packet data technology based on GSM that support both Point to Point Protocol PPP and Internet Protocol IP it provide a shorter time for internet service provider connections and the charging will be based on amount of data sent instead of connection time With the added packet switching protocols it will break the voice or data information into packets which only few kilobytes each Then based on addressing data within packet
17. will be generated by using C program as following sprintf outbuf GET StationId s amp Q u amp R u HTTP 1 1 random 7 random 255 36 2 C code converted to hex file with the HI TECH C compiler and burned into the PIC microcontroller using PICkit2 via ICSP 3 PIC microcontroller and GSM module interfaced by RS232 The circuit is connected as shown in Figure 3 2 4 Feedback connection to the computer using USB 232 converter is connected as shown in Figure 4 3 to view the whole data transmission progress 5 Power supply for both the PIC microcontroller and the GSM module are being supplied 6 Data sent collected and stored in MySQL database 4 2 1 2 Result Welcome This is my project page The table below displays the data set collected through gprs Thu 10 May 2012 23 18 49 0800 Thu 10 May 2012 23 17 50 0800 Thu 10 May 2012 23 16 51 0800 10 May 2012 23 15 50 0800 10 May 2012 23 14 52 0800 Thu 10 May 2012 23 13 51 0800 Thu 10 May 2012 23 12 50 0800 Thu 10 May 2012 23 11 51 0800 10 May 2012 23 02 15 0800 Figure 4 1 Output of the Random Value Test Showed on Web Server 4 2 2 37 Tests with Function Generator This test is conducted to ensure that the analog to digital converter is function properly Analog signal from the sensor will be able to convert to digital successful and transmit from the PIC microcontroller to the online database 4 2 2 1 Procedur
18. 0 Microchip Technology Inc PICI6F87XA Data Sheet 2003 Microchip Technology Inc MPLAB C Compiler For PIC32 MCUs User s Guide 2009 Jivan S Parab Vinod G Shelake Rajanish K Kamat and Gourish Naik Exploring for Microcontrollers Springer 2007 SIMCOM Limited SIM300 AT Commands Set version01 03 2004 Muhammad Abu Bakar Sidik Lightning Air Terminal Enhancement Based on Charge Generation Doctor of Philosophy Electrical Engineering Thesis Universiti Teknologi Malaysia 46 APPENDIX PIC16F877A Datasheet AN MICROCHIP PIC16F87XA 28 40 44 Pin Enhanced Flash Microcontrollers Devices Included in this Data Sheet PICIGFE73A PICTEFSTEA PIC16F874A PIC16F877A High Performance RISC CPU Only 35 single word instructions to leam All singe oyde Instructons except for program branches which are two cycie Operating speed DC 20 MHz clock Input DC 200 ns instruction Up to 8K x 14 words of Flash Program Memory Up to 358 x bytes of Data Memory Up to 256 x 8 bytes of EEPROM Data Memory Pinout compatible to other 28 or 4044 and PIC 16FXXX microcontrolers Peripheral Features Timet 8 bit tmericounter with 8 08 prescatier Timer 16 DE mer counter with can De Ineremented during Steep via extemal crystal ciock 8 bit timesicoumter with 2 00 period register prescaler and postscaler Two Capt
19. CONI of these registers must be configured correctly so that ADC module functions properly For this project there is only one analog input needed but the customization is done to enable a total of 3 analog input channels which means that there will be two analog pin left unused Besides that the clock conversion for the ADC module must be set as well For this project the clock conversion is set to Fos 64 where Fosc is the crystal oscillator frequency 20Mhz 3 3 1 4 Serial Communication Interface SCI SCI is also known as Universal Synchronous Asynchronous Receiver Transmitter USART It is one of the two serial I O modules USART can be configured into one of the following modes a Asynchronous full duplex b Synchronous half duplex Master c Synchronous half duplex Slave USART can be configured as a full duplex asynchronous system which can communicate with peripheral devices such as computer and CRT terminals or it can be configured as a half duplex synchronous system that is able to communicate with 23 peripheral devices such as A D or D A integrated circuits Then by setting the bit TX9 the transmission can be selected to perform an 8 bit or 9 bit transmission To configure the pins RC6 TX CK and RC7 RX DT as the USART the Serial Port Enable bit SPEN must be set to enable the serial port Next the Baud Rate Generator BRG is a dedicated 8 bit baud rate generator which supports both as
20. IC16F877A Device Features Features Characteristic V alues Operating Voltage 2 0V to 5 0V Program Memory 14 3 KBytes Data Memory 368 Bytes EEPROM Data Memory 256 Bytes I O Ports Port A B CD E Maximum Speed MHz 20 Serial Communication MSSP USART Analog to Digital Module 5 Channels Pin Count 40 20 Unlike regular integrated circuit PIC microcontroller must be programmed with C languages before it can function After programming ports on the microcontroller will be activated based on the C program The flowchart of programming a microcontroller is as shown in Figure 3 6 Programmer Uriversal Programmer Home Made A LL 11 Programmer Boot loader Figure 3 6 Flowchart of Programming a Microcontroller 18 3 3 1 1 Oscillator The main purpose of the oscillator is to determine the speed of the microcontroller to execute program read inputs and write outputs For PIC16F877A the oscillator can be operated in four different modes a LP Low Power Crystal b Crystal Resonator c HS High Speed Crystal Resonator d RS Resistor Capacitor 21 In LP or HS modes a crystal or ceramic resonator is connected to the OSCI CLK1 and OSC2 CLKO pins to establish oscillation as Figure 3 7 For PIC18F877A requires the use of parallel cut crystal and the value of capacitor and C2 will be selected based on component data sheet E Intemal z n 7
21. PSE 19 16 Ping 1 07 UNIVERSITI TEKNOLOGI MALAYSIA DECLARATION OF THESIS UNDERGRADUATE PROJECT PAPER AND COPYRIGHT Author s full name MOOK BOON KEAN Date of birth 27 AUGUST 1988 Tine DATA TRANSMISSION SYSTEM OF NETWORK USING PIC MICROCONTROLLER AND GSM MODULE Academic Session 2011 2012 declare that this thesis is Classified as CONFIDENTIAL Contains confidential information under the Official Secret Act 1972 gi RESTRICTED Contains restricted information as specified by the organization where research wos done OPEN ACCESS agree that my thesis to be published as online open access fud text acknowledged that Universiti Teknologi Malaysia reserves the right as follows The thesis is Me property of Universiti T Malaysia The Library of Universiti Teknologi Malaysia has the righ to moke copies tor the purpose of research only Me Library has the right io make copies of the thesis for ocodemic exchonge MOOK BOON KEAN ABU BAKAR SIDIK 880827 56 4087 OF SUPERVISOR Date 29 JUNE 2012 Date 29 JUNE 2012 NOTES If the thesis is CONFIDENTAL or RESTRICTED please attach with the letter from the organization with period and reasons for confidentiality or restriction I hereby declare that I have read thesis and in my opinion this thesis is sufficient in terms of scope and quality for the award of the degree of Bachelor of Engineering Electrical Name of
22. Physical Layer Figure 2 5 OSI Models 13 Transport service 6 5 4 3 2 1 2 7 Review of Previous Research 2 7 4 Wireless Data Transmission Between Personal Computers 14 This paper discussed about development of wireless data transmission between PC using radio frequency RF via the RS 232 interface The RF module of the system is supporting half duplex transmission and it is used for reception and transmission of the system PIC microcontroller is used to control the data transmission in between and MAX232 integrated circuit is used to convert the CMOS signals into RS 232 signals and vice versa 13 There are several challenges faced by this project First the noise of the reception as both of the RF modules that connected to the PCs is in reception mode even there are no transmissions of data The electromagnetic noises in the air will be streamed into the microcontroller Then transients of switching of the RF module a range of 5 to 8 random bytes will transfer to the antenna or microcontroller that takes 1 to 5 milliseconds Losses of data suffered by the RF module when transmit through air Several suggestions to improve this system have been discussed in the paper as well The RF module can be joined to a real antenna so that the sensitivity can be increased Frequency selection of the RF module can be automated by applying software control to the carrier frequency select pin And to achieve a full duplex trans
23. R 2002 Meet or Exceed TIA EIA 232 F and ITU MAX232 D DW N OR NS PACKAGE Recommendation V 28 MAX2321 D DW OR N PACKAGE Operate With Single 5 V Power Supply Operate Up to 120 kbit s Two Drivers and Two Receivers 30 V Input Levels Low Supply Current 8 mA Typical Designed to be Interchangeable With Maxim MAX232 ESD Protection Exceeds JESD 22 2000 V Human Body Model A114 A Applications TIA EIA 232 F Battery Powered Systems Terminals Modems Computers description ordering information The MAX232 is a dual driver receiver that includes a capacitive voltage generator to supply EIA 232 voltage levels from a single 5 V supply Each receiver converts EIA 232 inputs to 5 V TTL CMOS levels These receivers have a typical threshold of 1 3 V and a typical hysteresis of 0 5 V and can accept 30 inputs Each driver converts TTL CMOS input levels into EIA 232 levels The driver receiver and voltage generator functions are available as cells in the Texas Instruments LinASIC library ORDERING INFORMATION ORDERABLE TOP SIDE wenn waxzsw SOIC D socow nee La MAXISZOWR sos snares massa poem nee macnn rue waco Pape andres socom n Package drawings standard packing quantities data symbolzaton and PCB design guidelines are avaliable at uww l comisc packag
24. S232 serial port 115200bps The RS232 serial port allowed it to be able to connect to any other RS232 serial equipment which enabled remote management of the equipment The GPRS connectivity allowed the integration of the modem for an always on remote management system which it is essential for this project to collect the data from time to time The built in TCP IP stack enabled the interface with the online database to the modem with standard internet connection The main purpose of this module in the project is to transmit the data collected from the sensor wirelessly to the online database MySQL using the internet connection 3 4 Software Design In this section programming of the hardware will be developed which is putting instruction to the PIC microcontroller and the GSM module so that the hardware able to execute the system automatically In addition there are programming for the webserver which enable the data collected from the sensor to be stored and displayed 3 4 1 MPLAB IDE C and PICkit2 MPLAB IDE is developed by Microchip Technology It is an Integrated Development Environment IDE that provide wide range of facilities for the developers in a single software environment MPLAB IDE contains source code editor build automation tools linkers execution engines debuggers and other In this project it is used to develop the source code for the PIC microcontroller 29 HITECH is a free standing optim
25. Supervisor Dr Muhammad Abu Bakar b Sidik Date 24 06 2012 DATA TRANSMISSION SYSTEM OF REFM NETWORK USING PIC MICROCONTROLLER AND GSM MODULE MOOK BOON KEAN A thesis submitted in partial fulfillment of the requirements for the award of the degree of Bachelor of Engineering Electrical Faculty of Electrical Engineering University Teknologi Malaysia JUNE 2012 I declare that this thesis entitled Data Transmission System for REFM Network using PIC Microcontroller and GSM Module 1 the result of my own research except as cited in references This thesis has not been accepted for any degree and submitted in candidature of any other degree Signature U 0 cux MN eese Name MOOK BOON KEAN Date 1 JUNE 2012 Specially dedicated to my beloved father and mother Mook Lai King and Lee Siew Foong brothers and all my friends for their encouragement support and inspiration throughout my education journey ACKNOWLEDGEMENT First and foremost I would like to take this opportunity to express my heartily appreciation to my supervisor Dr Muhammad Abu Bakar b Sidik I am deeply indebted to my supervisor for the guidance and enthusiasm given throughout the progress of this project At the outset I would like to express my gratitude to my family especially my parents who has been so tolerant and supports me throughout my study in Universiti Teknologi Malaysia Thanks for their encouragement love and emotional supports
26. at are essential for the project completion Information was obtained through books journals articles and online Sources 2 2 Lightning Strike Phenomenon Lightning strike represented as one of the most important causes of deaths injuries and property damage from environmental phenomena A peak discharge in which charge accumulated in the clouds discharges into neighboring cloud or to the ground is the lightning phenomenon 1 However the factors which contribute to the charge accumulation in the clouds are many and uncertain There are three main types of cloud discharge which normally occurred as showed in Figure 2 1 a Within cloud b Cloud to ground c Cloud to cloud CLOUD TO GROUND Figure 2 1 Types of Lightning Strike Malaysia a country with high atmospheric humidity and solar heating result in higher lightning strike density Kuala Lumpur the country capital city is ranked fifth in the world with its high lightning strike density 2 In addition a typical lightning strike is able to last more than one second and plenty of discharges occurred within the second 1 2 2 1 Mechanism of Lightning Strikes The charge density of the clouds increased will result in the increase of surrounding electric field When the electric field intensity exceeds the insulation strength of a portion of the moist ionized air air breakdown will occurred The surrounding air will transform into a conductor allowing charge to transfer
27. ce 1972 Digitized Dec 2007 Vaisala Oyj Vaisala Thunderstorm Electric Field Mill EFM 550 User s Guide October 2006 Xiang Yang Li Wireless Ad Hoc and Sensor Networks theory and Applications Cambridge book online Cambridge university press 2011 GSM Association GSM World statistics retrieved 8 June 2010 Eugen Horatiu Gurban and Gheorghe Daniel Andreescu SCADA Element Solutions using Ethernet and Mobile Phone Network IEEE 9 International Symposium September 2011 Hong Cai A Remote Wireless Data Acquisition System Based on Ad Hoc Network and GPRS Second International Workshop on Computer Science and Engineering IEEE 2009 Michael Kofler The Definitive Guide to MySQL 5 Third Edition Apress 2005 Vikram Vaswani The Complete Reference MySQL McGraw Hill 2004 13 14 15 16 17 18 19 20 21 45 Joseph Ghetie Fixed Mobile Wireless Networks Convergence Cambridge book online Cambridge university press 2011 Nobbert Stuban Wireless Data Transmission between Personal Computers IEEE 27 Int Spring Seminar 2004 Marcelo Sylvio M dos Santos Raimundo Carlos S Freire Jose Felicio da Silva Wireless Data Acquisition System for Remote Care of Newly Born Prematures International Workshop Medical Measurement and Applications MeMeA April 2006 Maxim Integrated products 5V Powered Multichannel RS 232 Drivers Receivers 201
28. ct bits ADCONO bits in bold CHS2 CHS0 Anaiog Channel Select bits 000 Channel 0 001 Channel 220 Channel 2 AN2 2 1 Channel 3 AN3 100 Channel 4 ANE 101 Channel 5 15 Cama 6 JANA 111 Channel 7 AN Note The PIC16FET3AG76A devices only implemert AD channels 0 Pour 4 the seecjons ae reserved Do not select any unimpiemented ETUR UN Mi INA GOIDONE A D Conversion Status bit When ADON 1 1 A D conversion in seing this bh stars the A D conversion which Is automaticaly Cleared by hardware when A D conversion Is complete 0 A D conversion not in progress 1 A D converter module Is powered up 0 A D converter module Is shut off and consumes no operating current Legend R Readabie W n Value at POR t Git is set U Unimplememegd bit read as T O Eit is x Btis unknown 52 53 APPENDIX B SK40C Development Board User Manual Cytron Technolog SK40C ENHANCED 40 PINS PIC START UP KIT User s Manual v1 2 Dec 2010 Inforradico cortarsod m thee pubbcstem deve applications and the ue micaded trough vaggesacn asd may bc uprnedei hy updako li c yos opomubikiv ini moda vih yor spos cateam No repececttadics warranty te given asd ledelity sauzned by Cytron Tecbratogec gt Incorporated with nexpect In the accaracy or usc ul mach Kiran or in
29. e C to 70 C MAX232 2321 DUAL EIA 232 DRIVERS RECEIVERS 34 5047 FEBRUARY 1929 REVISED OCTOBER 2002 absolute maximum ratings over operating free air temperature range unless otherwise noted Input supply voltage range Vcc see Note 1 0 3Vto8 V Positive output supply voltage range Vs Vec 0 3 V to 15 V Negative output supply voltage range Vs Input voltage range Vj Driver 0 3 V to Vcc 0 3 V Receiver Output voltage range TIOUT T20UT Vs 0 3V to Vs 0 3 V R1OUT R2OUT 0 3 V to 0 3V Short circuit duration T1OUT T2OUT imi Package thermal impedance see Note 2 D package NS package Lead temperature 1 6 mm 1 16 inch from case for 10 seconds Storage temperature range Tstg t Stresses beyond those listed under absolute maximum ratings may cause permanent damage to the device These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions Is not impiled Exposure to absotute maximum rated conditons for extended periods may affect device reliability NOTE 1 voltage values are with respect to network ground terminal 2 The package thermal impedance is calculated In accordance with JESD 51 7 recommended operating conditions T o MN wx uni Lai 5 5 55 v S VO a m
30. e end users unable to harvest data when no internet connection available The power supply of the system must be improved as well For this project the power supply for both the PIC microcontroller and the GSM module is using the power adapter connecting to plug However for actual application of the system the system is located at remote area which no electric plugs available Thus alternative power supply such as LiPo rechargeable battery and solar cell can be used to improve Lastly the project can be further develop into a more complete system by implementing more sensors into the system so that the measurement of the atmospheric electric field can be more accurate for example a GPS module can be interfaced to get the exact location of the electric field measured 4 5 8 9 10 11 12 44 REFERENCES M S Naidu V Kamaraju High Voltage Engineer Third Edition International Edition McGraw Hill Education 2004 National Lightning Safety Institute NLSI http www lightningsafety com nlsi info world lightning activity html Access on May 2012 John Wiley amp son Reliability Technology Principles and Practice of Failure Prevention in Electronic System Wiley 1 edition pp 5 44 5 45 2011 Mark 1 Montrose Edward M Nakauchi Testing for Compliance Approaches and Techniques pp 175 176 2004 Albert Edward Green Alfred John Bourne Reliable Technology Wiley Interscien
31. eration of each pin 5 selected by clearing setting the appropriate control bits in the ADCON1 and or CMCON registers Note Power on Reset these pins are con figured as analog inputs and read as 0 The comparators are in the off digital state The TRISA register controls the direction of the port pins even when they are being used as analog inputs The user must ensure the bits in the TRISA register are maintained set when using them as analog inputs FIGURE 4 1 BLOCK DIAGRAM OF PINS VO RD PORTA To A D Converter or Comparator Note 1 pins neve protection diodes to Won and Vss 5 0 TIMERO MODULE The Timer module timer counter has the following features amp bit timericounter Readabie and writable amp bit software programmabie prescaler imema or extemal clock select interrupt on overfow from to 007 Edge select for external clock Figure 5 1 is a block diagram of the TimerD module and the prescaler shared wiih the WDT Additional Information on the Timer modue Is avalabie In the Mid Range MCU Family Timer mode is selected by cearng bit TOCS OPTION REG lt E in Timer mode the Timerd module wil Increment every instruction without prescaler t the TMRD register Is writen me Incre ment Is Inhibited for the fofowing two Instruction cycles Tar ides uat uU BM w celina an ARRA value to the TMRD
32. es l C Programming for the PIC microcontroller completed and the AT command for GSM module included in the C program C code converted to hex file with the HI TECH C compiler and burned into the PIC microcontroller using PICkit2 via ICSP PIC microcontroller and GSM module interfaced by RS232 The circuit is connected as shown in Figure 3 2 Analog signal generated by using the function generator and connected to the predefined Analog to Digital converter pin on the microcontroller Feedback connection to the computer using USB 232 converter is connected as shown in Figure 4 3 to view the whole data transmission progress Power supply for both the PIC microcontroller and the GSM module are being supplied Data sent collected and stored in MySOL database 4 2 2 2 Result elcome his is my project page table below displays the data set collected through gprs Mon 21 May 2012 17 49 48 0800 Mon 21 May 2012 17 49 40 0800 Figure 4 2 Output of the Function Generator Test Showed on Web Server USB 232 converter PIC16f877a interface Serial LCD Figure 4 3 Systems with Feedback to the Computer 38 39 Figure 4 4 Hardware Completed in Box 4 3 Software Results The programming script refer to appendix is free from syntax error and it is compiled successfully and programmed successfully to PIC16F877A File Device Family Programmer Tools View Help Midrange Standard Configuration
33. esign Wide operating voltage range 20V to 5 54 Commercial and Industrial temperature ranges m Til S IST s P alwa is ach 2 1 mceegreA iasx 368 295 2 s 2 ws w 223 2 Picssr 14 2x 268 33 s 2 w ves 20 23 Pin Diagrams Continued Q OSCACLAO 4 HCUTIOSQTICH RCHTIOSUCCPT NCYSOUSCL e a an RCIYXITZT noes sess KOS sre vo Gna bun gt ns nez PIC 16F 874A 577A nat nul nu v noses 5 4 NCIMXIDI MCSSDO MZXVPSUS 2 5 2 44 Pin PLCC WAA TOCKIAC t OUT AEM DANS v CECB KD NOVTIOSOVTI ce ROUT OECEI O po sc RCOTIOSOT ICH OSCR LD OSC vss __ IOUT PIC16F87XA RBI RIANT Woo vss RONPSP Rears RUMPSPS MCTAOUDT 47 48 PIC16F87XA TABLE 1 2 PIC16F8734 876A PINOUT DESCRIPTION CONTINUED programmed or intemal week pul ups on al Digts vo Extema rtemupt vo vo vo Low voltage singe SJppry ICSP programming enabie pin vo Digtx vo vo in creull debugger and ICSP programming clock
34. fective on collection of data from sensor located at remote area identifying the suitable hardware and software to be used in the project The second objective of this project is to transmit data from sensor by using long range wireless connection GSM module which offering both GSM and GPRS with worldwide coverage will perform the long range transmission The third objective of this project is to reduce the losses suffered from long range transmission By converting the analog data collected from sensor to digital data for transmission by using PIC microcontroller The fourth objective of this project is to receive and store data for analysis Online database MySQL will be personalized so that the data will be stored and is set to restrict to only authorized personnel are able to get access to data for further analysis 1 4 Scopes These scopes are to ensure the project is conducted within its boundary of software and hardware design and the final product achieves its intended objectives The following are the scopes of design e Write a program using C language with the Integrated Development Environment IDE of the project MPLAB version 8 46 to set the peripheral functions such as Analog to Digital conversion and timer of PIC microcontroller e Use C programming to send AT commands to the GSM module and response to the reply from the GSM module so that the wireless connection commenced e Write a program using Hypertext P
35. frngoneri of patent other izielectua property rez wach usc cr otherwte The of Cyron Teckre pgoex gt prudaci ax crack crergrnesb m ale cysizzp tx nol azboncad evot arhi cuprov appeeval ty ebron Tacievslogim Ne accuses sre comecpod ce clberwose sader r srtelkecical property natas 54 Cytron gt ROBOT HEAD to TOE Technolog Product User s Manual SK40C 3 BOARD LAYOUT Sim 5 a a Top View b Side view ROBOT HEAD io TOE Product Uzor z Manual SK40C c Borom view bel Function DC power adaptor socket USB Connector C aggle Switch for power supply Power indicator LED omnectar for OO Programmer LED Indicator 7 2 pan and turn pan H UARI Connector Programmable Pash Burton Reset button LCD contrast JPS for LUD Backlight gt M JPS for USB 40 pan IC socket for PIC MCU um pu OJ ka Ga EJ N DC power adaptor socket for user to plug in DC adaptor The input voltage should be ranged from 7 to 15V USB ecounector for communication between devices and host controller usually personal computers Thi function is only valid for certain model of PIC microcontroller 56 APPENDIX MAX232 IC Datasheet MAX232 2321 DUAL EIA 232 DRIVERS RECEIVERS 34 3047 FEBRUARY 1989 REVISED OCTOBE
36. h hardware and software design are involved in the project The process flow of the project methods and techniques used in the circuit design programming testing and debugging will be discussed in detail in this chapter 3 2 System Design of Data Transmission System of REFM Network Using PIC Microcontroller and GSM Module PIC Microcontroller Figure 3 1 Block Diagram of the Proposed System Figure 3 1 above shows the overview of the whole system of data transmission system of REFM network using PIC microcontroller and GSM module The rotational electric field mill REFM will detect the changes of the atmospheric electric field and the output of this sensor will be regulated and sent out as an analogue data The output then will be connected to the RAO pin of the PIC microcontroller in which RAO pin is set as 16 the input pin for analog to digital converter ADC Then the built in ADC in the PIC microcontroller PIC16F877A with will convert the analog input to digital form There will be a voltage driver used in this system There are two types of signal within the circuit which are CMOS signal and RS232 signal For CMOS signal of the microcontroller the voltage levels are and 5V while RS232 signal for the GSM module is 12V thus an integrated circuit MAX232 used as the voltage driver to convert the voltage level of CMOS signal to RS232 signal and vice versa 14 After the data of the electric field measured by
37. igital Converter ADC Thus users can program and customized the function of the ports After the study of microcontroller there is a type of microcontroller which is suitable for this project which is PIC16F877A It is a 40 pins microcontroller which having peripherals function that needed for the project 1 16 877 Figure 3 4 PIC16F877A MCLR Vee RAO ANO RA1 AN1 RA2 AN2 Vagr CVREF RA3 AN3 VREF RAA TOCKI CTOUT RAS ANA SSIC2OUT REO RD ANS RE1 WRIANG RE2 CS AN7 Vss OSC1 CLKI e OSC2 CLKO 4 RCO T1OSO T1CKI RC1 TTOSI CCP2 RC2 CCP1 RC3 SCK SCL RDO PSPO 19 RD1 PSP1 lt 20 PIC16F87 7A 30 D RD7 PSP7 29 RD6 PSP6 28 RDS PSP5 27 RD4 PSP4 26 RC7 RX DT 25 RCE TXICK 24 O RC5 SDO 23 RC4 SDI SDA 22 J RD3 PSP3 J RD2 PSP2 Figure 3 5 Pin Diagram of PIC16F877A 17 19 PIC16F877A is the core of the hardware design as it acts as the central processing unit of the whole system the data will be received processed and transmitted by the microcontroller PIC16F877A has 4 ports with 33 digital I O ports it has a range of operating voltage from 2 0V to 5 0V Compare to other 8 bits microcontroller PIC16F877A has a rather sufficient memory and it can support frequency up to a maximum of 20 MHz Table 3 1 Part of P
38. igure 4 5 Figure 4 6 Output of the Random Value Test Showed on Web Server Output of the Function Generator Test Showed on Web Server Systems with Feedback to the Computer Hardware Completed in Box Programmer s Output Compiler s Output 36 38 38 39 39 40 xiii xiv LIST OF SYMBOLS SYMBOL DEFINITION Hz Hertz M meter M Mega V Volt I Current k Kilo P Pico F Farad Fosc Oscillation frequency 2G Second generation SYMBOL EFM REFM GSM GPRS RDBMS SQL IDE ADC AT PHP TTL MSC TDMA CDMA SMS PPP IP OSI PIC CMOS PC I O ports XV LIST OF ABBREVATION DEFINITION Electric Field Mill Rotating Electric Field Mill Global System for Mobile Communication General Packet Radio Service Relational Database Management System Structured Query Language Integrated Development Environment Analog to Digital Converter Attention Hypertext Prepocessor Transistor Transistor Logic Mobile Switching Center Time Division Multiple Access Code Division Multiple Access Short Messaging Service Point to Point Protocol Internet Protocol Open System Interconnection Peripheral Integrated Circuit Radio Frequency Complementary Metal Oxide Semiconductor Personal Computer Input and Output ports USART WAP ROM RAM EEPROM MCLR POR SCI SPEN BRGH LCD SPI TCP HTML xvi Universal Synchronous Asynchronous Receiver Transmitter Wireless Application Protocol Read Only Memo
39. istem yang berbeza kerana linkungan penghantaran dan faktor kehilangan data yang dialami akan diambil kira Penghantaran data boleh dibahagikan kepada dua kategori iaitu berwayar dan tanpa wayar Projek ini membentangkan kajian mengenai penghantaran data untuk rangkaian REFM melalui satu kumpulan perkakasan elektronik dan modul program Fungsi utama sistem yang dicadangkan adalah untuk memindahkan data antara sensor dan PC secara wayarles Untuk tujuan ini mikropengawal PIC 16F877A akan digunakan sebagai pusat pemprosesan projek dan SIM300 GSM modul akan digunakan untuk menghantar maklumat daripada sensor REFM melalui fungsi GPRS Kemudian data yang dikumpul akan disimpan dalam pangkalan data dalam talian MySQL untuk memudahkan proses pemantauan dan penganalisis CHAPTER TABLE OF CONTENTS TITLE DECLARATION OF THESIS ACKNOWLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENT LIST OF TABLE LIST OF FIGURE LIST OF SYMBOLS LIST OF ABBREVATION LIST OF APPENDICES INTRODUCTION 1 1 Background 1 2 Problem Statements 1 3 Research Objectives 1 4 Scopes 1 5 Outline of Thesis LITERATURE REVIEW 2 1 Introduction 2 2 Lightning Strike Phenomenon 2 2 1 Mechanism of Lightning Strikes 2 3 Rotating Electric Field Mill vii PAGE ii iv vi vil xi xii RW t N rN 2 4 Data Transmission 2 4 1 Global System for Mobile Communication GSM 2 4 2 General Packet Radio Service GPRS 2 5 O
40. izing ANSI compiler It implements the optimizations of Omniscient Code Generation OCG which is a whole program compilation technology to provide better performance and denser code for the PIC microcontroller development HITECH C is used as a compiler and it build the complete C language source code into HEX file 18 MPLAB IDE support both assembly language and C language for programming However the MPLAB IDE has to be set to use the HI TECH C compiler to support the C language In this project C language will be used as it is a fundamental language in programming Furthermore it is easy to understand and many operations and function such as trigonometry and arithmetic can be implemented easily 19 Another application developed by Microchip Technology that will be used in the project is PICkit2 Its main function is to download the firmware written in MPLAB IDE into the EEPROM and Flash of microcontroller via a programmer There are a lot of programmers for PIC microcontroller range from simple designs which depend on In Circuit Serial Programming ICSP that allow direct download of code from the host computer to intelligent programmers which able to verify the device at several supply voltages For this project the programmer that will be used in the project is the Cytron programmer developed by Cytron Technologies The whole progress is as shown in Figure 3 13 30 Determine microcontroller Write source code C language
41. lectric field induced Figure 2 3 is measured within distance of 100m from the lightning strike to ground o o o o tem gt 2 2 D o ID 10 Time uS Figure 2 3 Electric Field Strength Variations 5 2 3 Rotating Electric Field Mill Rotating Electric Field Mill is an electro mechanical device which measures the relative strength of an electric static field by comparing the reference level of electric field There is a sensor plate in the device when it is exposed to the electric field the uncharged plate will be charged Two main processes occurred in the field mill which are exposing and shielding Exposing is to expose the sensor plate to atmosphere so that it will be charge while shielding will be discharge of the sensor plate These processes are controlled by a motor driven rotor and stator arrangement which will open and close alternately as showed in Figure 2 4 6 By comparing with reference the rate and level of the sensor plate changing will be determined and whenever there is excessive electric field density lightning strike will most likely occurred it will be predicted and safety precaution may be done in time Rotating vane Motor chamber Figure 2 4 Rotating Electric Field Mill 21 2 4 Data Transmission Data transmission has played an important role in the advancement of mankind as it is utilized in computer buses for communication with peripheral equi
42. mission by using discrete transmitter and receiver on both end of the system 2 7 2 Wireless Data Acquisition System for Remote Care of Newly Born Prematures 15 This paper discussed about the development of a data acquisition system and monitoring system for the newborn premature incubators Several sensors are implemented in the system to measure the temperature humidity sound level pressure and air flow velocity Then there is a data acquisition system which is based on microcontroller PIC18F4520 I P built in with 13 channels Analog to Digital converter module The data collected from the sensor will be converted to digital and an Enhanced Addressable USART capable of standard EIA 232 operation interface with the microcomputer PC User s software application in the PC which developed using the Builder 6 will be used to store the information collected by the system and a web server is established so that the collected data will be available for the remote user Online database MySQL 5 0is used and PHP language used to generate the web contents in the web server 14 using WAP on GSM GPRS EDGE network the end users able to access to the online database from remote location and the users able to check real time important information from the incubator to help monitoring the baby s health Chapter 3 METHODOLOGY 3 1 Introduction Chapter three is the description on the design methodology of this project Bot
43. n I O ports may be found in the PiCmicro Mid Range Reference Manual 0533023 4 1 PORTA and the TRISA Register PORTA is a 6 bit wide bidirectional port The corre sponding data direction register is TRISA Setting a TRISA bit 7 1 will make the corresponding PORTA pin STATUS STATUE PORTA Banko Initialize PORTA by Clearing output data latches Select Bank 1 Configure zlil pins digital inputs Value used to initialize data direction Sat RA lt 3 0 gt as inputs RA 5 4 outputs TRISA T 6 ara always an input Le put the corresponding output driver in a read as 0 High Impedance mode Clearing a TRISA bit 0 will make the corresponding PORTA pin an output i e put the contents of the output latch on the selected pin Reading the PORTA register reads the status of the pins whereas writing to it wil write to the port latch All write operations are read modify write operations Therefore a write to a port implies that the port pins are read the value is modified and then written to the port data latch Pin RA4 is multiplexed with the Timer module clock input to become the RA4 TOCKI pm The RA4 TOCKI pin is a Schmitt Trgger input and an open drain output All other PORTA pins have TTL input levels and full CMOS output drivers Other PORTA pins are multiplexed with analog inputs and the analog Veer input for both the A D converters and the comparators The op
44. ng huge user base thus the 11 software is tested in variety of environments and results in rapid bugs locating and resolving 12 2 6 Communications Architectures and Protocols The procedures for the transmission between the senders and the receivers must be clear for both the senders and receivers so that the transmission is effective There are four essential aspects in communications services First the communication interfaces are the connection points in between that allow the communication of the network devices Then the communication protocols are the description that used to set the transmission rules and data formats for the transmission Layered communication is the multilayer where communication protocols located and each layer will provide services to the upper layer Lastly the information models are the collections of devices having common characteristics based on their definitions and attributes There are two types of communication services which are connection oriented layer service and connectionless transmission services For connection oriented service a full control of every aspect of data transfer assured the ability of both communication parties exchanging information as the layer connection in between will be established when data transfer begin and terminated at the end of data transfer For example phone calls Next connectionless layer service is different with the previous service as it has no connection
45. nline Database MySQL 2 6 Communications Architectures and Protocols 2 6 1 Open Systems Interconnection OSI Model 2 7 Review of Previous Research 2 7 1 Wireless Data Transmission Between Personal Computers 2 7 2 Wireless Data Acquisition System for Remote Care of Newly Born Prematures METHODOLOGY 3 1 Introduction 3 2 System Design of Data Transmission System of EFM Network Using PIC Microcontroller and GSM Module 3 3 Hardware Design 3 3 1 Peripheral Interface Controller PIC Microcontroller 3 3 1 1 Oscillator 3 3 1 2 Reset MCLR 3 3 1 3 Analog to Digital Converter ADC 3 3 1 4 Serial Communication Interface SCD 10 10 11 11 12 12 13 15 15 15 16 17 20 21 22 22 viii 3 4 3 3 2 3 3 3 3 3 4 3 3 5 SK40C Development Board Serial Communication 3 3 3 1 232 Integrated Circuit Serial Liquid Crystal Display LCD MOD 9001D RS232 GSM GPRS Module Software Design 3 4 1 3 4 2 3 4 3 3 4 4 MPLAB IDE HITECH C and PICkit2 AT Commands PIC Microcontroller Program Flow Online Database MySQL TESTING RESULTS AND DICUSSION 4 1 4 2 4 3 4 4 Introduction Testing 4 2 1 4 2 2 Tests with Random Value 4 2 1 1 Procedures 4 2 1 2 Result Tests with Function Generator 4 2 2 1 Procedures 4 2 2 2 Result Software Results Discussions CONCLUSION AND RECOMMENDATIONS 5 1 5 2 Introduction Conclusion 24 24 25 26 27 28 28 30 31 33 35
46. ology Inc 1273 Omniscient Code Generation not available in Lite mode warning Memory Summary Program space used 1B1Ch 6940 of 2000h words 84 7 Data space used 10Fh 271 170h bytes 73 6 EEPROM space sed Oh Oof 100h bytes 00 Configuration bits used 1h 1 of Ihwod 10009 ID Location space used 0h Oof 4hbytes 00 Running this compiler in PRO mode with Omniscient Code Generation enabled produces code which is typically 40 smaller than in Lite mode The HI TECH C PRO compiler output for this code could be 2316 words smaller See http microchip htsoft com portal pic pro for more information Loaded CAUsers ken DesktopFY PGPRS coding GPRSv1_1 GPRSv1 GPRSw1 oof Build sgocessuli 4 n Figure 4 6 Compiler s Output 4 4 Discussions The aim of this project is to develop a data transmission system And it will be interfaced with the REFM network to become a complete set of hardware of an Atmospheric Electric Field Detector In order to achieve the aim sets of virtual inputs are generated to experimentally simulate the performance of developed system The first test on the ability of the data transmission from the PIC microcontroller to the online database the data is successfully transferred and stored in the online database MySQL The time intervals for the transmissions are accurate which is very close to one minute for every consecutive transmission Hence the test showed that
47. or PHP Language PHP language acts as the intermediate language in between the MySQL database and Hyper Text Markup Language HTML which is the language used to display information on the web browser The access diagram using PHP language is as shown in Figure 3 16 34 PHP language will be used to generate web contents in the webserver when there are page request from the web browser PHP language will function to fetch the data stored from the MySQL database 15 Then the data will be sent out dynamically as an HTML page for the web browser so that the user can read the data collected Obtain Web Server Dynamic data page d MySQL database Web Browser Page request Figure 3 16 PHP Language Access Diagram Chapter 4 TESTING RESULTS AND DISCUSSIONS 4 1 Introduction Chapter four shows the testing results and the discussion of the project Two types of tests had been conducted to verify and obtain the results from the system developed First the test is conduct by random value and second test is using a function generator to generate the analog input 4 2 Testing 4 2 1 Tests with Random Value This test is conducted to ensure that the signal will be able to transmit successfully from the PIC microcontroller to the online database 4 2 1 1 Procedures 1 C Programming for the PIC microcontroller completed and the AT command for GSM module included in the C program a Test with random value Random value
48. pment Data transmission can be defined as the physical transfer of data over a point to point or point to multiple communication channel There are various types of channels available for data transmission for example wires made of copper or fiber optics Each of it has been use for different type of applications In the market there are mainly two types of data transmission channels which are wired and wireless Wireless transmission is the transfer of data between two or more points which the channels are not physically connected 7 The range of the wireless transmission can be either short or long depends on the device used And it is mainly used to overcome situations where normal cabling is difficult or financially impractical Wireless networks are divided into two categories based on how it is constructed First the infrastructure based network which a network is having preconstructed infrastructure that is made of fixed network structure For example cellular network that built from back bone switches mobile switching centers MSCs base stations and mobile hosts Second the infrastructureless network which a network is formed dynamically through a collective of random set of independent wireless devices For example a mobile ad hoc networks which connect several wireless devices 7 2 4 1 Global System for Mobile Communication GSM GSM is the second generation 2G systems that use digital multiple access technology such as
49. ram all of the peripheral functions that needed for the project will be initialized such as timer LCD interrupt USART I O ports and ADC After that AT commands will be sent to the GSM module to initialize the module and perform the wireless data transmission Several looping programmed so that when the program encounter error it will take the loop and rerun part of the program by itself Figure 3 14 Program Flow for Microcontroller 32 33 3 4 4 Online Database MySQL Since for this project the online MySQL server used is a functioning server which is for other purposes thus a new subdomain has to be created to hold the data for this project Before the database is able to receive and store the data we will have to customize the subdomain by setting parameters in the MySQL control panel as showed in Figure 3 15 Preferences w Getting Video Change Update Change Change Shortcuts Started Tutorials Password Contact Style Language Wizard Info Mail Files E e V File Legacy i Web Disk FTP FTP Manager File Accounts Session Manager Control Logs Security Domains e g BS x Subdomains Addon Redirects Simple Domains DNS Zone Editor Databases a T n UN Musis A MySQL MySQL phpMyAdmin Remote Databases Database MySQL Wizard Figure 3 15 MySQL Database Control Panel Then the connection to the MySQL database is done by Hypertext Preprocess
50. ransmit Data can be Panty bit Legend W Vititable bit tT Elt Is set U Urimpremented b read as C O Bhisdeaed x Btis unknown 11 0 ANALOG TO DIGITAL CONVERTER A D MODULE The Analog to Dighal A D Converter module has five inputs for the 25 pin devices and eight for the 40 44 pin devices The conversion of an analog Input signat results In a corresponding 10 bit digital number The A D module nas nigh and low voltage reference Input mat Is soft ware seiectabie to some combination of Vio Vss or RA3 The A D converter has a unique feature of being able to operate while the device is Sleep mode TO operate in Sleep A D clock must be derived from the A D s Intemal RC oscilator REGISTER 11 1 PIC16F87XA The A D module nas four registers These registers are A D Result High Register ADRESH A D Result Low Register ADRESL A D Control Register 0 ADCON0 A D Register 1 ADCON1 The ADCOND shown in 11 1 Com trois the operation of the A D module The ADCON1 register shown in Register 11 2 configures func tions of me port pins The port pins can be configured as anaog Inputs can aso be voltage reference or as digia VO Additonal information on using the A D module can found in the PICmkro Mid Range MCU Family Reference Manual 0533023 posee REGISTER ADDRESS 1Fh RVD RAND RIN D RVD ao uo ADCS1 ADCSO A D Conversion Ciock Sele
51. related project easier and faster as using this board can eliminate plenty of sophisticated soldering work and users able to program the PIC microcontroller directly without unplug the microcontroller from the board The board is come with some basic features such as LED indicator UART communication reset button two programmable push buttons connector for PIC programmer and others Users will have to program the microcontroller to utilize those features which embedded on the development board 3 3 3 Serial Communication Data collected from the sensor have to be send to the online database for display and store In order for the data transmission to be success a connection must be established in between the PIC microcontroller and the GSM module In this project RS232 standard an asynchronous serial communication is used for the connection Asynchronous indicated that the information is sent at any time customized by the developer 25 3 3 3 1 MAX 232 Integrated Circuit Figure 3 9 MAX232 Integrated Circuit The MAX232 Integrated Circuit consists of four sections which are dual charge pump DC DC voltage converters RS 232 drivers RS 232 receivers and receiver and transmitter enable control inputs Serial RS 232 communication for the GSM module are having voltage level of 15V to 3V for high state and 3V to 15V for low state which are not compatible with the PIC microcontroller Transistor Transistor Logic TTL voltages As
52. reprocessor PHP for the online database MySQL for online data storage e Design a voltage driver circuit with MA X232 integrated circuit for interfacing serial port of GSM module and TTL logic device PIC microcontroller e Implement of designed circuit system to hardware and feedback the hardware output to PC for monitoring purpose 1 5 Outline of Thesis This thesis consists of five chapters In first chapter it focuses on the main ideas of the project mainly about the problem statements objectives and scopes of this project While Chapter two will discuss more on theory and literature reviews that have been done It will discuss about the studies that are related to this project Information was retrieved via books journal online sources and articles In Chapter three the discussion will be on the methodology to conduct this project Hardware and software design of the entire project will be discussed which include the methods and techniques used in the circuit design programming and others In Chapter four the testing results and the discussion will be included Lastly Chapter five will be the summary for this thesis and recommendations suggested for improvement on this design and for further research related to this topic Chapter 2 LITERATURE REVIEW 2 1 Introduction Chapter two explains about the literature review on the studies that are related to this project Literature review provides guidelines and information th
53. ry Random Access Memory Electrical Erasable Programmable Read Only Memory Master Clear Power on Reset Serial Communication Interface Serial Port Enable High Baud Rate Select Liquid Crystal Display Serial Peripheral Interface Transmission Control Protocol Hyper Text Markup Language APPENDIX g o tu gt LIST OF APPENDICES TITLE PIC16F877A Datasheet SK40C Development Board User Manual MAX232 IC Datasheet Serial LCD User Manual xvii PAGE 46 52 53 55 56 57 58 60 CHAPTER 1 INTRODUCTION Chapter one introduces the project description which includes the background of the project problem statements objectives scopes and the outline of the thesis 1 1 Background Atmospheric electric field detection is very crucial for area with high rate of lightning occurrence Atmospheric electric field detection is very useful in detecting the atmospheric conditions at surroundings thereby knowing when the lightning is occurring By predicting the lightning strike occurrence warning can be send out to alert the people at the particular area so that they are able to avoid walking in the outdoor areas which is exposed to lightning strike or take shelter in time In addition there are lack of atmospheric electric field detection systems are installed in highly congested areas such as parks and recreation or cities and municipalities therefore it is difficult to evacuate the crowd The detection system is able to de
54. s well microprocessor is a standalone microchip that it unable to do anything on its own Thus it required peripherals such as Input and Output ports ports Read Only Memory ROM Random Access Memory RAM and others to function as a system Microcontroller contains all the components such as built in ROM RAM I O ports and others for it to function on its own but it is not processing as fast as microprocessor 18 In microcontroller there are plenty types of memories several important memories of the integrated circuit are ROM RAM and EEPROM Read Only Memory ROM can only be read and unable to change the data inside of this memory Thus users can only use the functions that have been customized by the manufacturer Random Access Memory RAM is a volatile memory which enabling the data read and write continuously Data which stored inside the RAM will not retained once the power supply is disconnected from the microcontroller Electrical Erasable Programmable Read Only Memory EEPROM is one of the most important memories in the microcontroller It is a nonvolatile memory where users can erase and reprogram the microcontroller using an external programming device Every microcontroller has different number of Input and Output ports I O ports available for users to program it Some of the I O ports are supporting certain peripheral functions such as Universal Synchronous Asynchronous Receiver Transmitter USART or Analog to D
55. tect the atmospheric condition and help in evacuating the crowd efficiently Previously there are many atmospheric electric field detection equipment had been invented As in the era of science and technology there are rapid growths of the industry there is a need in system which able to deliver accurate result in a short interval In the same time the method of sending alert to end user is crucial factor of the effectiveness of the system Furthermore most of the systems available do not possess the ability to store the collected data and conventional method of data storing is inefficient and involving plenty of handwriting For many type of applications data storing is essential for future reference and research 12 Problem Statements In the market there are numerous advanced atmospheric electric field detection systems but the tradeoff for the highly sensitivity and powerful eguipment the cost of the system will be very high Furthermore most of the highly sensitivity and powerful equipment required sophisticated setup test and extra precaution to be considered AII these may result in inconvenience for the users From all of the available advanced atmospheric electric field detection systems most are using rotating electric fill mill REFM as their sensors as it is a specialized instrument used for atmospheric electric field measurement Most of the systems the main problem faced is the connection between the sensors with
56. the REFM converted into digital form it will be transmitted by the GSM module to the online database using the wireless connection GSM module will be function by receiving sets of AT commands from the PIC microcontroller It will connect to the internet using GPRS network and commence the data transmission Once the remote server MySQL online database received the data from the GSM module it would store and display the data date time and station ID on the online database Thus end user able to access to the database by using computer with internet connection 3 3 Hardware Design In designing the system both of the circuit design and hardware development played an important role The main components in this system include microcontroller integrated circuit and the GSM module for the wireless communication of these components need an operating voltage which is consistent especially for the microcontroller and GSM module in order to function well A voltage regulator chip such as MAX232 is needed to regulate the circuit as shown in Figure 3 2 17 amp m D a 2 a TIN TLOUT TOUT KI OUT RIN ROU RN MAX232 Z GND v Figure 3 2 Schematic of the Hardware Design 16 3 3 1 Peripheral Interface Controller PIC Microcontroller Figure 3 3 PIC Microcontroller PIC microcontroller is an integrated electronic computing device it can be categorized as a microprocessor a
57. the end users Conventional method of the connection to the end user is by using wired transmission but the cost for the cable will be very high if the distance between sensor and end user is far Then the development of the wireless industry leads to the improvement of REFM network which overcome the problem of wired connection However the transmitting devices that used for REFM network currently are discouraging as the range of device is limited in a very short range Therefore it is very inconvenience if end users or main server located far from the sensors Other than that for long range transmission of data the losses of transmission must be considered High losses will cause the efficiency of the system to drop drastically and result in inaccurate prediction and data collection Therefore the choice of data format for transmission must be considered as to decrease this problem In most cases we are not only acquiring the values from the REFM sensor and direct it to users but we have to store the data constantly as well Data storing is essential as the data stored can be as reference for future improvement of the systems as well as to be used for research purpose Furthermore data stored will be analyzed before the alert sent to the users this will reduce the false alert occurrence and increase the accuracy of the system 1 3 Research Objectives The first objective of this project is to provide a solution which is cost ef
58. the information will be routed by network between different destinations As compare to GSM GPRS has high transmission rate ability to transfer real time data supporting internet protocol IP and having the ability to access the internet 7 2 5 Online Database MySOL A database is mainly separated into two main components First is the server side tool that includes database system such as MySOL or Oracle which is the core software engine that runs functions like creating optimizing and managing databases executing queries and maintains database security Second is the client side tool that is the database client like PHP script or a program written in C language which function to manage the import and export of utilities from databases 11 12 MySQL AB a company which is based in Sweden has created and supported MySQL database since year 1979 where SQL is the Structured Query Language MySQL is developed based on three fundamental principles which are ease of use reliability and performance 12 MySQL had been developed as a relational database management system RDBMS based on the principles A RDBMS allows the combination of data from multiple Tables and enhancing the vision by storing the data more efficiently and removing the repetition thus reduce the overall time took to execute the queries and return results to the caller 11 In addition MySQL is reliable as it is virtually bug free This is due to the server is havi
59. ure Compare PWM modules Cap ureis 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 SSP with SPI Master mode and IC Master Stave Universal Synchronous Asynchronous Recelver Transmitter USART SCI with 9 address detection Paralia Save Port PSP 8 bits wide with extema RD WR and TS controis 40 44 pin ony Erown out detection circuttry for Erown out Reset BEOR Analog Features 10 bi up to E channel Angog to Digtal Converter A D Broar out Reset BOR Analog Comparator module with Two analog comparators Programmable on chip vottage reference Wher module Programmable input muttipiexing from device Inputs and intemal voltage reference Comparator outputs are extemally accessible Special Microcontroller Features 100 000 eraselwrite Enhanced Flash program memory typical 1 000 000 erase artte cycle Data EEPROM memory typical Data EEPROM Retention gt 40 years Selt reprogrammabie under software control In Circut Serial Programming ICSP via two pins Single supply SV In Circult Seria Programming Watchdog Timer WOT with ts own on chip RC oscillator for relable oparaton Programmable code protection Power saving Sleep mode Selectable oscilator options Ir Circut Debug ICD via two pins CMOS Technology Low power high speed Frash EEPROM technology Fully static d
60. wn as a Sena Communications interface or SCI The USART can be can communicate with peripheral devices such as A D or OVA Integrated crouts seria EEPROMs etc 51 PIC16F87XA The USART can be configured In the fofowing modes Asynchronous ful dupiex Synchronous Master haif dupiex Synchronous Slave half duplex Bit SPEN RCSTA lt 7 gt and bits TRISC T 6 have 10 be setin order to configure pins RCE TX CK and RCT FOUDT as the Universal Synchronous Asynotironous Reoelver Transmiter The USART modue aso has a multi processor communkation capability using 9 0 address detection REGISTER 10 1 TXSTA TRANSMIT STATUS AND CONTROL REGISTER ADDRESS 38h RVW 0 RW 0 RAN D RNO U0 RWD 8 1 RVD ceno ns pes sync eRGH mowr neo bit 7 bito CSRC Clock Source Select bit Dont Synchronous mode Master mode clock generated internally tom BRG a Slave mode clock from external source TX9 5 ptt Transmit Enabie ot 1 Selects Suit transmission Selects 8 01 transmission TXEN Transmit Enable bit 1 Transmit enabled c Transmit disabled Note SREN CREN overrides TXEN in Sync mode SYNC USART Mode Select bit 1 Synchronous mode c Asynchronous mode Unimpismented Read as c BRGH High Baud Rate Select bit 1 High speed 0 Low speed Synchronous mode Unused In this mode TRMT Transmit Snif Register Status bit 1 TSR empty TSR ful TX3D Sth Dit of T
61. ynchronous and synchronous modes of USART In synchronous mode the bit BRGH is ignored which is different with the asynchronous mode With the desired baud rate and oscillation frequency the SPBRG register value can be calculated using the formula shown in Table 3 2 Table 3 2 Baud Rate Formula SYNC BRGH 0 Low Speed BRGH 1 High Speed 0 Asynchronous Baud rate Baud Rate Fosc 16 X 1 Fosc 64 X 1 1 Synchronous Baud rate Fosc 4 X 1 N A X value in SPBRG 0 255 By setting the bit BRGH to 1 the high speed formula Fosc 16 X 1 will be used and this equation able to reduce the baud rate error For this project USART peripheral function is used to receive and transmit the data Asynchronous mode is chosen Several steps are done to set up the asynchronous transmission as following a Bit SYNC is set to low to select the asynchronous USART mode b Bit SPEN is set to high so that the serial port is enabled for the data exchange then both bit TX9 and bit RX9 are set to low to select the 8 bit transmission and 8 bit reception c Then bit BRGH is set to high so that the high speed equation will be used to reduce the baud rate error With the desire baud rate set at 115200 baud and oscillation frequency of 20Mhz thus SPBRG will be set at 10 24 3 3 2 SK40C Development Board Figure 3 8 SK40C Development Board SK40C development board is designed for users to develop PIC

Download Pdf Manuals

image

Related Search

Related Contents

ASUS TP500LA User's Manual  Case Logic PLS-212  Télécharger la documentation d`installation  巻頭カラーページ    Getting Started With 2.1 Installing TeleEye Reception Software WX-30  Insignia NS-L22X-10A User's Manual  Akai Clockradio/ CD-player ARC200  Descargar AQUÍ - Assa Abloy - Yale  Мультиварка с функцией скороварки MW-3803 BK  

Copyright © All rights reserved.
Failed to retrieve file