You are on page 1of 10
Delay 30 seconds 3 Extablish network connection() f While (GPRS ic not connected and not ready) f Read incoming response sorings from eallulay nencork (Check for eucceszful connection } 3 Recvieve data to condi) t Ger veater level data Gerpower level dasa Gespower on aff data Gerpump zara: daca Create sring af all data to send 10 server } Send data to cell neneork and sarver(data) ¢ Send ATCommand to configure TCP connsetion 10 zerver Stare TCP connection with server Delay some amour of time Send data to server (laze connection } The data packet is sent to a given IP address. In this case it would be the address of the TCP server. The TCP server contains 2 script file as stated above that collects the data and stores the information in a selected database. Th following isthe pseudo code for that process: Open nscersary ports on server Mailed) € Lizcen for incoming conection: Grab dasa from GPRS packet Parze data Extablizh connection to databaz Send parzed data o databace The SQL database will store all the information that is gathered by the Arduino Mega 2560 and sent over the network to the server. The data will be stored i a tabla, and as naw data ie collected, it will simply be added to the existing table. Thorefore, older data will be able to be locked up if naaded. Once the dats is stored in the database, the mobil application will be able to pul the data needed and display ito the user ina user ftiendly environment 34. Mobile Application Software: By Jason) Figues 34.1 tough 5.43 give details on how dat will be recsived fom the server and interpreted by the mobile application. The mobile aplication willbe used to provide the user ‘vith entcal deus of thei system froma wherever they are ate Aucio Alert Mobile Application User Input el — Visuals Fig 3.4.1: Mobile Application Block Diagram (Level 0) Figure 34.1 shows the inputs and outputs ofthe mobile application The phone will receive data ‘packets ffom a server coutaining critical ystems information. The phone's touch interface will be utilized to allow the user to interact with the application. The application will provide the user ‘with visual readouts ofthe system information, as well as provide them with alerts when there is a potential system failure ‘Mote Appleton oor ee ee (conan |, =| |e ~ veer wont seen Auto Alrteaceaget Fig 3.4.2: Mobile Application Block Diagram (Level 1) Figure 5.42 provides more information on how data will be processed in order to provide the ‘user with the needad information. Data will be raceivad as a TCP.TP packat and will b separated into individual data packets by a parser. The parser will provide the corract data to each clas in the code in order for the correct calculations to be made. Once the caleulatious are made and chacked against pre-defined tolerances, the data will be displayed to the user in an easy to read ‘fashion, and the necessary alerts will be made. The phone's touch interface will be used to allow the user to easily switch between pages of information and to aclmowledge alerts, Figure 3.4.3: Communications hetween Android device and SQL server One of the most important aspects ofthe mobile application will be to retrieve the information, uploaded to the SQL server ftom the microcontroller. The information from the server willbe ‘used to display data values and alerts the user. Figure 3.4.3 above shows how the mobile device ‘vill communicate with the SQL server. The way the application will treve the data is through ‘the use ofa PHP script The application will sand an HitpPost using Android's HTTP protocol to PHP script that is hosted on the web server. The PHP script will perform a query om the SQL. server and retrieve the necessary information to send back tothe device. Once the PHP script has performed its query and obtained the data, it will orzanize the information into JavaScript Object ‘Notation (SON) format and send itto the device. JSON format is a vary simple notation that ‘willbe easy forthe application to parse through. The following is am outline of the code that will ‘be used to retrieve information froma the saver. Android Code wt Create a new HapClisnt Create a new HapPost 0 the location of he PHP ceript ‘Set entity store the returned data to Exeeute the HepPost and store the responce Ger che values from the entity PHP Script Code t}os__| caw Newhaven Display 20 LCD 2 [eri | Nazar Rechargesbie 2 Sater from Energizer 2 [Re__| EVU-FLNFLSET@ | Fanssone' ea Potertometer 2 ‘000032 Arguing Bread SeardWre Kt z TuorEs Unies Solutions 20.Galon Plast Tub z PVC OTS 600 TU PVG Pige 19 Sections 2 VC 00321 0800 1-3 PVG 48 Degree Fiting [ara —_[24EP9 Basement Watchdog Gh Emergency Bat afo [inate D.100V, 184,003 + [85 | pacio0098000=81000 | £0 Onm resistor 2] Ri RD | ERD-S7TIO 2Ohm eestor 2] RaR6 | 110058863 10K of resistor 1 [Re | ERG-18/302 3konm reser Tes | ToL-0ee2 T2OV-12Vae Power Supply 2 PRT-06518 GV to Barrel Jack Adscter ‘ATET Activated SIM Card S2Sino + Seine Data Pre-Paid 1 Pian ‘Table 41.1: Parts List ‘Teble 4.12 shows the revised material cost for producing the Flood Aler! Sump Pump Monitoring System. Much ofthe cos is associate with buying the sump pump system and bateris tht will simulate s curret day backup samp pump system. The communication aupect is also expansive withthe need of aa scsivated SIM card and collar data plan,

You might also like