Monday, 5 March 2012

5. Implementation

In the implementation part, it is required to follow the proper steps as the first step we need to create a database in SQL server with appropriate tables. There are two tables which are associated with SMS gateway in database. Those are ozekimessageout and ozekimessagein. These tables need to create as it is in the user manual of ozeki SMS gateway setup. Otherwise SMS part will not work properly. Then install the Ozeki SMS gateway software, this software may require .Net framework 3.5. This framework also comes up with the online download from Ozeki web site so we no need to worry about it, when you are going to install Ozeki server it will check the framework 3.5 and if it is not installed in the computer setup will exit and asked to install it first. Thereafter Ozeki server is needed to configure the GSM modem and Database user. In this system Etisalat dongle is using as GSM modem. The dongle should be connected to the computer when you are going to setup this. Then login to the Ozeki SMS gateway by using default user name and password. The default user name is “admin”. The default password is “abc123”. Below picture shows the main web screen of Ozeki server.


Then install the GSM modem, to install it go to service provider connection and click on add service provider. Then GSM installation wizard comes. Then click on (GSM/GPRS Modem Connection Install) link, then you will get the below web interface to setup some configurations of installed GSM modem.

Then select your connected dongle from port dropdown menu and insert the dongle number to telephone number text box and click on the auto detect button. It may take couple of minutes to get connected with the dongle and if it connected, it is indicate in interface as well. Thereafter Database user will be installed as follows. Then go to user and application and click on add user. Then click on (Database user interface install), then it is required to give a name and click on OK button. Then connect the database and configure the tables for incoming and outgoing text messages. Below picture shows the configuration of database user in Ozeki server.




According to the analysis there are two class diagram designed for database and port communications. So layering architecture is used in this application. Below picture shows the interface layer of the system.  


The implementation of this interface layer is going to Value Object layer. In that layer there are two main methods for creating its object. Below picture shows how value object layer is appearing in the system.


Then business layer is used for implement all methods and business logics after that business layer is referring the communication layer accordingly. From database communication layer it access the stored procedures to communicate with database below picture shows the database tables and stored procedures which are using for the system.





Electronic circuit was developed using the help of datasheets. After that it was tested time to time for voltage levels and finally placed all electronic components in one Vero board and it configured to a plastic box because it is easy for carrying without damaging the circuit. Below picture shows the circuit board in the box. 



There are two tables which have been populated with pre defined SMS formats and binary patterns. Those tables and SMS formats are follows. Below Table 01 shows the received SMS code with binary pattern and Table 02 shows the send SMS codes with binary pattern.


SMS Code
Binary Code
Description
LF ON
00000001
Light Front ON
LF OFF
11111110
Light Front OFF
LL ON
00000010
Light Left ON
LL OFF
11111101
Light Left OFF
LB ON
00000100
Light Back ON
LB OFF
11111011
Light Back OFF
LR ON
00001000
Light Right ON
LR OFF
11110111
Light Right OFF
SI ON
00010000
Siren ON
SI OFF
11101111
Siren OFF




Binary Code
Description
01111111
Port Slandered Value.
01101111
Zone One Sensor Fired.
01011111
Visitor at the Gate. Please call +94716547641 for contact him.
01001111
Got Interrupt From Gate and Sensor.
01110111
Zone Two Sensor Fired.
00111111
Internal Sensor Fired.
00000111
Got Interrupt From Gate and All Sensors.
01100111
Got Interrupt From Zone One Sensor and Zone Two Sensor. 
00101111
Got Interrupt From  Zone One Sensor  and Internal Sensor
01010111
Got Interrupt From Gate  and Zone Two Sensor
00011111
Got Interrupt From Gate  and Internal Sensor
00110111
Got Interrupt From Zone Two Sensor and Internal Sensor


When receives SMS as LF ON to the database, this SMS will read by program and update the status of SMS New to the Old. Then execute the SQL query on SMS Receive Code table to grab the related binary code to the Home Management software and it will process for the output binary code and then generated binary code will sent to the port. Below example is for more understanding the algorithm. 

Step 01: -

- Home management software is always checking the port and database for new input

Step 02:-

- Suppose that Home Current Status Binary code is 00000100 and received SMS is “LF ON, LL ON, LB OFF,SI ON”

- Read Home Current Status Binary code and Related Binary Code for inserted SMS

- So Binary Codes will be 00000001,00000010,11111011,00010000

Step 03:-

- Categorized binary codes which are related to ON separately and Binary codes OFF separately

- Do OR operation for binary codes which are related to ON and set ONboolean value true (After operation 00010011)

- DO AND operation for binary codes which are related to OFF and set OFFboolean value true (After operation 11111011)

Step 03:-

- If ONboolean is True AND OFFboolean is True

o DO OR operation for OR operation output(00010011) with Home current status (00000100) (After operation 00010111)

o Then AND operation for above output(00010111) with AND operation output(11111011) (After operation 00010011)

- Else If ONboolean is True AND OFFboolean is False

o DO OR operation for OR operation output(00010011) with Home current status (00000100) (After operation 00010111)

- Else If OFFboolean is True AND ONboolean is False

o DO AND operation for AND operation output(11111011) with Home current status (00000100) (After operation 00000000)

Step 04:-

- Send final binary value to port.


Then according to the input current level will change in the data port of parallel port and that change will feel to the circuit board. Then the electronic device will start the functioning. Once visitor presses the bell, that input converted to text message and send it to particular phone belongs to the house owner or it will send active mobile numbers in database. Then they can initiate a telephone call to another number which is connected to gate for transferring voice traffic via Bluetooth then phone call automatically answered and house the owner can communicate with the visitor. Developed software indicates the current status of home in graphical user interface. But it is not needed much because, SMS facility is providing to remote locations. Below picture shows the interface.


No comments:

Post a Comment