IV.
IMPLEMENTATIONFirst of all, we had to add the script file or in our casethe python code to the bootup files, in order for it to work assoon as the system is powered on and without any interferencefrom the user himself. When the system is on it connects tothe nearest access point in the area as instructed, which inturn we specified it for the system, then begins the work. Theultrasonic is initialized along with the GPS module, then theGPS starts to bind with and download the data needed forthe acquisition of the location. Also in that stage we initializesome variables for to be used in the SMTP code for sendingan email.Fig.
7: Initialization and Definition Stage.After the initialization process is the main program. First theultrasonic starts to send a wave and the timer begins countingfor the time elapsed till we receive it back as mentioned before,then through calculations we get the distance displayed in centimeters.
Also it adapts the buzzer sound and the vibrationintensity to the distance accordingly it manipulates the PWMof the pins connected to them both.Fig. 8: Ultrasonic Stage.
Then after the GPS gets connected to one of the satellites,it takes about 5 minutes at maximum to connect, we providethat the slow connection is due to the internal antenna of themodule. After connection it retains the data (longitude andlatitude) through parsing the NMEA pattern, we then connectto the SMTP server to connect through the mail and send amessage containing the locationn order to run the device we have to do the followingsteps:- First run the device through plugging power- The program script is set to run in the boot of the OS ofthe device- If we want to monitor the distance of Ultrasonic sensoror the coordinates of the GPS, we can login through thePutty or VNC using the following IP address, user and passrespectively “192.168.
1.50″, “pi” ,”raspberry”.- It is supposed that we can monitor the system through thebuzzer and GPS coordinates mail, and it runs automatically.By testing the GPS connection we got that the delay ofconnecting to a satellite is approximately 2.7 minutes, thatsalso conditioned to providing a clear area and a wide view ofskies. As tested though if there is no clear view of skies, orin closed building, the connection may not happen at all. Thishappens because of the internal antenna, if it was external wasto be more efficient.
The table below shows the statistics, thecalculations of each were on 10 repetitions of the scenario,the timing was calculated by a stop watch.TABLE I: Avg. Time GPS Connects To SatelliteScenario Avg. of Time