12

stekom.ac.idstekom.ac.id/site/download/dokumen/2910a794eb4aa32f8203948a8cd6... · The relay module is a separate hardware device used for remote device switching (Beagle, 2012). 2.5

  • Upload
    vanhanh

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

The Switch of Web Base Lamp with C++ and Ajax Method

Mufadhola*, Wibowo Harry Sugihartob

a,b Fakultas Teknologi Informasi dan Komunikasi, Universitas Semarang, [email protected]@gmail.com

Abstract

Monitoring lamp switch from a far location by user, using the internet can use a websiteinterface. Website built with the PHP programming language with ajax method and accessed from aserver that is connected with electronic switches using parallel port DB25 connector that is controlledby win32 console application made from C++ programming language. The system is divided into threeparts, electronic switch, controller of elektronic switch parallel port DB25, and website as interface forthe user. Lamp that can be controlled by this system indicates web base lamp switch can help user formonitoring and controlling lamp from far location.

Keywords : Lamp Switch, PHP with ajax, C++, Win32 Console Application, Parallel Port DB25

1. IntroductionOnline based technology are being

demanded nowaday because it not bind by anoperating system nor any specific platform.Website that usually just used for the interfacefrom a web page, can be used for monitoringand controlling switch lamp from faraway.

With the interface from a web page in aserver, with the lamp connected to parallel portDB25 on the server.User can controll theparallel port DB25 through website, so the lampcan be controlled.2. Background Technologies2.1. Web Base Application

Application is software or programs thathas a command processing activities necessaryto implement user requests for specificpurposes (Supriyanto, 2005).

In this case accessing applications througha web browser. It can be concluded that web-based application is a software which is used toperform certain tasks and accessed with a webbrowser.2.2. Switch

Switch is a control unit that turns the flowof electricity on or of in a circuit (Diffen, 2012).2.3. Parallel Port

Parallel port is a port on a personalcomputer that serves as a means ofcommunication between the computer(motherboard) with external devices that areparallel. Parallel ports are also commonlyknown as the Printer port, Centronics port, andDB25 (Lischer, 2009).

2.4. Relay ModuleThe relay module is a separate hardwaredevice used for remote device switching(Beagle, 2012).2.5. C++C++ is a middle level language which is thedevelopment of the C language, whichlanguage includes object oriented programminglanguage (Wirman, 2007).2.3. Ajax MethodAjax is a method in make the web applicationsbecomes more interactive. Ajax allows a datarequest to the server application by the backdoor without having to change a web page toanother web page (Josescalia, 2011).3. Method

Making web based lamp switch has arequirement of hardware and software, alsohave several stages that must be passed.3.1. Hardware Requirements

3.1.1. Personal Computera. Server

Hardware that being used on theserver for build this web based lampswitch:1. Intel Atom Dual-Core D525 Processor2. Motherboard that has Connector

Parallel Port DB25 Female3. VGA Intel GMA 31504. RAM 1GB DDR25. Harddisk 40GB6. Monitor

7. Keyboard8. Mouse9. Lan Card Gigabit Network Card

(connected to client network).b. Client

Hardware client for accesing theserver:1. Intel Dual-Core T4300 Processor2. VGA Intel GMA 4500m3. RAM 2GB DDR24. Harddisk 250GB5. Keyboard6. Monitor7. Mouse8. Lan Card Realtek PCIe FE Family

Controller (connected to servernetwork).

3.1.2. Electronic SwitchElectronic switch that used for

build this web based lamp switch:1. Parallel Port DB25 Male

Connector2. 2 pcs 4 Channel Relay Module3. Simulation house with 8 lamps 5

watt AC 220V4. Cable

3.2. Software Requirementsa. Server

Software that being used by the webbased lamp switch personal computerserver:1. Operating System Windows XP SP3

Professional X862. Notepad++3. Appserv4. Userport 1.05. Microsoft Visual C++ 6

b. ClientSoftware that used by web based

lamp switch personal computer client:1. Operating System (Linux, Windows,

OSX, etc)2. Web Browser (Firefox, Opera,

Google Croome, Safari, InternetExplorer, etc).

3.3. Stages of Building Systems

Stage that had to been through for buildthis web based lamp switch.

1. DesignThe design stage divided to threestages:a. Electronic switch design

Electronic switch made from 2pcs 4 channel relay module withparallel port DB25 that beingconnected to simulation houseand personal computer server.

b. Electronic switch controllingsoftwareElectronic switch controller win32console application be made ofthe C++ programming language,which serves to control theparallel port DB25.

c. Controlling lamp WebsiteWebsite served as interface forthe client. And access theelectric controlling software thatcan display the lamp status andcontrolling it.

2. ImplementationCombined the simulation house withelectronic switch, and connecting theelectronic switch with the personalcomputer server using parallel portDB25. Electronic switch controllingsoftware used to accessed theparallel port DB25. Personalcomputer client used to acces webpage that combined with theelectronic switch controlling softwarein personal computer server. Soclient can controlling the lamp on thesimulation house.

4. Discussion and Conclusions4.1. System Overview

User with personal computer clientaccesed the website that combined withelectronic switch controlling software on thepersonal computer server for controlling parallelport DB25 that connected with electronic switchand the lamp in the simulation house thatshowed by picture 1.

Picture 1 System Illustration

.4.2. Designa. Hardware Electronic Switch

Electronic switch that being used to turnon / off the lamp made of 2 pcs 4 Channel

Relay Module that coupled with Parallel PortDB25 and 8 lamps 5 Watt AC 220V, thescheme for that series showed by picture 2.

Picture 2 Electronic Switch Scheme

b. Electronic Switch Controller SoftwareElectronic switch controller is made with

C++ programming language and generatewin32 console application to control DB25parallel port, so user can enter the commandwith parameters through command promptwindows.

Flowchart that illustrates the logic of thecontroller DB25 parallel port to be made are asfollows:

Picture 3 Parallel Port DB25 Control

c. Controlling Lamp WebsiteControlling lamp website made by php

language program, which combined withelectronic switch cotrolling software.

Flowchart that illustrates the logic ofwebsites to be created to control the lamp is asfollows:

Picture 4 Controlling Lamp Website

4.3. Implementationa. Simulation House and Electronic Switch

Here are the results of the implementationof the electronic switch and the simulation:

Picture 5 Electronic Switch

Picture 6 Simulation House

b. Electronic Switch Controller SoftwareElectronic switch controller software such

as win32 console application created with C++programming language and runs with commandprompt windows.

1. Read CommandRead command function to read the valuefrom parallel port in the current time.

Picture 7 Read

2. Write CommandWrite command is the command forinserting value into parallel port, use thiscommand followed by the value to beinserted, for example want to put the value"255", then writing the command is "write255". Here is a display when running thecommand "write" :

Picture 8 Write

3. How To UseIf we inserted another command except“write” and “read”, it will show you how touse this application. Here is the displayshowing how to use:

Picture 9 How To Use

c. Controlling Lamp WebsiteControlling lamp website is made from

PHP programming language and MYSQLDatabase. This website serves to insert a valueinto a DB25 parallel port via an electronicswitch controller software. The execution ofPHP syntax with the command "exec". Here isan example of executing of electronic switchcontroller software using PHP.

<?exec(“x.exe read”, $exec1);$current_value = $exec[0];echo $current_value;?>

Website pages consist of 2 part.

1. Control Lamp Page

Picture 10 Lamp ControlExplanation :

1. Configuration Page2. Logout User3. Lamp Switch

4. Lamp Status5. Information6. Reset All Lamp Into ON/OFF

2. Configuration Page

Picture 11 Configuration PageExplanation :

1. Lamp Control Page2. Logout User3. User Management

4. Add New User5. Change Information Of Lamp

5. ConclusionsBased on the design and implementation,

it can draw the conclusion that the lamp switchweb based system can perform monitoring andcontrolling the lamps with a remote interface ofthe website, so that the user can do with theinternet or intranet media to save time ratherthan do it manually.

References

Ahmed et all, 2011, Controlling and securing aDigital Home using Multiple SensorBased Perception system Integrated withMobile and Voice technology,International Journal of Information andCommunication Technology Research,Volume 1 No. 5.

Antunes and Grilo, 2009, Intruder AlarmSystems – The Road Ahead, Intec,Portugal.

Beagle, 2012, Relay Module, Beagle Software,URL:http://www.beaglesoft.com/clwaentrelay.htm, downloaded on 5 Oktober2012.

Diffen, 2012, Hub Vs Switch Diffen , Diffen,URL: http://www.diffen.com/difference/Hub_vs_Switch , downloaded on 10Oktober 2012.

Hwang and Yu, 2012, Remote Monitoring andControlling System Based on ZigBeeNetworks, International Journal ofSoftware Engineering and ItsApplications, Vol. 6, No. 3.

Josescalia, 2011, Ajax, Permasalahan CrossDomain dan Solusinya, Josescalia, URL:http://blog.josescalia.net/2011/02/ajax-permasalah-cross-domain-dan.html,downloaded on 29 September 2012.

Lischer ,2009, fungsi dari serial port danparallel port, Lischer, URL:http://lischer.wordpress.com/2009/12/18/fungsi-dari-serial-port-dan-parallel-port/,downloaded on 29 September 2012.

Logix4u , 2012, Parallel Port, Logix4u.net, URL:http://logix4u.net/paral lel-port ,downloaded on 5 Oktober 2012.

Nawazir, 2012, Pengertian Lampu , Shvoong,URL: http://id.shvoong.com/exact-sciences/physics/2285162-pengertian-ampu/,downloaded on 29 September 2012.

Nios, 2012, Electric Circuit NIOS , Nios, URL:http://oer.nios.ac.in/wiki/index.php/Electrc_Circuit, downloaded on 10 Oktober2012.

Nugroho, Bunafit, 2004, Database Relasionaldengan MySQL, Andi, Yogyakarta.

Othman et all, 2012, Intelligence Photo-Detector Light Switching System (IPD-LSS), International Journal of ComputerTechnology and Electronics Engineering(IJCTEE), Volume 2, Issue 4.

Pressman, Roger, 2002, Rekayasa PerangkatLunak Pendekatan Praktisi, Andi,Yogyakarta.

Supriyanto, Aji, 2005, Pengantar TeknologiInformasi, Salemba Infotek, Jakarta.

Wirman, 2007, Pemrograman Dengan C++(Part I), Ilmu Komputer, URL:http://ilmukomputer.org/wp-content/uploads/2009/03/ wirman-c-14.doc,downloaded on 29 September 2012.