ZERONE 2010 - Annual Technical Journal, IOE, Nepal

75

description

ZERONE 2010 is the sixth annual technical journal published by the students in the Department of Electronics and Computer Engineering, Institute of Engineering, Pulchowk, Nepal.

Transcript of ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Page 1: ZERONE 2010 - Annual Technical Journal, IOE, Nepal
Page 2: ZERONE 2010 - Annual Technical Journal, IOE, Nepal
Page 3: ZERONE 2010 - Annual Technical Journal, IOE, Nepal
Page 4: ZERONE 2010 - Annual Technical Journal, IOE, Nepal
Page 5: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Message from the Head of Department

It gives me great pleasure that the students of Bachelor’s degree of Electronics and ComputerEngineering are bringing out yet again another issue of “ZERONE”, an annual technological journal.ZERONE contains academic, engineering articles and latest developments in field of digitalengineering. I am very much impressed with the quality of articles.

I would like to thank the contributors and members of ZERONE committee for compiling and editingsuch wonderful array of articles. The effect of ZERONE may be small, but small differences do bringlarge changes. I am assured that readers will get inspired from the articles and contribute further tothe field of “Information Technology”, which Nepal desperately needs to excel in.

Lastly, I would like to congratulate the ZERONE editorial board for their active and sincere effort forthis technological journal. This type of academic enhancing work is what Institute of Engineeringthrives for and will always be appreciated and encouraged by our Department of Electronics andComputer Engineering. I hope readers will enjoy the articles and find them useful.

_____________

__________

Shashidhar Ram Joshi, Ph.D.Professor and Head of Department

Page 6: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Message from the President

I am really glad to know about the continuity of ZERONE, an annualtechnical journal, published by the students of the Department ofElectronics and Computer Engineering, Pulchowk Campus.

New technologies play a key role in the development of the country.As the field of science and technology is ever changing, it isindispensable for the students to keep themselves updated withfast changing technologies. A technical journal of this kind providesstudents with informative news about the new faces of the changingworld and creates enthusiasm among students in their related fields.

Lastly, my hearty congratulations to the ZERONE team for theirexcellent work in bringing out this issue.

_____________________

Prakash Sapkota

President, FSU

Page 7: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONEAn annual technical journal published by the students ofDepartment of Electronics and Computer Engineering,

Pulchowk CampusInstitute of Engineering

Volume 6•2067/2010

http://www.ioe.edu.np/zerone

AdvisorsDr. Shashidhar Ram Joshi

Dr. Subarna Shakya

ChiefShristi Nhuchhe Pradhan

Co-ordinatorNar Kaji Gurung

EditorsBikram Adhikari

Presha JoshiRuchin Singh

Vandana Dhakal

Layout & DesignSaurab RajkarnikarNar Kaji Gurung

Kailash Budhathoki

Printed atRajmati Press

Nakabahil, LalitpurG.P.O. Box: 2512

Tel: 5534527

few words...The ZERONE team is delighted to bring out thesixth issue of the journal on the hands of its keenreaders. Even though the leadership has beenhanded down from one batch to another, we havepersistently tried to maintain the quality and thestandards of the issues.

This issue brings forward an array of informationrich articles. There are articles based on nascenttechnologies like the Chemical Computing and 4GMobile Technology. Contemporary technologies,as for example, the Cloud Computing, Photovol-taic, Migration to IPV6 have been included. Thereis an interesting article based on building a hu-manoid robot with LEGO Mindstorms. Likewise,we have focused on articles giving useful insightto exciting projects which was undertaken suc-cessfully by the students.

These kind of technical journals definitely helpand encourage the students to undertake the on-going researches and innovate new ideas. Theteam would like to thank all the organizations forproviding us with the financial support neededto publish a freely distributed journal of this scale.We would like to extend our gratitude towards ourcolleagues and our teachers who have supportedZerone through articles and valuable suggestions.Without you all, Zerone wouldn’t exist at all.

Finally, we would like to wish a very best for thenew team. Keep the spirit alive!

Page 8: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Table of ContentsTable of ContentsTable of ContentsTable of ContentsTable of ContentsCutting Edge TechnologiesChemical Computing: A New Era in Technology ....................................................................... 1

Prabhat Dahal, 2062 Electronics

4G Mobile Technology ................................................................................................................. 4

Sudha Lohani, 2063 Electronics

Be Ready! HTML 5 is coming ...................................................................................................... 6

Ganesh Tiwari, 2063 Computer

Quantum Teleportation: The Promises It Holds ..................................................................... 11

Barsha Paudel, 2063 Electronics

Contemporary TechnologiesCloud Computing ...................................................................................................................... 14

Nar Kaji Gurung, 2063 Computer

VPN - Solution to Remotely Connected Intranet ..................................................................... 20

Ranjan Shrestha, 2062 Electronics

Connecting to Matlab ................................................................................................................ 23

Sugan Shakya, 2062 Electronics

Photovoltaic ................................................................................................................................ 25

Dipendra Kumar Deo, 2062 Electronics

Electromagnetic Interference ................................................................................................... 28

Rupendra Maharjan, 2062 Electronics

Migration to IPV6 ....................................................................................................................... 30

Mithlesh Chaudhary, 2062 Electronics

Magnetic Stripe Cards .............................................................................................................. 33

Pushkar Shakya, 2063 Computer

RoboticsMy First Humanoid Robot:

An Experience worth Sharing with Freshman and Sophomore ........................................... 36

Bikram Adhikari, DOECE, Pulchowk Campus

Project IdeasSpectrum Analysis and its Benefits ........................................................................................ 41

Prajay Singh Silwal, 2062 Electronics

SIMULINK Model of an Inverted Pendulum System

Using a RBF Neural Network Controller ............................................................................... 44

Bikram Adhikari, DOECE, Pulchowk Campus

IRIS Regognition and Identification System........................................................................... 50

Ruchin Singh / Sanjana Bajracharya / Saurab Rajkarnikar, 2062 Computer

Page 9: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

RFID ........................................................................................................................................... 53Ashish Shrestha, 2062 Electronics

Symphony and MVC Architecture ........................................................................................... 56Suraj Maharjan / Ram Kasula / Prasanna Man Bajracharya, 2062 Computer

Computer Operation & Programming

How to create a Symbian Installation Source using Visual C++ 6.0 .................................. 61Kishoj Bajracharya, 2062 Computer

Implementing Virtual Hosting .................................................................................................. 64Ganesh Tiwari / Biraj Upadhyaya, 2063 Computer

Page 10: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

CHEMICAL COMPUTINGCHEMICAL COMPUTINGCHEMICAL COMPUTINGCHEMICAL COMPUTINGCHEMICAL COMPUTING A New Era in Technology

Cutting-Edge TechnologiesCutting-Edge TechnologiesCutting-Edge TechnologiesCutting-Edge TechnologiesCutting-Edge Technologies

All known life forms process informationon a bio-molecular level. Examples are:signal processing in bacteria (e.g.,

chemotaxis), gene expression and morphogenesis,defense coordination and adaptation in theimmune system, broadcasting information by theendocrine system, or finding a short route to afood source by an ant colony. This kind ofinformation processing is known to be robust,self-organizing, adaptive, decentralized,asynchronous, fault-tolerant, and evolvable.Computation emerges out of an orchestratedinterplay of many decentralized relatively simplecomponents (molecules).We now expect to makeavailable a technology that allows to createcomputational systems with the properties of theirbiological counterpart. A couple of approachesare already using the chemical metaphor (e.g.,Gamma, MGS, amorphous computing, andreaction-diffusion processors).

A chemical computer, also called reaction-diffusion computer, BZ (Belousov-Zhabotinsky)computer or gooware computer is anunconventional computer based on a semi-solidchemical "soup" where data is represented byvarying concentrations of chemicals. Thecomputations are performed by naturallyoccurring chemical reactions. So far it is still in avery early experimental stage, but may have greatpotential for the computer industry.

The simplicity of this technology is one of themain reasons why it in the future could turn intoa serious competitor to machines based onconventional hardware. A modernmicroprocessor is an incredibly complicateddevice that can be destroyed during productionby no more than a single airborne microscopicparticle. In contrast, a cup of chemicals is a simpleand stable component that is cheap to produce.

In a conventional microprocessor, the bits behavemuch like cars in city traffic; they can only use

certain roads, they have to slow down and waitfor each other in crossing traffic, and only onedriving field at once can be used. In a BZ solution,the waves are moving in all thinkable directionsin all dimensions, across, away and against eachother. These properties might make a chemicalcomputer able to handle billions of times moredata than a traditional computer. An analogywould be the brain; even if a microprocessor cantransfer information much faster than a neuron,the brain is still much more effective for sometasks because it can work with much higheramount of data at the same time.

Historical backgroundOriginally chemical reactions were seen as asimple move towards a stable equilibrium whichwas not very promising for computation. Thiswas changed by a discovery made by BorisBelousov, a Soviet scientist, in the 1950s.

He created a chemical reaction between differentsalts and acids that swing back and forth betweenbeing yellow and clear because the concentrationof the different components changes up and downin a cyclic way. He noted that in a mix ofpotassium bromate, cerium(IV) sulfate,propanedioic acid and citric acid in dilute sulfuricacid, the ratio of concentration of the cerium(IV)and cerium(III) ions oscillated, causing the colourof the solution to oscillate between a yellowsolution and a colorless solution. This is due tothe cerium(IV) ions being reduced by propanedioicacid to cerium(III) ions, which are then oxidizedback to cerium(IV) ions by bromate(V) ions. Atthe time this was considered impossible becauseit seemed to go against the second law ofthermodynamics, which states that in a closedsystem the entropy will only increase over time,causing the components in the mixture todistribute themselves till equilibrium is gainedand making any changes in the concentration

062 ElectronicsPrabhat Dahal

Page 11: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 7

Cutting-Edge Technologies

the man who sold the worldimpossible. But modern theoretical analysesshows sufficiently complicated reactions canindeed comprise wave phenomena withoutbreaking the laws of nature. (A convincing directlyvisible demonstration was achieved by AnatolZhabotinsky with the Belousov-Zhabotinskyreaction showing spiraling colored waves.)

Basic principlesThe wave properties of the BZ reaction means itcan move information in the same way as all otherwaves. This still leaves the need for computationperformed by conventional microchips using thebinary code transmitting and changing ones andzeros through acomplicated system oflogic gates. To perform anyconceivable computation,it is sufficient to haveNAND gates. (A NANDgate has two bits input. Itsoutput is 0 if both bits are1, otherwise it's 1). In thechemical computerversion, logic gates areimplemented byconcentration wavesblocking or amplifyingeach other in differentways.

Current researchChemical computers can exploit several differentkinds of reaction to carry out the computation.For example, so-called conformation computersuse polymer molecules that change shape inresponse to a particular input.

Metabolic computing exploits the kinds ofreactions typically found inside a living cell. In1989, how the light-sensitive chemical reactionscould perform image processing wasdemonstrated. This led to an upsurge in the fieldof chemical computing.

Andrew Adamatzky at the University of the Westof England demonstrated simple logic gates usingreaction-diffusion processes. Furthermore he hadtheoretically shown how a hypothetical "2+medium" modeled as a cellular automaton canperform computation. The breakthrough camewhen he read a theoretical article of two scientistswho illustrated how to make logic gates to a

computer by using the balls on a billiard table asan example. Like in the case with the AND-gate,two balls represent two different bits. If a singleball shoots towards a common colliding point,the bit is 1. If not, it is 0. A collision will onlyoccur if both balls are sent toward the point, whichthen is registered in the same way as when twoelectronic 1's gives a new and single 1. In thisway the balls work together like an AND-gate.Adamatzkys' great achievement was to transfer thisprinciple to the BZ-chemical reaction and replacethe billiard balls with waves. If it occurs, twowaves in the solution will meet and create a thirdwave which is registered as a 1. He has tested thetheory in practice and has already documented

that it works. For themoment, he iscooperating with someother scientists inproducing somethousand chemicalversions of logic gatesthat is going to becomea form of chemicalpocket calculator. Oneof the problems withthe present version ofthis technology is thespeed of the waves; theyonly spread at a rate ofa few millimeters per

minute. According to Adamatzky, this problemcan be eliminated by placing the gates very closeto each other, to make sure the signals aretransferred quickly. Another possibility could benew chemical reactions where waves propagatemuch faster. If these teething problems areovercome, a chemical computer will offer clearadvantages over an electronic computer.

Latest advancements

1. Reaction-diffusion computingThis type of computation exploits waves travellingthrough a beaker of chemicals to carry out usefulcalculations. These waves are the informationcarriers in the computer. They are created bytriggering chemical reactions in the soup at specificpoints.

As waves propagate from different areas theycollide and interact - effectively processing theinformation they hold. At the site of theirinteraction a point with a new chemical

Page 12: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

8 ZERONE 2010

Cutting-Edge Technologies

concentration is created, which is in effect ananswer. With a beaker full of thousands of wavestravelling and interacting with each other, complexcomputational problems can be solved.

An increasing number of individuals in thecomputer industry are starting to realise thepotential of this technology. IBM is at the momenttesting out new ideas in the field ofmicroprocessing with many similarities to thebasic principles of a chemical computer.

2. Robot gelAlthough the process sounds complicated andesoteric it can be applied to almost allcomputational problems. According to DrAdamatzky, Reaction-diffusion processors areuniversal computers and they can solve all typesof problems. As a result, computer giant IBM isalready interested in the technology. Althoughslower than silicon, its key advantage is that it ischeap to produce and incredibly robust.

Working with chemist Ben De Lacy Costello, DrAdamatzky has already produced logic gates usingthe technique that can be used to make chemical"circuitry".

Here is an excerpt from news in ChemicalComputing that made a sensation in BBCsometime back where Dr. Adamatzy says-"Ultimately, we will produce a general purposechemical chip. The chip would be capable ofmathematical operations such as adding andmultiplying numbers. I believe we can take theresearch even further to create intelligent,amorphous robots. In these, silicon circuitrywould be of no use. Assume we have fabricatedan artificial amoeba, gel-based robot, without anyfixed shape, and capable for splitting into severalsmaller robots. Cornventional silicon circuits willnot work because they have rigid architecture. Butas chemical computers are an amorphous blobthey could be cut in half and both would continuefunctioning independently. You can not cut yourlaptop in half and expect both parts to functionproperly; you can do this with reaction-diffusionprocessors."

3. Nano-chemical computationScientists have achieved the goal of creating anano-scale “chemical brain” that can transmitinstructions to multiple (at present as many as16) molecular “machines” simultaneously. Thenew molecular processor means that nano-

chemical computation may soon be possible,ushering in a new era in super-light, super-fast,more versatile computer processing capabilitiesand, by extension, robotics.

The BBC reports that:

The machine is made from 17 molecules of thechemical duroquinone. Each one is known as a“logic device”. They each resemble a ring withfour protruding spokes that can be independentlyrotated to represent four different states. Oneduroquinone molecule sits at the centre of a ringformed by the remaining 16. All are connected bychemical bonds, known as hydrogen bonds. Thestructure is just 2 nanometers in diameter, andcan produce 4 billion different permutations ofchemical transmission of “information”. Thisallows for a far more efficient distribution ofinformation than a traditional binary circuit.

The researchers say the structure of the “chemicalbrain” was inspired by the activity of glial cells inthe human brain. Glial cells are non-neuronal“glue” or connective cells. In the brain, they areestimated to outnumber neurons by 10 to 1 andassist in chemical transmission of neural signals.Their ability to transmit signals in parallel, or tomultiple tangent cells at once, reportedly gave riseto the 17-molecule duroquinone design.

In recent years, the inability of research teams andengineers to keep pace with “Moore’s law” —which predicts that computing speed (by way ofthe reduction in size of processing units or theincreasing density of circuits possible in a givenspace) will double roughly every 18 months—has been tested, due to heat-diffusion constraintsand the related energy bleed.

Nano-chemical processors would enable anentirely new structure for the smallest-scalecomputing circuits, and could lead to seriousadvances in the nature and capabilities ofmicroprocessors, which are far larger in size andcould therefore contain many times more circuitsthan at present.

The researchers have reportedly already movedbeyond the initial 17-molecule design, capable ofprocessing 16 instructions simultaneously, todevices capable of 256 simultaneoustransmissions. They are also designing a moleculardevice that would be capable of up to 1024simultaneous transmissions.

Page 13: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 9

Cutting-Edge Technologies

4G refers to the fourth generation of cellularwireless and is a successor to 3G and 2Gstandards. Though different regions have

diversified approaches towards the nextgeneration mobile communication technology(called 4th generation mobile, or 4G Mobile), thefuture trend is same: Convergence among fixed,mobile and wireless communications. A 4Gsystem is expected to upgrade existingcommunication networks and is expected toprovide a comprehensive and secure IP basedsolution where facilities such as voice, data andstreamed multimedia will be provided to userson an "Anytime, Anywhere" basis and at muchhigher data rates compared to previousgenerations.

Currently, the 3G mobile service is available inthe world. In the next stage, from around 2010,Japanese mobile operators will upgrade to "LongTerm Evolution (LTE)" services. LTE technologyis sometimes also termed 3.9G or Super-3G. 4Gtechnologies enable still higher data speeds, andare currently under development and testing. Itis currently not possible to predict when exactly4G services will be introduced to the markets,however it could be around 2015 or later.

Objectives• 4G is being developed to accommodate the QoS(Quality of Service) and rate requirements set byforthcoming applications like wireless broadbandaccess, Multimedia Messaging Service (MMS),video chat, mobile TV, High DefinitionTelevision(HDTV) content, Digital VideoBroadcasting (DVB).

• A spectrally efficient system (in bits/s/Hz andbits/s/Hz/site).

• High network capacity, more simultaneoususers per cell.

• Reduce blips in transmission when a devicemoves between areas covered by differentnetworks.

• A data rate of at least 100 Mbit/s between anytwo points in the world.

•Smooth handoff (handover) acrossheterogeneous networks. An instance of handoveris, when the phone is moving away from the areacovered by one cell and entering the area coveredby another cell, the call is transferred to the secondcell in order to avoid call termination when thephone gets outside the range of the first cell.

• Compatible operation with existing wirelessstandards.

Key 4G technologies• Modulation can also be employed as a multipleaccess technology (Orthogonal Frequency DivisionMultiple Access; OFDMA). In this case, eachOFDM symbol can transmit information to/fromseveral users using a different set of sub-carriers(sub-channels).

• MIMO: Multiple Input Multiple Output to attainultra high spectral efficiency.

MIMO uses signal multiplexing between multipletransmitting antennas (space

multiplex) and time or frequency.

• Adaptive Radio Interface: There will be tworadio processor modules, connected by digitalinterconnection system to conform to apredetermined radio communications channelpatching arrangement.

• Modulation, spatial processing including multi-antenna and multi-user MIMO.

• The cooperative relaying concept, whichexploits the inherent spatial diversity of the relaychannel by allowing mobile terminals to co-operate.

Sudha Lohani063 Electronics

4G Mobile 4G Mobile 4G Mobile 4G Mobile 4G Mobile TTTTTechnologyechnologyechnologyechnologyechnology

Page 14: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

10 ZERONE 2010

Cutting-Edge Technologies

• Access Schemes: Schemes like OrthogonalFDMA (OFDMA), Single Carrier FDMA (SC-FDMA), Interleaved FDMA and Multi-carrier codedivision multiple access (MC-CDMA) are gainingmore importance for the next generation systems.For the next generation UMTS (Universal MobileTelecommunication System), OFDMA is beingconsidered for the downlink. By contrast, IFDMAis being considered for the uplink.

• Multimedia service delivery, service adaptationand robust transmission: Audio and video codingare scalable. For instance, a video flow can besplit into three flows which can be transportedindependently. The first flowprovides availability,the other two quality and definition.

Advantages• In the 4G mobile era, the access to the mobileservices will be evolved to an open Mobile Cloudand will be fully open to any developers andproviders. Thus, any non-wireless industries,such as Google, Microsoft, Oracle can provideservices for their mobile users.

• The mobile device system architecture will beopen in order to converge multiple RTTs (radiotransmission technologies) in one same device.Like laptop computer, the future Smartphone will

be based on open wireless architecture (OWA)technology which means, when you change thewireless standards, you do not need to changephone. It is totally different from current multi-standards phone which is in closed systemarchitecture, and users can not remove the unusedRTT modules. In the OWA system, RTT card canbe changed to switch wireless standards, ormultiple wireless standards can be integrated inone RTT SIM card. Based on this OWA platform,you can integrate home phone, office phone andmobile phone into one common Personal device -it is more than just a phone. In fact, this 4G mobiledevice is a system to bring the world in the hand,can be called iHand - the World in Hand.

• Any portable consumer electronics device canbe a mobile phone by inserting the OWA-poweredmobile RTT(s) card. This approach is trulyconverging the mobile wireless technology withthe computer technology.

The first commercial launch of 3G was also byNTT DoCoMo in Japan on October 1, 2001 andslowly it spread over the world, while thetechnology arrived in Nepal in 2007, May 17th.The 4G is expected to be in market by 2015.But itseems we will have to wait for a while before wewill get to enjoy the service.

Page 15: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 11

Cutting-Edge Technologies

To give users more flexibility andinteroperability, and enable moreinteractive and exciting websites and

applications, HTML 5 introduces and enhancesa wide range of features including form controls,APIs, multimedia, structure, and semantics.HTML 5 is said to become a game-changer in Webapplication development, one that might evenmake obsolete such plug-in-based rich Internetapplication (RIA) technologies as Adobe Flash,Microsoft Silverlight, and Sun JavaFX.

Work on HTML 5, originally referred to as WebApplications 1.0, was initiated in 2004 and iscurrently being carried out in a joint effort betweenthe W3C HTML WG (Work Group) and the WebHypertext Application Technology WorkingGroup (WHATWG). Many key players areparticipating in the W3C effort includingrepresentatives from the four major browservendors: Apple, Mozilla, Opera, and Microsoft;and a range of other organizations and individuals.Specification is still a work in progress has quitea long way from completion.

In addition to specifying markup, HTML 5introduces a number of APIs that help in creatingWeb applications. These can be used together withthe new elements introduced for applications:

• 2D drawing API which can be used with thenew canvas element.

• API for playing of video and audio which canbe used with the new video and audio elements.

• An API that enables offline Web applications.

• An API that allows a Web application to registeritself for certain protocols or media types.

• Editing API in combination with a new globalcontent editable attribute.

• Drag & drop API in combination with adraggable attribute.

• API that exposes the history and allows pagesto add to it to prevent breaking the back button.

• Cross-document messaging

Existing Document Object Model (DOM) interfacesare extended and de facto features documented.

HTML 5 is defined in a way that it is backwardscompatible with the way user agents handledeployed content. To keep the authoring languagerelatively simple for authors several elements andattributes are not included as outlined in the othersections of this document, such as presentationalelements that are better dealt with using CSS.

1. StructureThe HTML serialization refers to the syntax thatis inspired by the SGML syntax from earlierversions of HTML, but defined to be morecompatible with the way browsers actually handleHTML in practice.

Example document that conforms to the HTML5syntax:

<!doctype html><html>

<head><meta charset="UTF-8"><title>Exampledocument</title></head><body><p>Example paragraph</p></body>

</html>

The XML serialisation refers to the syntax usingXML 1.0 and namespaces, just like XHTML 1.0.

Example document that conforms to the XMLsyntax of HTML 5 :

Be Ready !Be Ready !Be Ready !Be Ready !Be Ready !HTML5 is coming

Ganesh Tiwari063 Computer

Page 16: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

12 ZERONE 2010

Cutting-Edge Technologies

<?xml version="1.0"encoding="UTF-8"?><htmlxmlns="http://www.w3.org/1999/xhtml">

<head><title>Exampledocument</title></head><body><p>Example paragraph</p></body>

</html>

2. Replacement of <div> tagThe use of div elements is largely because currentversions of HTML 4 but lack the necessarysemantics for describing these parts morespecifically. HTML 5 addresses this issue by

introducing new elements for representing eachof these different sections.

The div elements can be replaced with the newelements: header, nav, section, article, aside, andfooter.

The markup for the above document could looklike the following:

<body><header>...</header><nav>...</nav><article><section> ...</section></article><aside>...</aside><footer>...</footer>

</body>

3. Embedded mediaVideo on the Web is booming, but it's almost allproprietary. YouTube uses Flash, Microsoft usesWindows Media®, and Apple uses QuickTime.HTML currently lacks the necessary means tosuccessfully embed and control multimedia itself.Whether any one format and codec will bepreferred is still under debate. Probably OggTheora support at least will be stronglyrecommended, if not required. Support forproprietary formats patent-encumbered formatswill be optional.

The simplest way to embed a video is to use avideo element and allow the browser to providea default user interface. The controls attribute isa boolean attribute that indicates whether or notthe author wants this UI on or off by default. Theoptional poster attribute can be used to specifyan image which will be displayed in place of thevideo before the video has begun playing.

<video src="video.ogg" id="video"controls="true" poster="poster.jpg"></video><p><button type="button"onclick="video.play();">Play</button><button type="button"onclick="video.pause();">Pause</button><button type="button"onclick="video.currentTime = 0;"><<Rewind</button>

HTML4 Structure

HTML5 Structure

Page 17: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 13

Cutting-Edge Technologies

A complementary audio element is also proposed.Most of the attributes are common between thevideo and audio elements, although for obviousreasons, the audio element lacks the width, height,and poster attributes.

<audio src="music.mp3"controls=”true” autoplay="autoplay"><a href="music.mp3">Download song</a></audio>

Figure can be used to associate a caption togetherwith some embedded content, such as a graphicor video.

<figure><img src="pic.png"><legend>Example</legend></figure>

4. CanvasCanvas is used for dynamic scriptable renderingof bitmap graphics on the fly. It was initiallyintroduced by Apple for use inside their own MacOX WebKit component, powering componentslike Dashboard widgets and the Safari browser.Some browsers already support the <canvas>tag, like Firefox and Opera.

The <canvas> tag is only a container for graphics;you must use a script to actually paint graphics.

Canvas consists of drawable region defined inhtml code with height and width attributes.

<canvas id=”a_canvas”width=”400”height=”300”></canvas>

JavaScript code may access the area through fullset of draing function similar to other common2D APIs, thus allowing for dynamically generatedgraphics.

2D and 3D graphics both will be possible withthe help of API, which is expected to be popularfor online gaming, animations and imagecomposition.

5. MathML and SVGThe HTML syntax of HTML 5 allows for MathMLand SVG elements to be used inside a document.

E.g. a very simple document using some of theminimal syntax features could look like:

<!doctype html><title>SVG in text/html</title><p>A green circle:<svg> <circler="50"cx="50" cy="50" fill="green"/></svg> </p>

6. InteractivityHTML 5 also goes under the rubric of WebApplications 1.0. Several new elements arefocused on more interactive experiences for Webpages:

• details

• datagrid

• menu

• command

These elements all have the potential to changewhat is displayed based on user action and choicewithout loading a new page from the server.

datagridThe datagrid element serves the role of a gridcontrol. It's intended for trees, lists, and tablesthat can be updated by both the user and scripts.By contrast, traditional tables are mostly intendedfor static data.

<datagrid> <table> <tr><td>Jones</td><td>Allison</

td><td>A-</td><td>B+</td><td>A</td></tr>

<tr><td>Smith</td><td>Johnny</td><td>A</td><td>C+</td><td>A</td></tr>

... </table></datagrid>

What distinguishes this from a regular table isthat the user can select rows, columns, and cells;collapse rows, columns, and cells; edit cells; deleterows, columns, and cells; sort the grid; andotherwise interact with the data directly in thebrowser on the client. The JavaScript code maymonitor the updates.

Page 18: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

14 ZERONE 2010

Cutting-Edge Technologies

Menu and commandThe menu element has actually been present inHTML since at least version 2. It was deprecatedin HTML 4, but it comes roaring back with newsignificance in HTML 5. In HTML 5, a menucontains command elements, each of which causesan immediate action. For example,

The label attribute gives a title for the menu. Forexample,

<menu type="popup" label="Edit"><command onclick="undo()"label="Undo"/><command onclick="redo()"label="Redo"/><command onclick="cut()"label="Cut"/><command onclick="copy()"label="Copy"/><command onclick="paste()"label="Paste"/><command onclick="delete()"label="Clear"/></menu>

Menus can be nested inside other menus to createhierarchical menus.

7. Web forms 2Web forms 2 specification adds lots of featuresfor authoring forms for basic client side validation,new input types, and repetition blocks. SeveralJavaScript implementations are underdevelopment.

Some examples of web form 2 are:

<input type="email” value="a@b"><input pattern="[1-]{10}"value="1234567891"><input type="number" min="7"max="25" step="2"> </label><input type="date” required>

Other elementsThe following elements have been introduced forbetter structure:

• dialog can be used to mark up a conversationlike this:

<dialog><dt> hello, how r u<dd> fine and you?

<dt> mee to good</dialog>

• embed is used for plugin content.

• mark represents a run of marked (highlighted)text. It is not similar as <em> tag.

You searched for <m>marker</m>

• meter represents a measurement, such as diskusage, user ratings.

Rating: <meter min=“0”max=“5”value=“3”>

• progress represents a completion of a task, suchas downloading or when performing a series ofexpensive operations. We can use the progresselement to display the progress of a timeconsuming function in JavaScript.

<progress value=“128”max=“1024”>72.5%</progress>

• time represents a date and/or time, which solvesAccessibility Issue. It can be used in Microformatslike hCalendar

<time datetime="2007-08-02T23:30Z">Fri, Aug 03 2007 at 09:30</time>

• details represents additional information orcontrols which the user can obtain on demand.

• datalist together with the a new list attribute forinput is used to make comboboxes:

<input list="browsers"><datalist id="browsers"><option value="Safari"><option value="Internet Explorer"><option value="Opera"><option value="Firefox"></datalist>

• keygen represents control for key pairgeneration.

• bb represents a user agent command that theuser can invoke.

• output represents some type of output, such asfrom a calculation done through scripting.

Page 19: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 15

Cutting-Edge Technologies

1. www.en.wikipedia.org2. www.w3.org3. www.whatwg.org

1. www.en.wikipedia.org

2. www.w3.org

3. www.whatwg.org

References

• ruby, rt and rp allow for marking up rubyannotations.

The input element's type attribute now has thefollowing new values:

datetime, datetime-local, date,month, week, time, number, range,email, url, search, color

The idea of these new types is that the user agentcan provide the user interface, such as a calendardate picker or integration with the user's addressbook, and submit a defined format to the server.It gives the user a better experience as his inputis checked before sending it to the server meaningthere is less time to wait for feedback..

At lastWork on HTML 5 is rapidly progressing, yet it isstill expected to continue for several years. Dueto the requirement to produce test cases andachieve interoperable implementations, currentestimates have work finishing in around ten tofifteen years.

During this process, feedback from a wide rangeof people including web designers anddevelopers, CMS and authoring tool vendors andbrowser vendors is vital to ensure its success.Everyone is not only welcome, but activelyencouraged to contribute feedback on HTML 5.

There are numerous venues through which youmay contribute. You may join the W3C’s HTMLWG and subscribe/contribute to the HTML WGmailing lists, WHATWG mailing lists, or wiki.

Page 20: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

16 ZERONE 2010

Cutting-Edge Technologies

Teleportation is the name given by sciencefiction writers to the feat of making anobject or person disintegrate in one place

while a perfect replica appears somewhere else.Teleportation involves de-materializing an objectat one point, and sending the details of thatobject's precise atomic configuration to anotherlocation, where it will be reconstructed. What thismeans is that time and space could be eliminatedfrom travel - we could be transported to anylocation instantly, without actually crossing aphysical distance. This, until now, has only beenavailable to read in si-fi novels and watch withthrill and excitement over si-fi movies.

Imagination leads to great innovations and so thereare scientists working right now on such a methodof travel to convert this imagination into realityby combining properties of telecommunicationsand transportation to achieve a system calledteleportation.

But, Quantum teleportation is not the same asthe teleportation most of us know from sciencefiction, where an object (or person) in one placeis “beamed up” to another place where a perfectcopy is replicated. In quantum teleportation twophotons or ions (for example) are entangled insuch a way that when thequantum state of one ischanged the state of theother also changes, as if thetwo were still connected.This enables quantuminformation to be teleportedif one of the photons/ions issent some distance away.

It works by entangling two objects, like photonsor ions. The first teleportation experimentsinvolved beams of light. Once the objects areentangled, they're connected by an invisible wave,like a thread or umbilical cord. That means whensomething is done to one object, it immediately

happens to the other object, too. Einstein calledthis "spooky action at a distance."

Although the first proof-of-principledemonstration was reported in 1997 by theInnsbruck and Rome groups, long-distanceteleportation had so far only been realized in fibrewith lengths of hundreds of metres apart untilthis recent experiment. And those distances havebeen accomplished with fiber channels, whichhelp preserve the photons' state. But the ongoingvast research and experiments have continuouslytried bringing this quantum teleportaion conceptto a whole new level now.

Recently in what promises to be a milestoneexperiment led by Jian-Wei Pan and Cheng-ZhiPeng at the University of Science and Technologyof China and Tsinghua University (Beijing,China), quantum information was ‘transmitted’through the open air between two stations 16kilometers (10 miles) apart. The previous recordwas a few hundred meters using fiber optic cable.At the distance of 10 or more kilometers, thisalmost mysterious form of communication, called“spooky action at a distance” by Einstein,becomes possible for Earth to orbiting satellites.

What’s so spooky is the natureof quantum entanglement, howseparated particles can sharequantum properties as if theywere one particle. Entangledphoton pairs were generatedfor this experiment at theteleportation site using a

semiconductor, a blue laser beam, and a crystalof beta-barium borate (BBO). The pairs of photonswere entangled in the spatial modes of photon 1and polarization modes of photon 2. The researchteam designed two types of telescopes to serve asoptical transmitting and receiving antennas. It’sone thing to imagine this kind of 2=1 condition

Barsha Paudel063 Electronics

“Once the objects areentangled, they're connected

by an invisible wave, like athread or umbilical cord.”

Quantum Teleportation!The Promises it Holds

Page 21: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 17

Cutting-Edge Technologies

for distances no bigger than an atom, but overkilometers?

The researchers set up two ‘stations:’ “Alice”located in a suburb of Beijing and 16 kilometersaway on the other side of a reservoir was “Bob.”Alice and Bob each received one of a pair ofentangled photons. Photons, the equivalent ofelectrons for light, are often used for entanglement

experiments as they are good for transmission andcan be manipulated by specialized lasers. At theAlice station, one entangled photon was measuredin combination with an unknown qubit (aquantum unit of information), in a sense wascharged-up by a maximally applied entanglingforce with both spatial and polarization (laser)methods. The result, a more highly entangledparticle, was sent via telescope to Bob. At the Bobstation, that photon then also projected the statusof the unknown qubit as did Alice. The mumbojumbo means that the state of one photon (Alice)instantly reflected is the state of the otherentangled photon (Bob). These researchers foundthat even at this distance the photon at thereceiving end still responded to changes in stateof the photon remaining behind. The qubit is thepiece of quantum information that is passed, sothis is a form of communication.

This experiment required a great deal ofgroundbreaking work, including specializedtelescopes designed for the open air transfer, activefeedback control for transmission stability, and

synchronized real-time information transfer. Theresult was information fidelity approaching 89%,good enough for a lot of quantum jazz.

That does not mean this is ready for real-worldapplications. It does mean that practicalapplications can be envisioned. Between now andthe time when quantum teleportation is used forcommunication, there needs to be a lot of work

done with the size, cost, and reliability of theequipment needed to generate and control theentanglement effect. The entangled photons willneed better control. Charged electrons – ions –are easier to manipulate, for example to createencryption patterns; but something will be neededto achieve a similar level of manipulation forphotons. Nevertheless, this is a mind-openingachievement.

Now, why is this a big deal? Well, in the pastscientists have only been able to teleportinformation across a small span of a few metersand even then they had to do so through somekind of conduit like a fiber optic cable. Whathappened recently was an open-air quantumteleportation from across ten miles. An opticalfree-space link is highly desirable for extendingthe transfer distance, because of its lowatmospheric absorption for certain ranges ofwavelength. Scientists in China have succeededin teleporting information between photonsfurther than ever before. They transportedquantum information over a free space distance

Page 22: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

18 ZERONE 2010

Cutting-Edge Technologies

of 16 km (10 miles), much further than the fewhundred meters previously achieved, whichbrings us closer to transmitting information overlong distances without the need for a traditionalsignal. This thus has proved itself to be anunprecedented achievement.

Quantum teleportation is central to the practicalrealization of quantum communication and withthe distance of 16 km which is greater than theeffective aerosphere thickness of 5-10 km, thegroup's success could pave the way forexperiments between a ground station and asatellite, or two ground stations with a satelliteacting as a relay. The experiments confirm thefeasibility of space-based quantum teleportation,and represent a giant leap forward in thedevelopment of quantum communicationapplications. This means quantumcommunication applications could be possible ona global scale in the near future. This resultconfirms the feasibility of space-basedexperiments, and is an important step towardsquantum-communication applications on a globalscale.

So the promises of quantum teleportation is hugeand hard to miss. We never know, soon walkingcould be so 2010.

1. www.physorg.com/news193551675.html

2 . w w w . e n . w i k i p e d i a . o r g / w i k i /Quantum_teleportation

3. www.nature.com/nphoton/journal/v4/n6/full/nphoton.2010.87.html

4. www.scitechstory.com/2010/05/20/quantum-teleportation-over-16-km-in-open-air/

References

An umbrella that lets you surf the Internet whilewalking in the rain takes mobile electronics to anew level.

Called Pileus, the Internet umbrella sports a largescreen, which drapes across the inside of theumbrella, and a camera, digital compass, GPS,and motion sensor, all located in the umbrella’shandle.

So far, the umbrella, which is only in prototypeform, has two capabilities: photo-sharing throughFlickr and 3-D map navigation. To operate thishandheld electronic umbrella, you just rotate thegrip of the handle.

The umbrella was created at Keio University byTakashi Matsumoto and Sho Hashimota, whohave now co-founded the company Pileus LLC.

[Source: www.technewsdaily.com]

Ordinary Things Turned Hi-Tech!

The Internet Umbrella

Page 23: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 19

Contemporary Technologies

Cloud computing is a model for enablingconvenient, on-demand network access toa shared pool of configurable computing

resources (e.g. networks, servers, storage,applications, and services) that can be rapidlyprovisioned and released with minimalmanagement effort or service provider interaction.This cloud model promotes availability and iscomposed of five essential characteristics, threedelivery models, and four deployment models.

In another way, Cloud computing is a style ofcomputing in which dynamically scalable andoften virtualized resources are provided as aservice over the Internet. A user can have as muchor as little of a service as they want at any giventime; and the service are fully managed by theprovider (the consumer needs nothing but an IP

enabled devices (PC, laptop, cell phone andInternet access).

Cloud computing support Grid computing ("a formof distributed computing whereby a 'super andvirtual computer' is composed of a cluster ofnetworked, loosely-coupled computers, acting inconcert to perform very large tasks") by quicklyproviding physical and virtual servers on whichthe grid applications can run. It also supportsnon grid environments, such as a three-tier Webarchitecture running standard or Web 2.0applications. Cloud computing can be confusedwith utility computing (the "packaging ofcomputing resources, such as computation andstorage, as a metered service similar to a traditionalpublic utility such as electricity") and autonomiccomputing ("computer systems capable of self-management").

Cloud ComputingNar Kaji Gurung

063 Computer

Contemporary TechnologiesContemporary TechnologiesContemporary TechnologiesContemporary TechnologiesContemporary Technologies

Some vendors supplying cloud computing

Page 24: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Introduction to cloud computingCloud computing infrastructures can allowenterprises to achieve more efficient use of theirIT hardware and software investments. Cloudcomputing is an example of an ultimatelyvirtualized system, and a natural evolution fordata centers that employ automated systemsmanagement, workload balancing, andvirtualization technologies.

The Cloud makes it possible to launch Web 2.0applications quickly and to scale up applicationsas much as needed when needed. The platformsupports traditional Java™ and Linux, Apache,MySQL, PHP (LAMP) stack-based applicationsas well as new architectures such as Map Reduce© IBM Corporation 2007 Cloud Computing 5 andthe Google File System, which provide a meansto scale applications across thousands of serversinstantly. Cloud computing users can avoidcapital expenditure (CapEx) on hardware,software, and services when they pay a provideronly for what they use. Consumption is billedon a utility (e.g. resources consumed, likeelectricity, telephone) or Subscription (e.g. timebased, like a newspaper) basis with little or noupfront cost. Other benefits of this time sharingstyle approach are low barriers to entry, sharedinfrastructure and costs, low managementoverhead, and immediate access to a broad rangeof applications. Users can generally terminate thecontract at any time (thereby avoiding return oninvestment risk and uncertainty) and the servicesare often covered by service level agreements(SLAs) with financial penalties.

Essential characteristicsOn-demand self-service: A consumer canunilaterally provision computing capabilities,such as server time and network storage, as neededautomatically without requiring human interactionwith each service’s provider.

Ubiquitous network access: Capabilities areavailable over the network and accessed throughstandard mechanisms that promote use byheterogeneous thin or thick client platforms (e.g.,mobile phones, laptops, and PDAs).

Location independent resource pooling: Theprovider’s computing resources are pooled toserve all consumers using a multi-tenant model,with different physical and virtual resourcesdynamically assigned and reassigned according

to consumer demand. The customer generally hasno control or knowledge over the exact locationof the provided resources but may be able tospecify location at a higher level of abstraction(e.g., country, state, or datacenter). Examples ofresources include storage, processing, memory,network bandwidth, and virtual machines.

Rapid elasticity: Capabilities can be rapidly andelastically provisioned to quickly scale up andrapidly released to quickly scale down. To theconsumer, the capabilities available forprovisioning often appear to be infinite and canbe purchased in any quantity at any time.

Measured Service: Cloud systems automaticallycontrol and optimize resource use by leveraging ametering capability at some level of abstractionappropriate to the type of service (e.g,storage,Processing, bandwidth, and active useraccounts). Resource usage can be monitored,controlled, and reported providing transparencyfor both the provider and consumer of the utilizedservice.

Note: Cloud software takes full advantage of thecloud paradigm by being service oriented with afocus on statelessness, low coupling, modularity,and semantic interoperability.

Delivery models of cloud computingCloud Software as a Service (SaaS): Thecapability provided to the consumer is to use theprovider’s applications running on a cloudinfrastructure and accessible from various clientdevices through a thin client interface such as aWeb browser (e.g., web-based email). Theconsumer does not manage or control theunderlying cloud infrastructure, network, servers,operating systems, storage, or even individualapplication capabilities, with the possibleexception of limited user-specific applicationconfiguration settings. In the software-as-a-servicecloud model, the vendor supplies the hardwareinfrastructure, the software product and interactswith the user through a front-end portal.

Cloud Platform as a Service (PaaS): Platform-as-a-service in the cloud is defined as a set ofsoftware and product development tools hostedon the provider's infrastructure. Developers createapplications on the provider's platform over theInternet. PaaS providers may use APIs, websiteportals or gateway software installed on thecustomer's computer. Force.com, (an outgrowth

Page 25: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 21

Contemporary Technologies

of Salesforce.com) and GoogleApps are examplesof PaaS. Developers need to know that currently,there are not standards for interoperability or dataportability in the cloud. Some providers will notallow software created by their customers to bemoved off the provider's platform.

Cloud Infrastructure as a Service (IaaS): Thecapability provided to the consumer is toprovision processing, storage, networks, and otherfundamental computing resources where theconsumer is able to deploy and run arbitrarysoftware, which can include operating systemsand applications. The consumer does not manageor control the underlying cloud infrastructure buthas control over operating systems, storage,deployed applications, and possibly selectnetworking components (e.g., firewalls, loadbalancers).

Deployment models(types of cloud)Private cloud: The cloud infrastructure isoperated solely for an organization. It may bemanaged by the organization or a third party andmay exist on premise or off premise. Privateclouds are a good option for companies dealingwith data protection and service-level issues.

Community cloud: The cloud infrastructure isshared by several organizations and supports aspecific community that has shared concerns (e.g.,mission, security requirements, policy, andcompliance considerations). It may be managedby the organizations or a third party and may existon premise or off premise.

Public cloud: Public clouds are run by thirdparties and jobs from many different customersmay be mixed together on the servers, storagesystems, and other infrastructure within the cloud.End users don’t know who else’s job may berunning on the same server, network, or disk astheir own jobs. The cloud infrastructure is madeavailable to the general public or a large industrygroup and is owned by an organization sellingcloud services.

Hybrid cloud: Hybrid clouds combine the publicand private and community cloud models..Hybrid clouds offer the promise of on-demand,externally provisioned scale, but add thecomplexity of determining how to distributeapplications across these different environments.

Architecture of cloud computingIt typically involves multiple cloud componentscommunicating with each other over applicationprogramming interfaces, usually web services.

Cloud computing types

Page 26: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

22 ZERONE 2010

Cloud computing system is divided it into twosections: the front end and the back end. Thefront end is the side the computer user, or client,sees. The back end is the "cloud" section of thesystem. Most of the time, servers don't run at fullcapacity. That means there's unused processingpower going to waste. It's possible to fool aphysical server into thinking it's actually multipleservers, each running with its own independentoperating system. The technique is called servervirtualization. By maximizing the output ofindividual servers, server virtualization reducesthe need for more physical machines. On the backend of the system are the various computers,servers and data storage systems that create the"cloud" of computing services. A central server,monitoring traffic and client demands to ensureeverything runs smoothly. It follows a protocoland uses a special kind of software calledmiddleware which allows networked computersto communicate with each other. If a cloudcomputing there's likely to be a high demand fora lot of storage space. Cloud computing systemsneed at least twice copy of storage devices(redundancy).It supports RAID architecture.

Layers of the cloud computing1. Application: A cloud application leverages theCloud in software architecture, often eliminatingthe need to install and run the application on thecustomer's own computer, thus alleviating the

burden of software maintenance, ongoingoperation, and support. For example: Peer-to-peer/ volunteer computing (Bit torrent, BOINCProjects, Skype),Web application(Facebook),Software as a service (Google Apps,SAP and Salesforce),Software plus services(Microsoft Online Services)

2. Client: A cloud client consists of computerhardware and/or computer software which relieson cloud computing for application delivery, orwhich is specifically designed for delivery of cloudservices and which, in either case, is essentiallyuseless without it. For example: Mobile (Android,iPhone, Windows Mobile),Thin client (CherryPal,Zonbu, gOS-based systems),Thick client / Webbrowser (Microsoft Internet Explorer, MozillaFirefox)

3. Infrastructure: Cloud infrastructure, typicallya platform virtualization environment, as a service.For example: Full virtualization (GoGrid,Skytap),Grid computing (Sun Grid),Management(RightScale),Compute (Amazon Elastic ComputeCloud),Platform (Force.com)

4. Platform: A cloud platform, such as Platformas a service, the delivery of a computing platform,and/or solution stack as a service, facilitatesdeployment of applications without the cost andcomplexity of buying and managing the underlyinghardware and software layers. For example: Webapplication frameworks (Java Google Web Toolkit(Google App Engine),Python Django (Google AppEngine),Ruby on Rails (Heroku),.NET (AzureServices Platform),Web hosting(Mosso),Proprietary (Force.com) )

5. Service: A cloud service includes "products,services and solutions that are delivered andconsumed in real-time over the Internet". Forexample, Web Services which may be accessedby other cloud computing components, software,e.g., Software plus services, or end users directly.Specific examples include: Identity (OAuth,OpenID), Payments (Amazon Flexible PaymentsService, Google Checkout, and PayPal), Mapping(Google Maps, Yahoo! Maps), and Search (Alexa,Google Custom Search, and Yahoo! BOSS)

6. Storage: Cloud storage involves the deliveryof data storage as a service, including database-like services, often billed on a utility computingbasis, e.g., per gigabyte per month. For example:Database ( Google App Engine's BigTabledatastore),Network attached storage (MobileMe

Cloud computing sample architecture

Page 27: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 23

Contemporary Technologies

iDisk, Nirvanix CloudNAS),Synchronization(Live Mesh Live Desktop component, MobileMepush functions),Web service (Amazon SimpleStorage Service, Nirvanix SDN) Backup (BackupDirect, Iron Mountain Inc services) Cloud storagecan be delivered as a service to cloud computing,or can be delivered to end points directly.

Cloud computing applicationsThe applications of cloud computing arepractically limitless. Why would anyone want torely on another computer system to run programsand store data? Here are justa few reasons:

• Clients would be able toaccess their applicationsand data from anywhere atany time.

• It could bring hardwarecosts down. Cloudcomputing systems wouldreduce the need for advanced hardware on theclient side.

• Cloud computing systems give theseorganizations company-wide access to computerapplications. The companies don't have to buy aset of software or software licenses for everyemployee.

• Servers and digital storage devices take upspace. Some companies rent physical space tostore servers and databases because they don'thave it available on site. Cloud computing givesthese companies the option of storing data onsomeone else's hardware, removing the need forphysical space on the front end.

• Corporations might save money on IT support.Streamlined hardware would, in theory, havefewer problems than a network of heterogeneousmachines and operating systems.

• If the cloud computing system's back end is agrid computing system, then the client could takeadvantage of the entire network's processingpower. The cloud system would tap into theprocessing power of all available computers onthe back end, significantly speeding up thecalculation.

Criticism and disadvantages ofcloud computing• Since cloud computing does not allow users tophysically possess the storage of their data (theexception being the possibility that data can bebacked up to a user-owned storage device, suchas a USB flash drive or hard disk) it does leaveresponsibility of data storage and control in thehands of the provider.

• Cloud computing has been criticized for limitingthe freedom of users and making them dependenton the cloud computing provider, and some

critics have alleged that isonly possible to useapplications or services thatthe provider is willing to offer.Thus, The London Timescompares cloud computing tocentralized systems of the1950s and 60s, by whichusers connected through

"dumb" terminals to mainframe computers.Typically, users had no freedom to install newapplications and needed approval fromadministrators to achieve certain tasks. Overall,it limited both freedom and creativity. The Timesargues that cloud computing is a regression tothat time.

• Similarly, Richard Stallman, founder of the FreeSoftware Foundation, believes that cloudcomputing endangers liberties because userssacrifice their privacy and personal data to a thirdparty. He stated that cloud computing is "simplya trap aimed at forcing more people to buy intolocked, proprietary systems that would cost themmore and more over time."

Companies using cloud computingGoogle: Google has opened its cloud to outsidedevelopers. Google's Application Engine is a freeservice that lets anyone build and run webapplications on Google's very own distributedinfrastructure. "Google Application Engine givesyou access to the same building blocks that Googleuses for its own applications, making it easier tobuild an application that runs reliably, even underheavy load and with large amounts of data.” Inparticular, the platform offers:

• Dynamic web serving, with full support ofcommon web technologies

“Cloud computinginfrastructures are next

generation platforms that canprovide tremendous value to

companies of any size.”

Page 28: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

24 ZERONE 2010

• Persistent storage (powered by Bigtable and GFSwith queries, sorting, and transactions)

• Automatic scaling and load balancing

• Google APIs for authenticating users andsending email

• Fully featured local development environment

Amazon.com: Amazon.com offers the AmazonWeb Services, including its Elastic ComputingCloud (for processing power), Simple StorageService (for storage), and SimpleDB (for databasequeries)

Microsoft: Microsoft has offered developers aquick peek at an unreleased Windows Mobileclient for its fledgling "Live Mesh" service. LiveMesh has been described as a "software-plus-service platform." Intended to integrate desktopand mobile operating systems, it providessynchronization and remote access servicessimilar to those offered by products.

ConclusionIn today's global competitive market, companiesmust innovate and get the most from its resourcesto succeed. This requires enabling its employees,business partners, and users with the platformsand collaboration tools that promote innovation.Cloud computing infrastructures are nextgeneration platforms that can provide tremendousvalue to companies of any size. They can helpcompanies achieve more efficient use of their IThardware and software investments and provide

1. wikipedia.org/wiki/cloud_computing

2. Cloud Computing, Andy Bechtolsheim,Chairman & Co-founder, Arista NetworksNovember 12th, 2008

3. Cloud computing primer, Sun Microsystem.

4. Cloud computing, Greg Boss, Padma Malladi,Dennis Quan, Linda Legregni, Harold Hall

5. Application architecture for cloudcomputing, info.rpath.com

6. Cloud computing for science andengineering, CSIDC, www.computer.org

References

a means to accelerate the adoption of innovations.Cloud computing increases profitability byimproving resource utilization. Costs are drivendown by delivering appropriate resources onlyfor the time those resources are needed. Cloudcomputing has enabled teams and organizationsto streamline lengthy procurement processes.Cloud computing enables innovation byalleviating the need of innovators to find resourcesto develop, test, and make their innovationsavailable to the user community. Innovators arefree to focus on the innovation rather than thelogistics of finding and managing resources thatenable the innovation.

Source: www.xkcd.com

Page 29: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 25

Contemporary Technologies

Let’s get started with a familiar scenario. Let’ssuppose a XYZ bank has its central officein Kathmandu (for obvious reasons). Its

branch offices are located at different major citiesall over Nepal. Whenever you carry outtransactions from any of the offices, all branchoffices get informed about it and the database isupdated accordingly. But how? You may answer,there is connectivity between these branch officesor all branch offices communicate with centraloffice. Yes, that is obvious. The connectivity couldbe Wired or Wireless. In Wired connectivity, itcould be dedicated Leased line to create privateWide Area Network (WAN). It provides betterquality, reliability and speed. But, it would cost ahuge amount for the bank to use optical fibers orother kinds of wires like coaxial, twisted cable(for ISDN) which wouldn’t be a wise decision.Also, another alternative is Wireless connectivity.It can use transmitters and receivers (using

antenna) following the principles of Line of Sight(direct)/indirect to create private WWAN (WirelessWide Area Network) to connect all the offices.But wireless communication isn’t much reliable.The radio/micro waves would interfere muchwith the noisy (unwanted signals) environmentand distort the original signals. Also, theinappropriate weather conditions would degradethe quality and speed. Also, the installation ofWireless systems would cost much. For a largecompany, the capital mayn’t be a problem thoughthere are other technical difficulties.

But, we have a much better approach which wecan access at a cheap rate. The concept is VPNwhich is an acronym for Virtual Private Network.We all know about Internet which is expandingrapidly. The Internet is more like an infrastructure.Most parts of the country/world have a globalreach through Internet. The dedicatedcommunication satellites have global reach to each

VPNVPNVPNVPNVPN

Ranjan Shrestha062 Electronics

Solution to remotely connected intranetSolution to remotely connected intranetSolution to remotely connected intranetSolution to remotely connected intranetSolution to remotely connected intranet

Page 30: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

26 ZERONE 2010

and every part of the world. Hence, instead ofusing dedicated leased lines(Wired)/Wireless overa large geographic area, VPN uses cheap publicnetwork, such as the Internet as a backbone tocreate a virtually circuited private network for thecompany to stay connected with its branch offices(here bank). Also, a welldesigned VPN can reduceoperational cost, increase insecurity, extend to muchlarger geographic area, buildsa concept of globalnetworking (assume branchoffices in other countries),connect to extranet(connecting with othercompany’s private networks).

Types of VPN

1. Remote access VPNIt is a user to LAN connection used by companythat has employees who need to connect to theprivate network from various remote locations.Generally, Enterprise Service Provider (ESP) setsup a Network Access Server (NAS) and providesremote users with client softwares. Then, theremote users can communicate with the corporatenetwork through NAS using the client software.The Remote Access VPN permit secure, encryptedconnections between a company’s private networkand remote users through a third party serviceprovider.

2. Site to site VPNWith the use of dedicated equipments andencryption algorithms, a company can connect tomultiple fixed sites over a public network suchas the internet. The Site to Site VPN can of thefollowing types.

Intranet based

If a company has one or more remote locationsthat they wish to join in a single private network,they can create an intranet VPN to connect LANto LAN.

Extranet based

When the network of a company wants tocommunicate with network of another company(may be a partner, supplier, and customer), theycan build an extranet VPN that connects LAN toLAN and that allows various companies to workin a shared environment.

Tunneling conceptMost VPNs rely on tunneling to communicatewith private networks that reach across theInternet. The tunneling protocol provides a securepath through an untrusted network. It is theprocess of placing entire packet within another

packet and sending it over a network.This means the actual packet(information) isn’t disclosed in thepublic network. The tunneling usesthree different protocols: Carrierprotocol used by the network that theinformation is travelling over,Encapsulating protocol uses GenericRouting Encapsulation(GRE), IPSec,etc that is wrapped around the

original information and Passenger protocolprocess on original data(IPX, IP) being carried.

Security implementation in VPNThe VPN networks are designed using internetresources. We all know the public network; theinternet is not much secure. Hence, a welldesigned VPN uses several methods for keepingthe connection and data secure.

1. FirewallA firewall is a part of computer system or networkthat is designed to block unauthorized accesswhile permitting authorized communication. Itcan be implemented in either hardware orsoftware, or a combination of both. The gateway(routes packets to outside of local network) canbe configured to permit/deny access certain ports.A Cisco’s 1700 series routers can be upgradedwith appropriate IOS (Internetwork OperatingSystem) to include firewall capabilities.

2. EncryptionIt is the process of transforming information usingan algorithm to make it unreadable to anyoneexcept those processing special knowledge usuallyreferred to as a key. It is used to protect data intransit. Most encryption systems belong to one ofthe two categories: Symmetric-key encryption andPublic-key encryption. In Symmetric-keyencryption, each computer has a secret key that itcan use to encrypt a packet of information beforeit is sent over the network to another computer.Both the communicating partners must know thekey used for encryption and decryption. In Public-key encryption, it uses a combination of a private

"a well designed VPN canreduce operational cost,

increase in security, extendto much larger geographic

area, builds a concept ofglobal networking ,

connect to extranet etc..”

Page 31: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 27

Contemporary Technologies

key and a public key. The private key is keptsecret, while the public key may be distributedwidely. The messages are encrypted with therecipient’s public key and can only be decryptedwith the corresponding private key. The keys arerelated mathematically but the private key can’tbe easily derived from the public key.

3. IPSecThe Internet Protocol Security is a protocol thatis used to secure IP communications byauthenticating and encrypting each IP packet of adata stream. The two encryption modes areTunnel and Transport. IPSec can be used toprotect (encrypt) data flow between PC to router,PC to server, between gateways, firewall togateway. IPSec has a dual mode, end-to-end,security scheme operating at OSI (Open SystemsInterconnection) model Layer 3(Network layer).

1. http://en.wikipedia.org/wiki/VPN

2. http://computer.howstuffworks.com/vpn.htm

3. Image by Cisco Systems, Inc.

References

4. AAA serverThe AAA (Authentication, Authorization andAccounting) servers are used for more secureaccess in VPN environment. Before a session isestablished, the request is proxied to AAA server.Then, it authenticates (knows who is trying toaccess), authorizes (provides access in accordanceto the predefined settings), accounts (securityauditing, billing or reporting).

Page 32: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

28 ZERONE 2010

MATLAB is a high-performance languagefor technical computation of complexalgorithm. This provide easy mean to

implement of algorithm on digital signalprocessing, image processing, signal andcommunication model etc.

Today all the circuits designs arecarried out onµC and FPGA and they are usually digitalcomputations. for these types of computationson computer matlab is a powerful tool.Whileperforming the digital I/p and o/p we alwayspreferred to use microcontroller (µC)(ie, cheapand easy).But when speed and parallel computingare of chief issue, FPGAs are the bestalternative(though expensive and complex).Butcomputer interface still find its own worth whenyou are performing complex algorithm, whichwill be tedious to implement in µC and FPGA.

Accessing matlab through matlab is justified forthe projects which perform complex algorithmon digital data.

How to connect to the hardware port of computerusing MATLAB

1. Create a digital IO (DIO) object

2. All lines to it (we may treat device object as acontainer for lines)

3. Line and Port Characterization

(to specify whether it is input or output orbidirectional).

Parallel port

It is a 25 pin (also available as 36 pin) intended for8 bits parallel data transmission in TTL logic.

• 8 output pins accessed via the DATA Port

• 5 input pins (one inverted) accessed via theSTATUS Port

• 4 output pins (three inverted) accessed via theCONTROL Port

• 8 grounds pins

The PC supports up to three parallel ports that areassigned the labels LPT1, LPT2, and LPT3 Withaddresses (in hex) 378, 278, and 3BC, respectively.The addresses of the ports are

Printer Data Port Status ControlLPT1 0x0378 0x0379 0x037aLPT2 0x0278 0x0279 0x027aLPT3 0x03bc 0x03bd 0x03be

CONNECTING TO MATLABSugan Shakya

062 Electronics

Page 33: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 29

Contemporary Technologies

Normally there is one parallel port LPT1 in ourpc but you can check for your pc using devicemanager.

We can access the parallel port through MATLABusing following code:

parallelPort=digitalio('parallel','LPT1');hwlines =addline(parallelPort,0:7,'out');(or, hwlines =addline(parallelPort,0:7,'in');(or, addline(dio,0:7,{'in','in','in','in','out','out','out','out'});

Line specification is as per our requirement.

We can write or read value to the port as follows:

Write:val=12putvalue(parallelPort,val)

Read:valbin=getvalue(parallelPort)% it is binary vectorval=binvec2dec(valbin)

MATLAB also has facility to implement atimer.Suppose we need to monitor the value atport every 5 seconds for 1hour duration.

portTimer.mparallelPort =digitalio('parallel',’LPT1’);addline(parallelPort,0:7,'in');set(parallelPort,'TimerFcn',@findvalue);set(parallelPort,'TimerPeriod',5.0);start(parallelPort)pause(60)delete(parallelPort)clear parallelPortfindValue.mfunction y=findsum(obj,event)%find sum of array;val=getvalue(obj)

Serial port

Serial ports consist of two signal types: datasignals and control signals. To support thesesignal types, as well as the signal ground, theRS-232 standard defines a 25-pin connection.However, most PC's and UNIX platforms use a 9-pin connection. In fact, only three pins are

required for serial port communications: one forreceiving data, one for transmitting data, and onefor the signal ground. The logic level for serialport is defined by RS 232 standard and is notTTL compatible.

The serial data format includes one start bit,between five and eight data bits, and one stopbit. Usually there is one serial port at the rearpart of computer with label COM1 and address03F8 in hex. To display all properties and theircurrent values:

s = serial('COM1');get(s)

Before you can write or read data, both the serialport object and the device must have identicalcommunication settings. Configuring serial portcommunications involves specifying values forfollowing properties:

s = serial('COM1');%create a serial port objectset(s,'BaudRate',19200)%configuring port for its baud ratefopen(s)%connect to the device connected tothe port%reading data and%writing datafclose(s)delete(s)clear s

We can write a binary data using fwrite function.

We can read a binary data using fread function.

We can write a text using fprintf function.

We can read a text using fscanf function.

Page 34: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

30 ZERONE 2010

Photovoltaic (PV) system converts sunlightinto electricity. Sunlight energy generatesfree electrons in a semiconductors device

to produce electricity.The sun supplies all theenergy that drives natural global systems andcycles. Each wavelength in the solar spectrumcorresponds to a frequency and an energy; shorterthe wavelength, higher the frequency and greaterthe energy. The great majority of energy is in thevisible region (wavelength range from about 0.2µmto 4µm). An average of 1367w of solar energystrikes each square meter of the Earth’s outeratmosphere. Although the atmosphere absorbsand reflects this radiation, a vast amount stillreaches the Earth’s surface. The amount ofsunlight striking the Earth varies by region,season, time of day, climate and measure of airpollution. The amount of electricity produced byPV devices depends on the incident sunlight andthe device efficiency.

Characteristics of PV system:

• They rely on sunlight.

• They generate electricity with little impact onthe environment.

• They have no moving parts to wear out.

• They are modular, which means they can bematched to a need for power at any scale.

• They can be used as independent powersources, or in combinations with other sources.

• They are reliable and long-lived.

• They are solid-state technology and are easilymass-produced and installed.

Knowing how the PV effect works in crystallinesilicon helps us understand how it works in all

PhotovoltaicDipendra Kumar Deo

062 Electronics

Sun with solar cell

Page 35: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 31

Contemporary Technologies

devices. All matters are composed of atoms.Positive protons and neutral neutrons comprise

the nucleus of the atom. Negative electrons lie inthe orbits which are at different distancesdepending on their energy levels. Outermost orvalence electrons determine the way solidstructures are formed. Four of silicon’s 14electrons are valence electrons. In a crystallinesolid a silicon atom share each of its four valenceelectrons with four valence electrons of othersilicon atom. Light of sufficient energy candislodge an electron from its bond in the crystal,creating a hole. These negative and positivecharges (free electrons and holes) are theconstituents of electricity. PV cells contain an

electric field that forces free negative and positivecharges in opposite directions, driving an electriccurrent. To form the electric field, the siliconcrystal is doped to alter the crystal’s electricalproperties. Doping the crystal with phosphorusadds extra, unbounded electrons to the crystal,producing n-type material. Doping the crystal withboron leaves holes (bonds missing electrons actas possible charges) in the crystal, producing p-type material. In p-type material, holes, whichare more numerous than free electrons, are themajority charge carriers. In n-type material, free

electrons, which are more numerous than holes,are the majority charge carriers. The majoritycarriers respond physically to an electric field.When n-type and p-type material come in contact,an electric field forms at the junction (known asp-n junction). Once the materials are in contact,the majority carriers diffuse across the junction.This creates (in the immediate vicinity of the

junction) excess electrons on the p-side and excessholes on the n-side. At equilibrium there is a netconcentration of opposite charges on either sideof the junction, which creates an electric fieldacross the junction. Photons absorbed by a cellcreate electron-hole pairs. The electric field attractsphoto generated minority carriers across theinterface and repels photo generated majoritycarriers. This sorting out of the photo generatedelectrons and holes by the electric field are whatdrive the charge in an electric circuit. Attachingan external circuit (eg: bulb) allows electrons toflow from the n-layer through a load and back tothe p-layer. The band-gap energy is the amountof energy required of a photon to move an electron

from valence band to conduction band. Band-gapenergies of PV material range from about 1 to3.33eV; crystalline silicon’s band-gap energy is1.1eV. Photons with too light energy pass throughthe material or create heat; photons with too muchenergy create charge carriers, but also heat up thecell. Material with lower band-gap energies createsgreater current: material with higher band-gapenergies have higher voltages. The electric powerproduced by a PV cell is I*V, the product of thecurrent and voltages.

The PV cell is the basic unit in a PV system. Anindividual PV cell typically produces between 1and 2W, hardly enough power for the greatmajority of applications. But the power can beincreased by connecting cells together to formlarger units called modules. Modules, in turns,can be connected to form even large units knownas arrays, which can be interconnected for more

Cell, Module, Array

Page 36: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

32 ZERONE 2010

power, and so on. In this way, PV system can bebuilt to meet almost any power need, no matterhow small or great.

This can be implemented in the Grid system, asthe grid connected photovoltaic power system isconnected to the commercial electric grid. Theseare generally small and 3kW for private resistance,20kW for multiple dwelling, 100-200kW forschool and factories. The operation of such systemis based on the principle of feeding power in togrid when the solar generation exceeds the load

demand (during day time) and taking power fromthe grid during the night.

These systems do not require storage of energybut require additional components to regulatevoltage, frequency, and waveform to meet thestringent requirements of feeding the power intothe grid.

Application of photovoltaic systemTelecommunications: The power consumptionof telecommunication equipment has considerablyreduced due to use of solid devices. Transmittersand relays stations now consume 50-100W. Thesestations are often located in remote and difficultto access areas like mountain tops and deserts.

Cathodic protection: Various metallic structureslike pipe lines, well heads, bridges etc. areprotected from corrosion by cathodic protectionsystem. In this technique a small direct current isimpressed on the structure at regular intervals toprevent electrochemical corrosion. Small PVpanels may be used to provide this current veryefficiently.

Navigational aids: Marine beacons andnavigational lights on buoys around the worldare now-a-days being powered reliably and costeffectively by simple PV generators, which wereearlier powered by kerosene or batteries withseveral maintenance problems.

Remote aircraft beacons: Remote radio andbeacons near the airports may be poweredeconomically by solar PV. One of the earliestexamples of powering light beacons by PV is sevenmountain peaks near Medina airport in SaudiArabia.

Alarm systems: PV systems are beings used topower railway signals, alarm system, fog, fire andflood hazard warning, traffic lights and highwaytelephones.

Automatic meteorological stations: For preciseweather forecasting it is necessary to collectmeteorological at fixed time of intervals at severallocations and then transmit them to a weatherstations for analysis. Solar powered meteorologicalstations are reliable, economical and relatively freeof maintenance problems.

Defence equipment: Many defence equipmentslike mobile telephones, remote instrumentations,radar, water purifier etc may be effectivelypowered by PV.

Emergency equipment: Battery charging on lifeboats and rafts. Providing essential services afterearthquakes, floods and other natural disastersmay be done efficiently by PV system. Providingelectric power to remote villages and islandsspecially in developing countries by PV systemswhere large number of villages remainunconnected to main grid.

Set of arrays of solar cell

Set of arrays of solar cell in each roof of house

Page 37: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 33

Contemporary Technologies

Electromagnetic interference (EMI), alsotermed as radio frequency interference (RFI),is any undesirable electromagnetic emission

or any electrical or electronic disturbance, man-made or natural, which causes an undesirableresponse, malfunctioning or degradation in theperformance of electrical equipment. Thedisturbance may interrupt, obstruct, or otherwisedegrade or limit the effective performance of thecircuit. The source may be any object, artificial ornatural, that carries rapidly changing electricalcurrents such as an electrical circuit, the Sun orthe Northern Lights. Radiated RFI is most oftenfound in the frequency range from 30MHz to10GHz.

TypesEMI can broadly be divided into two types:narrowband and broadband.

Narrowband interference : arises fromintentional transmissions such as radio and TVstations, pager transmitters, cell phones, etc.

Broadband interference: arises from incidentalradio frequency emitters which include electricpower transmission lines, electric motors,thermostats, microprocessors, etc. Anywhereelectrical power is being turned off and on rapidlyis a potential source. The spectra of these sourcesgenerally resemble to that of synchrotron sources,stronger at lower frequencies and diminishing athigher frequencies, though this noise is oftenmodulated, or varied, by creating device in someway. These sources include computers and otherdigital equipments such as televisions, mobilesetc. The rich harmonic content of these devicesmeans that they can interfere over a very broadspectrum. Characteristic of broadband RFI is aninability to filter it effectively once it has enteredthe receiver chain.

EMI in ICsICs are often a source of EMI, but they mustusually couple their energy to larger objects suchas heatsinks, circuit board planes and cables toradiate significantly.On ICs, EMI are usuallyreduced by usage of bypass or decouplingcapacitors on each active device, rise time controlof high speed signals using series resistors, andpower Vcc filtering. However, shielding is a lastoption after all other techniques have failed.

At lower frequencies, radiation is almostexclusively via input/output cables; RF noise getsonto the power planes and is coupled to the linedrivers via the VCC and ground pins. The RF isthen coupled to the cable through the line driveras common mode noise. Common Mode Noise isa noise signal which is found in phase on boththe line and neutral conductors with respect toground. Common mode noise also typically hasequal amplitude on both line and neutralconductors. So, one of the ways to deduce itseffect is to use choke or braid-breaker.

At higher frequencies, traces get electrically longerand higher above the plane. So, two techniquesare used: wave shaping with series resistors andembedding the traces between two planes. Even

ElectrElectrElectrElectrElectromagnetic Interferomagnetic Interferomagnetic Interferomagnetic Interferomagnetic InterferenceenceenceenceenceRupendra Maharjan

062 Electronics

Electromagnetic interference

Page 38: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

34 ZERONE 2010

if these measures can’t reduce EMI to thepermissible level, shielding technique such as RFgadgets and copper tape can be used.

Necessity of regulation of EMIBecause these EMIs are unwanted potentials, theyare regulated to allow today’s sensitive equipmentto function properly without suffering degradationin performance due to interference generated byother electronic devices. The EMI spectrum is alimited natural resource that must be maintainedto allow reliable radio frequency communications.The successful regulation of EMI will allow futureelectronic devices to operate as defined, in theintended environment, without suffering anydegradation in performance due to interference,and without disrupting the performance of otherequipment.

EMI filterAn EMI filter is a passive electronic device usedto suppress conducted interference present onany power or signal line. It may be used tosuppress the interference generated by the deviceitself as well as to suppress the interferencegenerated by other equipment to improve theimmunity of a device to the EMI signals presentwithin its electromagnetic environment. Most EMIfilters include components to suppress bothcommon and differential mode interference. Filterscan also be designed with added devices toprovide transient voltage and surge protection aswell as battery backup.

An EMI filter has a high reactive component toits impedance. That means the filter looks like amuch higher resistance to higher frequencysignals. This high impedance attenuates or

reduced the strength of these signals so they willhave less of an effect on other devices.

1. http://en.wikipedia.org

2. http://www.jmk.filters.com

3. http://www.pcguide.com

4. http://searchmobilecomputing.techtarget.com/sDefinition/0,,sid40_gci213940,00.html

References

Use The Best...Linux for Servers

Mac for Graphics

Palm for Mobility

Windows for Solitaire

- T-Shirt

The Horror, The Heartbreak:Facebook is under major revision. The site will be onlineafter few weeks

Credit: Ruchin Singh

ruchin 2010

Page 39: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 35

Contemporary Technologies

The world changed tremendously over thelast 10-20 years as the result of the growthand maturation of the internet and

networking technologies in general. Twenty yearsago, no global network existed to which thegeneral population could easily connect. Ten yearage, the public internet had grown to the pointwhere people in the most part of the world couldconnect to him Internet. Today, practicallyeveryone seems to have access, through their PCs,handheld devices and phones.

The original design for the Internet requiredunique IP addresses that are connected in network.The people administrating the program ensure thatnone of the IP address was reused. Internet wasgrowing so fast that there arises the lack of IPaddress.

Its reality that number of people and devices thatget connected to networks increase each and everyday. That’s not a bad thing at all- we are findingnew and exciting way to communicate to morepeople all the time, and that’s good thing. Infact,it’s a basic human need.

IPv4 has only about 4.3billions addressesavailable- in theory, andwe know that we don’teven get to use all ofthose. There really areonly about 250 millionaddresses that can beassigned to devices.China is barely online,and we know thatthere’s a hugepopulation of peopleand corporations therethat surely want to be.Moreover, it’s estimatedthat just over 10% ofpopulation is connectedto internet.

The above statistics revels the ugly truth of IPV4’scapacity. So, we have to do something before werun out of addresses and lose the ability to connectwith each other.

The main long term solution was to increase thesize of IP address. So, IPV6 came. The problemis that most of the Cisco’s router and switchesthat are using in IPV4 do not support IPV6. XPdoesn’t support IPV6. Even most of ISPs doesn’thave sufficient infrastructure to support IPV6. ForIPV6, it must have hardware support and softwaresupport.

Many short term solutions to the addressingproblem were suggested. Some of them arediscussed here:

1. Dual stackingThe term dual stacks mean that the host or routersuses both IPV6 and IPV4 at the same time. Hostshave both IPV4 and IPV6 addresses. This meansthat host can send IPV4 packets to other IPV4hosts and that the host can send IPV6 packets toother IPV6 hosts.

Configuration of dual stack:

MIGRATION TO IPV6Mithlesh Chaudhary

062 Electronics

Page 40: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

36 ZERONE 2010

R (config) #ipv6 unicast-routingR (config) #interface fast Ethernet

0/0R (config_if) #ipv6 addresses

2001:db8:3c4d:1::/64 eui-64R (config-if) #ip address

192.168.255.2 255.255.255.0

2. TunnelingTunnel function is generally to take IPV6 packetsent by a host and encapsulates it inside an IPV4packet. The IPV6 packets can then be forwardover an existing IPV4 internetwork. The otherdevice then removes the IPV4 header, reveling theoriginal IPV6 packet.

Fig shows IPV6 to IPV4 (6 to 4) tunnel (meaningIPV6 inside IPV4).

In the fig, we need two encapsulates or tunnelthe IPV6 packet into new IPV4 header, withdestination address (IPV4) of router R4.R2 and R3 easily forward the packet, whileR4 de-encapsulates the original IPV6packets, forwarding it to IPV6 pc2.

Configuration 6 to 4 tunnelingRouter1 (config) # int tunnel 0Router1 (config-if) #ipv6

address 2001:db8:1:1::1/64Router1 (config-if) #tunnel

source 192.168.30.1Router1 (config-if) #tunnel

destination192.168.40.1Router1 (config-if) #tunnel

mode ipv6ipRouter2 (config) #int tunnel 0

Router2 (config-if) #ipv6address 2001:db6:2:2::1/64Router2 (config-if) #tunnelsource 192.168.40.1Router2 (config-if) #tunneldestination 192.168.30.1Router2 (config-if) #tunnelmode ipv6ip

3. Network AddressTranslation (NAT)NAT is the protocols that are used toreduce the demands of number ofipv4.NAT function changes the privateIP addresses to publicly registered IPaddresses inside each packet. Router(performing NAT), changes the packet’s

source IP address when packet leaves the privateorganization. The router (performing NAT) alsochanges the destination address in each packetthat is forwarded back into private network. CiscoIOS software supports several variations of NAT.

There are generally three types of NAT:

a. Static NAT

b. Dynamic NAT

c. Port address translation (PAT)

a. Static NATIt is one to one mapping of IP address i.e. theNAT router simple configures a one to onemapping between private address and registeredaddress.

IP V4 Network

Internet

Page 41: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 37

Contemporary Technologies

The design concern of NAT is to save the IPaddress.So, if we use one to one function of insidelocal and global than Nat aim can’t be archived.

Static NAT configuration

Router (config) #ip Nat inside sourcestatic 192.168.10.2 202.16.52.140

Router (config) #int f0Router (config-if) #ip Nat insideRouter (config) #int S0Router (config-if) #ip Nat outside

Here 192.168.10.2 is inside local address and202.16.52.140 is inside global address.Also, f0 isthe inside interface and S0 is outside interface.After creating the static NAT entries, the routerneeds to know which interfaces are “inside” andwhich interfaces are “outside”. The ‘ip Nat inside’and ‘ip Nat outside’ interface subcommandsidentify each interface appropriately.

b. Dynamic NATLike static, Dynamic NAT also creates a one toone mapping between inside local and insideglobal address. However, mapping of an insidelocal address to an inside global address happensdynamically.

Dynamic NAT sets up a pool of possible insideglobal address and defines matching criteria todetermine which inside local IP addresses shouldbe translated with NAT.

Nat can be configured with more IP addresses inthe inside local address list than in inside globaladdress pool. If all the ip address of the NATpool are in used and if at this time, new packetarrive at router, the router simply discards thepacket. The user must try again until there wouldbe an ip address in NAT pool.

Dynamic NAT configuration

Dynamic NAT configuration requires identifies aseither inside or outside interface. It uses an accesscontrol list (ACL) to identify which inside localIP address need to have their address translated.

Router (config) #int F0Router (config-if) #ip Nat insideRouter (config) #int S0Router (config-if) #ip Nat outsideRouter (config) # access-list 1

permit 192.168.10.0 0.0.0.255

Router (config) #ip Nat pool ioe202.16.52.140 202.168.52.149netmask 255.255.255.0

Router (config) #ip Nat inside sourcelist 1 pool ioe

c. Port address translation (PAT)Dynamic NAT lessens the problem of static NATby some degree because every single host in aninternet work should seldom need tocommunicate with the internet at the same time.However, large percent of IP hosts in a networkwill need Internet access throughout thatcompany’s in normal business hours. So the NATstill requires a large number of registered IPaddresses, again failing to reduce ipv4 addressconsumption.

When PAT creates the dynamic mapping, it selectsnot only an inside global IP address but alsounique port number. The NAT router keeps aNAT table entry for every unique combination ofinside global address and a unique port numberassociate with the inside global address. Andbecause port number field has 16 bits, NAToverload can use more than 65,000 port numbers,allowing it to scale well without needing manyregistered IP addresses.

Port address translation (PAT)configuration

Router (config) #int F0Router (config-if) #ip Nat insideRouter (config) #int S0Router (config-if) #ip Nat outsideRouter (config) # access-list 1

permit 192.168.10.0 0.0.0.255Router (config) #ip Nat pool ioe

202.16.52.140 202.168.52.149netmask 255.255.255.0

Router (config) #ip Nat inside sourcelist 1 pool ioe overload

For PAT, we generally need only oneIP address in the pool. For this,we have a command:

Router (config) #ip Nat pool ioe170.168.2.1 170.168.2.1 netmask255.255.255.0

Note that for ip pool we use global address andfor access-list we use local address.

Page 42: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

38 ZERONE 2010

Many of us are already familiar withmagnetic stripe cards. The most visibleform of their use is bank (credit, debit,

and ATM) cards, but these can find applicationsin many places such as identity cards, librarycards and transportation tickets. This articleintends to introduce magnetic stripe cards andoutline their physical and technical aspects inbrief.

A magnetic stripe card containsa black or brown stripe madefrom tiny iron-based magneticparticles in a resin. Digital datais stored in the stripe bymagnetizing the particles as indigital tape storage. The magnetic stripe,sometimes called a magstripe, is read by physicalcontact by swiping past a reading head or insertingit in a reader. They can be manufactured byvarious techniques which depend on therequirements such as durability, cost, etc.

It is said that the first use of magnetic stripes oncards was in the early 1960’s when LondonTransit Authority installed a magnetic stripesystem in the London underground (UK). By thelate 1960’s BART (Bay Area Rapid Transit) (USA)had installed a paper based ticket the same size

as the credit cards we use today. This system useda stored value on the magnetic stripe which wasread and rewritten every time the card was used.

SpecificationThe magnetic stripe is located ~6 mm from theedge of the card, and is ~10 mm wide. Themagnetic stripe contains three tracks, each ~2.8

mm wide. Tracks 1 and 3are typically recorded at 210bits per inch (8.27 bits permm), while track 2 typicallyhas a recording density of75 bits per inch (2.95 bitsper mm).

How information is encodedEach character that is encoded on the stripe ismade of a number of bits. The polarity of themagnetic particles in the stripe is changed to defineeach bit. Several schemes exist to determinewhether each bit is a 1 or a 0, the most commonlyused schemes are F2F (or Aiken Bi-Phase) andMFM (Modified Frequency Modulation).

The ISO/IEC 7811 standards specify F2Fencoding. In this encoding, each bit has the same

physical length on the stripe.The presence or absence of apolarity change in the middleof the bit dictates whether it isa 1 or a 0. The width of a singlebit always remains the samebut some bits have an extrapolarity change in the middleand these are called 1s.

MFM encoding is morecomplicated. This type ofencoding allows twice as muchdata to be encoded with thesame number of flux reversals(edges). Once the encodingscheme is chosen, the format

Magnetic Stripe CardsPushkar Shakya063 Computer

“Digital data is stored in thestripe by magnetizing theparticles as in digital tape

storage.”

Magnetic stripe cards

Page 43: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 39

Contemporary Technologies

of the data must be selected. ISO/IEC 7811specifies two different schemes for use oninterchange cards (such as bank cards). These arefour bits plus parity and six bits plus parity. Thefour bits allow only the encoding of numbers plussome control characters, the use of six bits allowsthe full alpha numeric set to be encoded. Theparity bit is used to helpdetermine if an erroroccurred in the readingof the data. The totalnumber of 1s in acharacter is added up;in odd parity this mustequal an odd number.If the total is odd, the parity bit is set to a 0, if thetotal is even the parity bit is set to a 1.

Magnetic stripe coercivityMagnetic stripes come in two main varieties: high-coercivity (Hi-Co) at 4000 Oe (Oersted) and low-coercivity (Lo-Co) at 300 Oe but it is not infrequentto have intermediate values at 2750 Oe. High-coercivity magnetic stripes are harder to erase, andtherefore are appropriate for cards that arefrequently used or that need to have a long life.Low-coercivity magnetic stripes require a loweramount of magnetic energy to record, and hencethe card writers are much cheaper than machineswhich are capable of recording high-coercivitymagnetic stripes. A card reader can read eithertype of magnetic stripes; the case may not be thesame for card writers, however. High coercivitystripes are resistant to damage from most magnetslikely to be owned by consumers and problemsof accidental erasure are diminished. Lowcoercivity stripes are easily damaged by even abrief contact with a magnetic purse strap orfastener. Because of this, virtually all bank cardstoday are encoded on high coercivity stripesdespite a slightly higher per-unit cost. Usuallylow-coercivity magnetic stripes are a light browncolor, and high-coercivity stripes are nearly black.

The material used to make the particles definesthe Coercivity of the stripe. Standard lowcoercivity stripes use iron oxide (Gamma FerricOxide) as the material to make the particles andthe particles are acicular (needle shaped) with anaspect ratio of approximately 6 to 1. The acicularparticles have an easy axis of magnetization alongthe length of the particle which makes thealignment an easy process. High coercivity stripesare made from other materials like Barium Ferrite.

The particles used in most of these materials arenot acicular, they are platelets. These platelets havean easy axis of magnetization through the plate,which means the alignment field has to stand theparticles on edge and they have to stay that wayto get the best performance from the stripe.Obviously the particles want to fall over as soon

as the field is removedfrom the stripe so part ofthe skill in making a highquality stripe lies indesigning a process thatcan keep those particleson their side.

As explained above, the stripe is made from manysmall particles bound together in a resin. Thedensity of the particles in the resin is one of thecontrolling factors for the signal amplitude. Themore particles there are, the higher the signalamplitude; and it should not be related to materialcoercivity. Signal amplitude is important becauseit defines the design of the readers for the cards.Standards exist (ISO/IEC 7811) which defines thesignal amplitude for cards that are used in theinterchange environment. By conforming to thesestandards, a user ensures that the magnetic stripecan be read in any financial terminal worldwide.It also makes the range of available readers muchgreater.

Magnetic stripe track formats:ISO/IEC 7813There are three tracks on magnetic cards used forfinancial transactions.

Track 1It is 210 bits per inch (bpi), and holds 79 six-bitplus parity bit read-only alphabetic characters andhence is the only track that contains thecardholder's name. The information on track 1on financial cards is contained in several formats:A, which is reserved for proprietary use of thecard issuer, B, which is described below, C-M,which is reserved for use by ANSI SubcommitteeX3B10 and N-Z, which are available for use byindividual card issuers:

Format B:

• Start sentinel — one character (generally '%')

• Format code="B" — one character (alphabet only)

“The acicular particles have an easy axisof magnetization along the length of the

particle which makes the alignment aneasy process.”

Page 44: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Contemporary Technologies

40 ZERONE 2010

• Primary account number (PAN) — up to 19characters. Usually, matches the credit cardnumber printed on the front of the card.

• Field Separator — one character (generally '^')

• Country code - 3 characters

• Name — 2 to 26 characters

• Field Separator — one character (generally '^')

• Expiration date — four characters in the form YYMM.

• Service code — three characters

•Discretionary data — enough characters to fillout maximum record length (79 characters total)

• End sentinel — one character (generally '?')

• Longitudinal redundancy check (LRC) — onecharacter (a form of computed check character)

LRC is a validity character calculated from otherdata on the track. Card readers use it only to verifythe input internally.

Track 2It has 75 bpi, and holds 40 four-bit plus paritybit characters. This format was developed by thebanking industry (ABA). This track is written witha 5-bit scheme (4 data bits + 1 parity), whichallows for sixteen possible characters, which arethe numbers 0-9, plus the six characters (: ; < => ?). The data format is as follows:

• Start sentinel — one character (generally ';')

• Primary account number (PAN) — up to 19characters. Usually, matches the credit cardnumber printed on the front of the card.

• Separator — one char (generally '=')

• Country code -- 3 characters

• Expiration date — four characters in the formYYMM.

• Service code — three characters

• Discretionary data — as in track one

• End sentinel — one character (generally '?')

• LRC — one character

Track 3It has 210 bpi, and holds 107 four-bit plus paritybit characters and the standards were created bythe Thrift-Savings industry.

Credit cards typically use only tracks 1 and 2.Track 3 is a read/write track (that includes anencrypted PIN, country code, currency units,amount authorized), but its usage is notstandardized among banks and is virtuallyunused.

SecurityMagnetic stripes are not inherently secure. Theproblem with being easy to manufacture andencode is that it also makes it easy for the crooksto do the same. Several schemes are available forcreating a secure encoding on a magnetic stripe,Watermark Magnetics, XSec, Holomagnetics,XiShield, Jitter Enhancement, ValuGard, andMagnePrint are a few. Each of these technologiesexploits some aspect of the magnetic stripe, thecard, and the data on the stripe to tie everythingtogether to make counterfeiting the card in somefashion very difficult. They use different means -ValuGard uses the inherent signal amplitudeproperties of the stripe, Watermark Magnetics usesa special magnetic stripe, and XSec uses theinherent jitter properties of the stripe. What allthis means is that the actual piece of magneticstripe can be tied to the encoding to prevent fraud.

ConclusionMagnetic stripe technology is being used in manyfields. Magnetic stripe technology provides theideal solution to many aspects of our life. It isvery inexpensive and readily adaptable to manyfunctions. This coupled with the advent of thesecurity techniques now available means thatmany applications can expect to be using magneticstripe technology for a long time.

1. http://en.wikipedia.org/

2. http://www.hightechaid.com/

3. http://www.howstuffworks.com/

References

Page 45: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 41

Robotics

Introduction

The world around us is exploring new horizonsof technology in ever-accelerating pace, especiallyin embedded systems, computer and automation.While embedded platforms are an attractive optionto learn and implement new technologies, mostfreshmen and sophomore engineering studentsdo not have acquired sufficient skills tounderstand and use the complex developmenttools needed to program these platforms. Therehas been increasing number of ill-preparedstudents enrolled to engineering courses, whoneither have the required pre-requisites from theirintermediate level/school courses, nor do theyknow much about their field of interest [1].

To ensure that we produce qualified engineers,not only theoretically but practically as well,activity based technology curriculum is neededat the school level as well as early engineeringcourses to give students an insight intoengineering fields and attract students totechnology studies [2]. As opposed to thetraditional education approach, technologycurriculum should be more practice oriented andactivity based. Therefore, new approaches areneeded to design and implement high qualitytechnology program at beginning of theirengineering career.

Robotics, being a multifaceted representation ofmodern science and technology, fits into thisplanning perfectly. Robotics is defined as anintelligent connection between the perception andaction [3]. It is an engineering art combingelectrical and mechanical technologies. It iswidely used nowadays and has been part of ourdaily life. In the industrial area, robots are widely

“““““MMMMMy Fy Fy Fy Fy Fiririririrssssst Ht Ht Ht Ht Humumumumumaaaaannnnnoooooiiiiid Rd Rd Rd Rd Rooooobbbbbooooottttt”””””

Bikram AdhikariDOECE, Pulchowk Campus

Abstract: As the world around is becoming overwhelmed with sophisticated embedded gadgets androbots, it is indispensable to create enthusiasm among students about embedded systems and robotics intheir early career. While embedded platforms are an attractive option to learn and implement newtechnologies, most freshmen and sophomore engineering students do not have acquired sufficient skillsto understand and use the complex development tools needed to program these platforms. Students needsimpler and spontaneous environment to experiment their creativity and apply basic engineering concepts.Sharing an experience of building a humanoid robot with LEGO Mindstorms NXT ® this paper presentsLEGO Mindstorms Kit as a useful tool for freshman and sophomore to learn robotics and embeddedsystems.

An Experience worth Sharing with Freshmen and Sophomore

Index Terms: LEGO Mindstorms, Robotics, Embedded Systems

RoboticsRoboticsRoboticsRoboticsRobotics

Figure 1. Integrated STEM areas

MMMMMathematics SSSSScience

EEEEEngineering TTTTTechnology

Page 46: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

used to increase productivity and henceproduction capacity.

It is an excellent way to introduce the studentsto integrated areas of science, technology,engineering and mathematics (STEM) [1].However, due to the complexity of roboticsstudies, it is hard to attract and pass theknowledge to students[2].

This paper, presents the comparative analysis ofLEGO Mindstorms NXT with traditional learningapproach and its capabilities to be an interactiveplatform for school students as well as freshmanand sophomore engineering student to learnembedded systems and robotics using simplemechanical parts and graphical software.

LEGO mindstorms

The Lego Mindstorms Kit is a set of robotics forthe educational area, which lets you create andprogram robots, using simple mechanical parts,in order to perform simple and complex tasks.The kit consists of mounting blocks, motors,sensors, and a microprocessor is the brain of thesystem [4].

LEGO NXT brick

Figure 3 shows the block diagram of LEGOMindstorms NXT “brick”. Its central processoris a 32-bit Atmel ARM7 processor with 256KBFlash, 64KB RAM operating at 48 MHz. It has100 × 64 pixel LCD graphical display and 8-bitresolutions sound channel. The brick can beprogrammed with Bluetooth radio and can storemultiple programs which can be selected usingbuttons [4].

From a freshmen or sophomore point of view, toprogram such a system by conventionaltechniques would require a knowledgechallenging toolchain. Another fact to ponder isthis “toy”, as said by LEGO, is suitable for kidsfrom ages 8 and above. With these twocontradictions, LEGO introduces a differentapproach to programming these systems that focusmore on the concept implementation and less onbit-level operations.

LEGO mindstorms NXT software

As mentioned in the previous section,programming the NXT brick by 8 years old andsubsequently freshman and sophomoreengineering students needs a noble approachprimarily because of the limited skill set of thestudents. The LEGO Mindstorms NXT kitprovides a wonderful software developmentplatform that can be used to program the brickwithout having any prior knowledge of

Figure 3. Block diagram of LEGO Mindstorms NXTBrick [5]

Figure 2. LEGO Mindstorms Education Base Set [4]

Page 47: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 43

Robotics

programming. Figure 4 shows an example of aprogram that is written in this Mindstorms NXTsoftware [6].

Since the program is in completely graphicalmode, this helps the students to focus more ondesign aspect rather than starting with basic butcomplicated phase of learning new tools andassociated abstract syntaxes. Another importantfeature of graphical programming is parallelprogramming which is inherently hard to conceptto teach with traditional approach. Theparameters associated with a block can be easilyconfigured at the bottom of the screen itself. Thissoftware also exposes some key embeddedconcepts such as memory and resourcemanagement in a fun environment.

LEGO sensors and motors

Figure 5 shows a range of sensors and motorsfor LEGO brick. LEGO Mindstorms NXT 2.0

comes with two touch sensor, one ultrasonicsensor for measurement of distance ranging from5cm to 250cm, one microphone and one colorsensor that can identify fifteen different colors.These sensors can be easily calibrated usingsimple calibration program within the software[4].

There are three dc motors with tachometerfeedback built-in to provide a robust position andvelocity response.

LEGO building blocks

Using traditional learning approach, studentsfind it ominously challenging and daunting tobuild all the basic parts of a robot from scratch.Freshmen and sophomore find it very difficult

and costly to learn with traditional approach. WithLEGO Mindstorms, the physical structure ofrobot or other mechanical framework can be builtwith LEGO building blocks without anyrequirement of costly and sophisticated workshopand tedious labor. There are various LEGObuilding instructions to assemble a range of robotson the official LEGO website [4]. Figure 4 showsbuilding instruction of a part of LEGO Humanoidrobot’s leg.

My first LEGO humanoid robot

Making a robot is not an easy task. The knowledgeof robotics and automation is not acquired byturning the pages of lecture notes and submittingweekly assignments. Making a complete systemfully working takes a lot of effort, knowledge andperseverance. In addition, the challenge issurmounted by unavailability of equipments thatnecessitate development from scratch. Forbeginners, robotics is an incredibly daunting fieldto get into.

Figure 4. LEGO Mindstorms NXT Software [4]

Figure 5. LEGO Mindstorms NXT Sensors and Motors [4]

Figure 6. LEGO Mindstorms Building Instruction

Page 48: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

44 ZERONE 2010

Robotics

Recently, I built a humanoid robot, my childhooddream, using LEGO Mindstorms NXT. With mynerve wrecking prior experiences of buildingsimple, yet complicated to build, robots, I wasastounded to see myself building a humanoidrobot effortlessly. Following the buildinginstructions and using drag and dropprogramming environment was just so simple.Finally the robot walked up to me and said,“Hello!!!” It was a wonderful experience.

Atthemean

time, I had a flash back into my past roboticexperiences. I don’t remember making a robotwithout using a multimeter or soldering iron, orgoing through lumps of datasheets, or ponderingin front of oscilloscope wondering, “Why is there500mV spike in the signal?” More than 80% ofthe time was spent on development offundamental parts of the robot. Major portion ofmechanical job was to work for hours and hoursin lathe machine to make shafts, bushes andwheels. As a beginner in robotics, I spent hoursand hours going through datasheets and surfingthe internet to discover some basic principles andtechniques. When I was making this humanoidrobot, I laughed at my silly mistakes in the pastand realized how easy and effective would it hadbeen if I had an opportunity to use this kit as asophomore. I don’t say that all that I went through

was useless. It is important to have a strongfoundation, be able to accomplish everysingle piece of work oneself and acquire in-depth knowledge of engineering but LEGOMindstorms can be the right point to takeoff.

LEGO Mindstorms can turn out to be anexceptional platform for a variety of researchpurposes. Especially designed for studentsfrom age group 8 years and above this uniqueplatform integrates the key traits of activitybased learning. Not only robotics, thisextremely powerful platform can be used asa base platform to start learning programmingand embedded systems. To understand andimplement various mechanisms without

having to go to a workshop may tow mechanicalstudents to use this kit as well.

Conclusion

In this paper, LEGO Mindstorms NXT has beenpresented as an indispensable tool to introduceembedded systems and robotics to schoolstudents, freshmen and sophomore engineeringstudents.

Many students find early courses in engineeringto be abstract, narrowly focused along withrigorous mathematics. Platforms like LEGOMindstorms are compact, cost effective and simplepackages that provide flexibility in design anddevelopment of robots and other embeddedsystems without having to worry about complexdevelopment tools. Such a platform helps inencouraging creativity and enables students toabsorb concepts effectively.

Figure 8. LEGO Humanoid Robot Experience

Figure 7. Mindstorms NXT Humanoid Robot

Page 49: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

(2) Kin W. Lau, Heng Kiat Tan, Benjamin T.Erwin, Pave1 Petrovic, Creative Learning inSchool with LEGO® Programmable RoboticsProducts, 29th ASEE/IEEE Frontiers inEducation Conference, 1999

(3) Lady Daiana O. Maia, Vandermi J. da Silva,Ricardo E. V. de S. Rosa, Jose P. Queiroz-Neto, Vicente F.de Lucena Jr., An Experienceto use Robotics to Improve Computer ScienceLearning, 39th ASEE/IEEE Frontiers inEducation Conference, 2009.

(4) LEGO official website

http://www.lego.com

(5) LEGO MINDSTORMS NXT HardwareDevelopers

http://mindstorms.lego.com/Overview/NXTreme.aspx

(6) LEGO MINDSTORMS NXT Software,

http://mindstorms.lego.com/press/2057/Mindstorms%20Software%20Announcement.aspx

References

(1) Tanja Karp, Richard Gale, Laura A. Lowe,Vickie Medina and Eric Beutlich GenerationNXT: Building Young Engineers with LEGOs,IEEE Transactions on Education, VOL 53 No.1, February 2010.

LEGO Mindstorms NXT can be used as aninstructional tool to bring students into areas thatare broad scoped, fun and challenging as well.Students can begin with simple robots andsuccessively proceed to sophisticated NXTcontroller, motors and sensors. Not just how touse these sensors and motors, students can alsolearn how they work so that they can attempt tomake their own sensors, interfaces, motor driversand eventually their own robot.

At school level, students are able to develop adeeper and broader understanding of the field ofengineering. Consequently, they are able to makea well informed decision when choosing their fieldof study.

Copyright 1996 Randy Glasbergeon www.glasbergen.com

Page 50: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Robotics

46 ZERONE 2010

Asignal may be presented in various ways.On one hand, we can study how a signalis varying in time, which is the case when

using an oscilloscope. The shape presented onan oscilloscope is produced by momentary valuesof the signal magnitude at different occasions. Thisprocedure is to study the signal in time domain.This kind of presentation is very useful whenstudying transient events represented by rise timeand fall time, as well as analyzing digital signalsto detect intermittent interference of theinformation.

This is however, not always a useful way torepresent information. For instance, if a largesignal with weak interference superimposed, theinterference may be hard to detect. Thus in sucha case spectral analysis method is moreappropriate to represent the signal where weusually represent the signal in frequency domain(instrument used for such frequency domainmeasurement is known as spectrum analyzer).Being my final year project topic, I want to brieflydiscuss why spectrum analysis is important? Andhow can we perform spectrum analysis?

What is spectrum?So what is a spectrum in the context of thisdiscussion? A spectrum is a collection of sinewaves that, when combined properly; producethe time-domain signal under examination. Figure1.1. shows the waveform of a complex signal intime domain. Suppose that we are hoping to seea sine wave. Although the wave form certainlyshows us that the signal is not a pure sinusoid, itdoes not give us a definitive indication of the

reason why. Figure 1.2. shows our complex signalin frequency domain. The frequency-domaindisplay plots the amplitude versus the frequencyof each sine wave in the spectrum. As shown,the spectrum in this case comprises just two sinewaves. We now know why our original waveformwas not a pure sine wave. It contained a secondsine wave, the second harmonic in this case whichwas difficult to determine in time domainmeasurement.

Prajay Singh Silwal062 Electronics

Project IdeasProject IdeasProject IdeasProject IdeasProject Ideas

Spectrum Analysis and its Benefits

Figure 1.1. Waveform of a complex signal in time domain,Figure 1.2. Complex signal in frequency domain

Page 51: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 47

How can we perform spectrumanalysis?

Fourier analysis tells us that any periodic signalmay be represented by a series of sine waves withvarying amplitudes, frequencies and phases. Iffiltering of the signal is possible, the spectralcomponents may be presented separated fromeach other. If the amplitude of each spectralcomponent is displayed versus the correspondingfrequency a spectral analysis is obtained, and eachspectral component can be studied independentlyof the oth

If we let our signal pass through a set of filtersconsisting of band pass filters, i.e., a filter bank(as shown in figure 2), and study the output signal

from different filters by means of an oscilloscope,one or more sinusoids signals will appear( firstsinusoid obviously being fundamental andremaining being harmonics). If on other hand, wechoose to present the signal in the frequencydomain via spectrum analyzer the signals will berepresented by vertical lines since each of themonly corresponds to a single frequency. The heightof a vertical line will represent the amplitude ofthe corresponding signal and the horizontalposition will represent the correspondingfrequency.

As in the case with the oscilloscope, we can readthe signal amplitude, but in spectrum analyzer itis also possible to read the amplitudes of allinterfering signals as well as the correspondingfrequencies. This feature facilitates to decide onthe origins of the interferences.

However while studying about interferencespresent in signal of radio frequency (few GHz),

where amplitudes of interferences are very small,not even the spectrum analyzer in linear scale willgive the convenient result. A linear display inthe frequency domain as well as in the time domainwill only show signals that are comparable in size,i.e., in the same order of magnitude.

If a signal contains interference in the order of 1/10000 of magnitude of the main signal, we canneither detect the disturbances nor analyze themor measure their magnitudes. For this reason, alogarithmic display is used where the amplitudesare presented in dBm, i.e., decibels in relation to1 mW.

P (dBm) =10*log (P/1mW)

Through this kind of display both harmonics anda spurious are clearly shown. The information ofthe signal is not all changed, but the way ofpresenting data will make all information moreaccessible. We can clearly see that the same signaldisplayed in different ways, viz. time-domainrepresentation and frequency-domainrepresentation, is giving access to differentinformation. The phase information, however,will be lost in frequency domain. The mostappropriate domain has to be chosen in eachspecific case. Some particular systems arespecifically frequency-domain oriented.

Applications

Engineers and scientists are looking for innovativeuses of RF technology since 1860’s. The radiohad become the first practical application of RFsignals. Over the next three decades, severalresearch projects were launched to investigatemethods of transmitting and receiving signals to

Figure 2. Working of a spectrum analyzer

P

Page 52: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

48 ZERONE 2010

detect and locate objects at great distances. By theonset of World War II, radio detection and ranging(also known as radar) had become anotherprevalent RF application.

Due in large part to sustained growth in themilitary and communications sectors,technological innovation in RF acceleratedsteadily throughout the remainder of the 20thcentury. Products such as mobile phones thatoperate in licensed spectrum must be designednot to transmit RF power into adjacent frequencychannels and cause interference. This is especiallychallenging for complex multi-standard devicesthat switch between different modes oftransmission and maintain simultaneous links todifferent network elements.

To overcome these evolving challenges, it is crucialfor today’s engineers and scientists to be able toreliably detect and characterize RF signals thatchange over time, something not easily done withtraditional measurement tools.

To address these problems, there is a need of theReal-Time Spectrum Analyzer (RTSA), aninstrument that can discover elusive effects in RFsignals, trigger on those effects, seamlessly capturethem into memory, and analyze them in thefrequency, time, modulation, statistical and codedomains.

Telecommunications systems are often using theso called FDMA (Frequency Division MultipleAccess) which means that different channels areusing different frequencies. This procedure isputting high demands on the spectral purity ofthe signal. In order to decide whether or not asignal is able to interfere with adjacent channels,it has to be studied in the frequency domain. Thisfact makes the spectrum analyzer one of the mostimportant instruments for RF (Radio Frequency)measurements.

1. www.wikipedia.org2. www.fpga4fun.com

1. www.wikipedia.org

2. www.fpga4fun.com

References

Scientists have turned ordinary laptops intoearthquake detectors. The portable seismicrecorders rely on accelerometers built into thelaptops, which are motion-detecting devicesmade to turn off your computer if dropped.

The jostle of an earthquake could do the sametrick. And when an earthquake is detected, aspecial software program transmits the shakingintensity over the Internet to researchers at theUniversity of California, Riverside, and StanfordUniversity.

To avoid false alarms, the software only signalsa quake when several computers in one areatransmit the earthquake alerts.

So far about 1,000 people from 61 countries havevolunteered for the Quake-Catcher Network.

[Source: www.technewsdaily.com]

Ordinary Things Turned Hi-Tech!

Laptop Earthquake Detectors

Page 53: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 49

SIMULINK Model of an Inverted Pendulum SystemSIMULINK Model of an Inverted Pendulum SystemSIMULINK Model of an Inverted Pendulum SystemSIMULINK Model of an Inverted Pendulum SystemSIMULINK Model of an Inverted Pendulum SystemUsing a RBF Neural Network Controller

Bikram AdhikariDOECE, Pulchowk Campus

Abstract: This article presents a robust control of an inverted pendulum system. The cart pendulumsystem is non holonomic and non linear system so that simple linear controllers (like proportional-integral-derivative controller) may not have a good performance. The proposed system uses error back-propagation algorithm developed for RBF network. The RBF network acts as a compensation technique toclassical PID controller for robust control of inverted pendulum system.

Index Terms: Digital incremental PID control, RBF network, Back Propagation, Inverted Pendulum,adaptive control, SIMULINK Modeling

IntroductionInverted pendulum systems are considered as aprototype example of nonlinear system controlapplications to researchers and educators. Humanbody itself is an example of a mobile invertedpendulum system (MIPS), controlling itself fromfalling while walking. The inverted pendulumsystem has been considered as a well knownprototype system of representing nonlinearsystems for testing control algorithms [1-4]. Henceit has become an important subject in roboticsand control systems. PID controllers can balancethe pendulum by selecting suitable gains

However, simultaneous control of both angle andposition by PID controllers has been known to bevery difficult since the inverted pendulum systemis nonlinear [5]. There has been active researchin mobile inverted pendulum systems. ’Segway’

has proven to be the future of transportation withits remarkable two wheeled transportation vehicle.Soon Segway as an astronaut robot in the spaceis being introduced [6]. “Joe” robot uses statefeedback control algorithm has been applied tothe MIPS to control velocity and position [7]. Toovercome nonlinear behaviours, nonlinear controlmethods, adaptive control methods and intelligentcontrol approaches have been proposed.

The inverted Pendulum system is a single input-multiple output (SIMO) system where a singleinput force controls both the position and tilt.One of the merits of using neural network as anauxiliary controller is when complicated dynamicmodel of the system is not available.

System structure The inverted pendulum model uses two PIDcontrollers connected in parallel. The total sumof the outputs of the controllers is the input tothe inverted pendulum system.

Each PID controller fights each other to satisfythe requirements of the angle and the cart, butnot enough to control both control actions. Thisleads to the introduction of the RBF network toimprove the performance.

PID controllerThe equation of digital form of a pid controllerfor position and tilt control are given as

Figure 1. Cart-pendulum model

Page 54: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

50 ZERONE 2010

Äux[k] = kpx(ex[k]–ex[k-1])+kixex[k]

+kdx(ex[k]-2ex[k-1]+ex[k-2]) ... (1)

Äuè[k] = kpè(eè[k] – eè[k-1])+kiè eè[k]

+kdè(eè[k]-2eè[k-1]+eè[k-2]) ... (2) u[k] = u[k-1]+ Äuè[k] + Äux[k] ... (3)

where eè=èd - è and ex= xd - x

The controller gains are adjusted by trial and errormethod. Figure below shows the SIMULINK

model for pid control of an inverted pendulumsystem.

RBF networkThe RBF network is known for simplicity andwell formulated whose analysis is easier thanother neural network in control applications. TheRBF network consists of input, hidden, andoutput layer whose hidden layer is the onlynonlinear layer as shown in Fig. 3. The nonlinear

Figure 2. RBFN inverted pendulum [5]

Figure 3. RBF Network [5]

Page 55: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 51

Figure 5. RBFN Feedforward path

Figure 4. Simulink Model of RBFN inverted pendulum

Page 56: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

52 ZERONE 2010

function for the hidden layer of the RBF networkis given by the Gaussian function.

...(4)

where,

XI is the input, µj is the center value, sj is thewidth value.

Then the output of the RBF network can becalculated as the sum.

...(5)

where,

NH is the number of hidden units, wjk is the weightvalue and bk is the bias.

The RBF network outputs are added to the PIDcontroller input to form the new control inputsas shown in Fig. 2. The RBF networkcompensates for uncertainties by adding signalsto the controller.

Äux[k] = kpx (ex[k] – ex[k-1] + 1)

+kix (ex[k]+ 2)

+kdx (ex[k]- 2ex[k-1]+ex[k-2] + 3) ...(6)

Äuè[k] = kpè (eC[k] – eè[k-1] + 4 )

+kiè (eè[k] + 5 )

+kdè (eè[k]-2eè[k-1]+eè[k-2] + 6) ...(7)

Figure 6. RBFN Update bias and weight

Figure 7. RBFN Update mean and variance

Page 57: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 53

u[k] = u[k-1]+ Äuè[k] + Äux[k] ...(8)

RBF Learning AlgorithmWhen neural networks are used in controlapplications, on-line learning and control ispreferred. To achieve on-line learning and control,real-time control hardware has to be implementedin advance [8]. In this paper, we design aSIMULINK model for calculation of the learningalgorithm called the back-propagation algorithmbased on the gradient. In this section, the back-propagation algorithm for the RBF network isderived. Define the neural network output as

= è+ x ...(9)

Where

x = kpx 1 + kix 2 + kdx 3

And

è= kpè 4 + kiè 5 + kdè 6

Using equation (6), (7), (8) and (9)

Äuè[k] + Äux[k]= Ät – ...(10)

The back-propagation learning algorithm isderived to generate neural network output signals

i to identify the inverse dynamics as given in(10). The left side of (10) is the error functions tobe minimized. Then, the training signal î isdefined as

î = kpx (ex[k] – ex[k-1]) + kix ex[k] + kdx (ex[k]-2ex[k-1]+ex[k-2])

+ kpè (eè[k] – eè[k-1]) + kièeè[k] + kdè(eè[k]-2eè[k-1]+eè[k-2]) ...(11)

If î =0, then t = in (10). Define the objectivefunction to be minimized as

E = 1/2 î 2 ...(12)

Differentiating equation (12) with respect toweights,

w ( wjk, bk, sj, µj )

We obtain the detailed update equations (8) as

...(13)

...(14)

...(15)

...(16)

Experimental setupThe experimental setup of an RBFN based invertedpendulum system is shown in figure 4-7.

ResultsFigure 8 shows how the controller responds betterthan linear PID-Controller in dynamic situations.Figure 8 show the response of angle and positionof a RBFN inverted pendulum system.

Figure 9 Inverted pendulum angle control usingRBFN controller [8] Figure 10 Cart positionControl using RBFN controller [8]

ConclusionThis paper presents a SIMULINK modeling of alow cost intelligent neural network controller fornon linear systems. The RCT has been used asan online learning algorithm for neural network.A neural network controller and PID controllers

Figure 8. Comparison of RBFN Controller and PID Controller

Page 58: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

54 ZERONE 2010

Figure 9. Inverted pendulum angle control using RBFN [8]

Figure 10. Cart position control using RBFN controller [8]

[1] M. W. Spong, P. Corke, and R. Lozano,“Nonlinear control of the inertia wheelpendulum”, Automatica, 37, pp. 1845-1851,, 2001

[2] M. W. Spong, “The swing up controlproblem for the acrobat”, IEEE ControlSystems Magazine, 15, pp. 72-79, 1995

[3] W. White and R. Fales, “Control ofdouble inverted pendulum with hydraulicactuation : a case study”, Proc. Of theAmerican Control Conference, pp.495-499,

1999

[4] Seul Jung, H. T. Cho, T. C. Hsia, “Neuralnetwork control for position tracking of atwo-axis inverted pendulum system:Experimental studies”,IEEE Transaction onNeural Networks, vol. 18, no.4, pp. 1042-1048, 2007

[5] Jin Seok Noh, Geun Hyeong Lee, Ho JinChoi, and Seul Jung, “Robust Control of aMobile Inverted Pendulum Robot Using aRBF Neural NetworkController”,Proceedings of the 2008 IEEE

[6] R. O. Ambrose, R. T. Savely, S. M Goza,P. Strawser, M. A. Diftler, I. Spain, and N.Radford, “Mobile manipulation usingNASA’s robonaut”, IEEE ICRA, pp. 2104-2109, 2004

[7] F. Grasser, A. Darrigo, S. Colombi, andA. Rufer, “JOE: A mobile invertedpendulum”, IEEE Trans. on IndustrialElectronics, Vol. 49, No.1, pp. 107-114,2002

[8] Seul Jung and S. S. Kim, “Hardwareimplementation of a real-time neuralnetwork controller with a DSP and an FPGAfor nonlinear systems”, IEEE Transaction onIndustrial Electronics, vol.54, no. 1, pp.

265-271, 2007

[9] Seul Jung and S. S. Kim, “ControlExperiment of a Wheel-Driven MobileInverted Pendulum Using Neural Network”,IEEE Transaction on Control SystemsTechnology

have been designed in SIMULINK. The neuralnetwork controller functions as an auxiliarycontroller to compensate for uncertainties insystems such that the performance of a primaryPID controlled system is improved. Experimentalstudies show that the implemented neuralnetwork controller works quite well for theposition control of a robot ?nger [8], as well as forthe inverted pendulum system. Position trackingcontrol of the cart while balancing the pendulumhas been successfully performed. Future researchis to implement a lower cost intelligent controllerusing a DSP.

References

Page 59: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 55

IRIS Recognition and Identification System isa recognition system based on the principlesof biometric recognition system. A biometric

system uniquely identifies and authenticateshumans based on their physical or behavioralfeatures. Iris recognition, used by us in thisproject, is one of the most reliable methods ofbiometric authentication that recognizes a personby pattern of the iris. No two irises are alike - notbetween identical twins, or even between the leftand right eye of the same person.

The iris, which is locatedbehind the transparentcornea and aqueoushumour of the eye, is amembrane of the eye thatis responsible forcontrolling the diameterand size of the centraldarker pupil and theamount of light reachingthe retina.

The iris has many featuresthat can be used to distinguish one iris from theother. On of the primary visible characteristics isthe trabecular meshwork, a tissue which givesthe appearance of dividing the iris in radial fashionthat is permanently formed by the eighth monthof gestation. During the development of the iris,there is no genetic influence on it, a processknown as chaotic morphogenesis that occurs onthe seventh month of gestation, which means thateven identical twins have different irises.

The fact that the iris is protected behind the eyelid,cornea, and aqueous humor means that unlikeother biometrics such as fingerprints, thelikelihood of damage or abrasion is minimal. Theiris is also not subject to the effects of aging whichmeans it remains in a stable form from about theage of one until death. The use of glasses or contact

lenses (colored or clear) has little effect on therepresentation of the iris and hence does notinterfere with the recognition technology.

IRIS Recognition and Identification System,gathers iris information from segmented iris andencodes the pattern into bit information. This bitinformation or biometric template is used tocompare and identify the authenticated orimpostor users. Iris recognition algorithms alsoneed to isolate and exclude the artifacts as wellas locate the circular iris region from the acquired

eye image. Artifacts iniris include eyelids andeyelashes partiallycovering it.

Then, the extracted irisregion is normalized.The normalizationprocess will unwrapthe doughnut shapedextracted irises into aconstant dimensionalrectangle. Thesignificant features of

the normalized iris must be encoded so thatcomparisons between templates can be made. Oursystem makes use of a 1D Log-Gabor Filter to createa bit-wise biometric template. Finally, templatesare matched using Hamming distance. TheHamming distance gives a clear measure ofnumber of bits that are same between two bitpatterns. A decision can then be made uponwhether the two patterns were generated fromdifferent irises or from the same one.

IRIS, IRIS Recognition & Identification Systemconsists of five steps:

IRIS Recognition & Identification SystemIRIS Recognition & Identification SystemIRIS Recognition & Identification SystemIRIS Recognition & Identification SystemIRIS Recognition & Identification System

Ruchin Singh Sanjana Bajracharya

Saurab Rajkarnikar062 Computer

Page 60: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

56 ZERONE 2010

1. Eye images acquisitionFor our project, IRIS, we acquired images fromCASIA (Chinese Academy of Sciences-Institutionof Automation) and used 5 sets of the iris images.CASIA has a total of 22,051 eye images from morethan 100 subjects. All iris images are 8 bit gray-level JPEG files, collected under near infraredillumination. Almost all the subjects are Chineseexcept a few.

2. SegmentationSegmentation is the process that isolates thecircular iris region of the Eye Images. The isolationis performed by the following

i. Gaussian smoothingThis is the process where the noises that can bepresent in the images, as a result of errors in theimage acquisition process that result in pixelvalues that do not reflect the true intensities ofthe real scene, are removed by smoothing thepixels in the image. In this, smoothing filters areused for blurring and noise reduction in theimages.

ii. Edge detectionThis is the approach for detectingmeaningful discontinuities in animage. To be classified as ameaningful edge point, thetransition in gray level associatedwith that point has to besignificantly stronger than thebackground at that point. For ourproject we have used the Sobeloperator to determine the edgesof the eye image.

iii. Non-max suppressionThis is the stage that finds thelocal maxima in the direction ofthe gradient and suppresses allothers, minimizing the false

edges. The local maxima is found by comparingthe pixel with its neighbors along the direction ofthe gradient. This helps to maintain single pixelthin edges before the final thresholding stage.

iv. Hysteresis thresholdingThis process alleviated problems associated with

edge discontinuities byidentifying strong edges andpreserving the relevant weakedges in addition tomaintaining some level ofnoise suppression. Inhysteresis threshold, we usetwo threshold values, th as thehigh threshold value and tl asthe lower threshold valuewith th>tl. Pixel values thatare above the th value areimmediately classified asedges.

Page 61: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 57

v. Circular Hough TransformCircular Hough Transform is a technique thatlocated circular shapes in images and has beenused to extract circles and ellipses (or conicsections). The iris and pupil are detected anddifferentiated by this process in our IRISRecognition & Identification System.

After these processes are completed, we removenoise (like eyelids and eyelashes) by thresholdprocessing and Linear Hough Transform.

3. NormalisationNormalisatoin is the process of un-wrapping thesegmented iris into constant rectangulardimension. The normalisation process employedin our system takes into account pupil dilationand the zoom factors of the camera. In our system,we have employed Rubber-Sheet model tounwrap the iris.

4. EncodingEncoding is the process that converts thenormalised iris template into bit-wise template.The discriminating features of the iris are encodedhere. In our system, we have used Log Gabor Filterto encode the normalised iris image. Log GaborFilter encodes only the phase information of theiris image.

5. MatchingMatching is the measure of similarity ordissimilarity between two iris templates. In oursystem, matching is performed by calculating theHamming Distance between the two iris templates.

Our IRIS (IRIS Recognition & IdentificationSystem) was fairly accurate with FAR of 11.28%and FRR of 3.09%.

FAR stands for False Acceptance Rate thatmeasures the probability of an individual beingwrongly identified as another individual and FRRstands for False Reject Rate that measures theprobability of an enrolled individual not beingidentified by the system.

The system designed and implemented using theabove steps could successfully accept or rejectindividuals by identifying their iris.

1. John Daugman, PhD, OBE University ofCambridge, \How Iris Recognition Works", TheComputer Laboratory, Cambridge CB2 3QG,U.K.http://www.CL.cam.ac.uk/users/jgd1000/

2. Chinese Academy of Sciences Institute ofAutomation".Database of 756 Greyscale EyeImages.http://www.sinobiometrics.com

References

Source: www.xkcd.com

Page 62: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

58 ZERONE 2010

RFIDAshish Shrestha062 Electronics

RFID (Radio frequency identification)technology was developed in 1920's.Massachusetts Institute of Technology

(MIT) developed the technology to allow robotsto “talk” to each other. In 1939, the IFF(identification, friend or foe) transponder wasdeveloped. The IFF transponder was used inaircraft to identify themselves as friend or foe toother aircraft. The British used this technologyduring World War II to identify their aircraft. Inthe 1950s these system were developedspecifically for Governmental and Military use inUSA and USSR. Semiconductor technologies atthat time were in their infancy and devices were

large and with high current consumption andexpansive, which did not recommend their useof Passive RFID systems. The real explosion ofPassive RFID technology was at the end of 1980sand was made possible by the improved size,current consumptions of circuitries, and price of

semiconductor technologies. This enabled anacceptable RFID performance (communicationdistance) for passive under acceptable investment.

The first generations of RFID tags were only usedas identification devices, having only a fixedidentification code stored into the tag’s memory.There was mainly a one way communication withthe tag communicating back its memory contentwhen triggered by reader activation. An exampleof an early RFID system patent from MarioCardullo is the figure 1.

Now RFID systems are widely used inapplications with the primary task to identify

items, but there are also new applications wherehigh security and computation as well asintegrated sensors and actors are required. Dueto the current cost structure of RFID systems, newapplication fields can be justified based on returnof investment (ROI).

Figure 1. Example of an early RFID system patent from Mario Cardullo

Page 63: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 59

Automatic identification (auto ID) technologieshelp machines or computers identify objects byusing automatic data capture. RFID is one type ofauto ID technology that uses radio waves toidentify, monitor, and manage individual objectsas they move between physical locations.Although there are a variety of methods foridentifying objects with RFID, the most commonmethod is by storing a serial number thatidentifies a product and its related information.RFID devices and software must be supported byan advanced software architecture that enables thecollection and distribution of location-basedinformation in real time.

A basic RFID system consists of threecomponents:

• A transponder (RF tag)

• An antenna or coil

• A transceiver (with decoder)

RFID tags are small devices containing a chip andan antenna that store the information for objectidentification. Tags can be applied to containers,pallets, cases, or individual items. With no line-of-sight requirement, the tag transmits informationto the reader, and the reader converts the incomingradio waves into a form that can be read by acomputer system. An RFID tag can be active (witha battery) or passive (powered by the signal

strength emitted by the reader). The functionalityof both types is similar; the main difference is theincreased performance in view of communicationdistance and computation capabilities of the activeVs the lower cost of passive transponders. Theintegrated battery increases the cost of thetransponder, limits the tag’s life time, causeenvironmental issues over disposal, and limitsthe form factor and thickness of the tags. Thesedisadvantages of the active transponders limit theapplications where these tags can be used. Dueto the very high market share of the passivetechnology, only this technology will be presentedin the following sections.

The tags mostly act as a slave and rely on thereader to activate it using the “Reader Talks First”(RTF) concept. The reader supplies energy viathe RF field and transmit requests/commands toinstruct the tag about the action to be executed.The tag receives and decodes RF signals comingfrom the reader, executes the instructed action,and may respond with data or status information.The cost structure of the tag can be roughly splitin costs for IC, antenna, assembly, and test. Theelectronics part (IC, Integrated Circuit) of the tagconsists of some basic functional modules whichare used to enable certain functionality as shownin the figure 2.

Figure 2. Basic functional modules of RFID tags

Page 64: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

60 ZERONE 2010

to supply the IC with energy.

• The Limiter limits the RF voltage at the inputspins to avoid over voltage which would destroythe circuitry.

• The Clock Regenerator extracts the frequencysignal from the RF signal which is used as aninternal clock.

• The Demodulator decodes the incoming datasignal and generates a binary bit streamrepresenting the command And data to beexecuted. These data are used by the IC to executethe requested activities.

• The Modulator modulates the decoded responsedata.

• The Logic part represents the microcontrolleror digital circuitry of the tag.

• The Memory unit (mostly EEPROM) containsthe tag specific data as well as additional memorywhere application specific data can beprogrammed.

The Reader consists of a control unit and the radiofrequency (RF) unit containing the transmitter andthe receiver modules. In the control unit, thefirmware and the hardware is implemented tocontrol the reader activities such ascommunications with a host computer and thetag, as well as data processing generated by thetag, demodulates and decodes the data, and sendsthe binary data to the control unit for furtherprocessing. The transmitter generates the RFsignal (frequency and power level) which isconnected to the antenna resonance circuit. Thereceiver part receives the RF signal.

Why RFID?In the past, the most used identification systemhas been the barcode. The main reason for thewide usage of this system is the low cost of abarcode by simply printing it on the items andthe improved performance (detection rate, andreliability) of the new generation of scanners.There are still some disadvantages of thistechnology though:

• Data cannot be modified or added

• Requires line of sight for operation (label must be seen by the reader)

• High maintenance effort for the complex scanner optics

Modern application processes like item tracking,require extended capabilities of the ID systemwhich cannot be achieved by the barcodes. Inthese applications, RFID systems can add valuethrough extended functionality. This should notbe misunderstood to imply the completereplacement of barcodes by RFID. RFID is analternative to barcodes which will lead to acoexistence of both technologies based on theperformance and capability requirements and thespecific investment to use the RFID technologyfor these applications. Most applications willrequire the use of both, barcode and RFID inparallel.

Summarizing the advantages of the RFID systemsin relation to other identification systems currentlyin use and especially barcode:

• Battery-less. Supply voltage derived from the RF field

• No line-of-sight required for the communication

• Large operating and communication range

• Read and Write capability of the transponder memory

• High communication speed

• High data capacity (user memory)

• High data security

• Data encryption/authentication capability

• Multiple tag read capability with anti-collision (50–100 tags)

• Durability and reliability

• Resistant to environmental influence

• Reusability of the transponder

• Hands free operation

• Miniaturized (IC size< 1mm2)

• Very low power

1. en.wikipedia.org/wiki/RFID

2. www.electronicsforu.com

3. www.atmel.com

4. www.elastic-rfid.com

References

• The induced voltage is rectified by the Rectifier

Page 65: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 61

Symfony is a web application frameworkwritten in PHP which follows the model-view-controller (MVC) paradigm. Symfony

aims to speed up the creation and maintenanceof web applications and to replace repetitivecoding tasks by power, control and pleasure. Itrequires a few prerequisites for the installation ofUNIX, window with a web server and PHP 5installed. It is currentlycompatible with thefollowing object relationalmapping: propel anddoctrine.

Object-relational mappingis a programmingtechnique for convertingdata betweenincompatible type systems in relational databasesand object-oriented programming languages. ORMoften reduces the amount of code needed to bewritten, making the software more robust.

Symfony uses Propel as the ORM, and Propeluses Creole for database abstraction. It allows youto access your database using a set of objects,providing a simple API for storing and retrievingdata.

Doctrine is an object relational mapper (ORM) forPHP 5 that sits on top of a powerful databaseabstraction layer (DBAL). One of its key featuresis the option to write database queries in aproprietary object oriented SQL dialect calledDoctrine Query Language (DQL). This providesdevelopers with a powerful alternative to SQLthat maintains flexibility without requiringunnecessary code duplication.

Symfony is aimed at building robust applicationsin an enterprise context, and aims to givedevelopers full control over the configuration:from the directory structure to the foreign libraries,

almost everything can be customized. To matchenterprise development guidelines, Symfony isbundled with additional tools to help developerstest, debug and document projects.

Symfony was built in order to fulfill the followingrequirements:

• Easy to install and configure on most platforms(and guaranteed towork on standard*nix and Windowsplatforms)

• Database engine-independent

• Simple to use, inmost cases, but still

flexible enough to adapt to complex cases

• Based on the premise of convention overconfiguration--the developer needs to configureonly the unconventional

• Compliant with most web best practices anddesign patterns

• Enterprise-ready--adaptable to existinginformation technology (IT) policies andarchitectures, and stable enough for long-termprojects

• Very readable code, with php Documentorcomments, for easy maintenance

• Easy to extend, allowing for integration withother vendor libraries

Symfony provides a lot of features seamlesslyintegrated together, such as:

• simple templating and helpers

• cache management

• smart URLs

•scaffolding

Symfony and MVC Architecture

Suraj Maharjan Ram Kasula Prasanna Man Bajracharya

062 Computer

"Symfony is aimed at building robustapplications in an enterprise context, and

aims to give developers full control overthe configuration: from the directory

structure to the foreign libraries, almosteverything can be customized.”

Page 66: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

62 ZERONE 2010

• multilingualism and I18N support

• object model and MVC separation

• Ajax support

• Enterprise ready

The MVC architecture

ModelModel is often related with the business logic ofthe application (the database belongs to this layer).It knows all the data that needs to be displayed.It encapsulates core data and logic. It is alwaysisolated from the User Interface (UI) and the waydata needs to be displayed. The model is used tomanage information and notify observers whenthat information changes. It contains only dataand functionality that are related by a commonpurpose. If we need to model two groups ofunrelated data and functionality, we create twoseparate models. A model encapsulates more thanjust data and functions that operate on it. A modelis meant to serve as a computationalapproximation or abstraction of some real worldprocess or system. It is the domain-specificrepresentation of the information on which theapplication operates. Domain logic adds meaningto raw data (for example, calculating whethertoday is the user's birthday, or the totals, taxes,and shipping charges for shopping cart items).

Many applications use a persistent storagemechanism (such as a database) to store data. MVCdoes not specifically mention the data access layerbecause it is understood to be underneath orencapsulated by the model.

ViewView is responsible for rendering the outputcorrelated to a particular action. It is the UI partof the application. It uses read-only methods ofthe model and queries data to display them to theend users. It may be a window GUI or a HTMLpage. View encapsulates the presentation of thedata; there can be many views of the commondata. The view is responsible for mappinggraphics onto a device. A view typically has aone to one correspondence with a display surfaceand knows how to render to it. A view attachesto a model and renders its contents to the displaysurface. In addition to, when the model changes,the view automatically redraws the affected partof the image to reflect those changes. A view may

be a composite view containing several sub-views,which may themselves contain several sub-views.

ControllerThe Controller is a piece of code that calls theModel to get some data that it passes to the Viewfor rendering to the client. It acts as interactingglue between models and views. It accepts inputfrom the user and makes request from the modelfor the data to produce a new view. A controlleris the means by which the user interacts with theapplication. A controller accepts input from theuser and instructs the model and view to performactions based on that input. In effect, the controlleris responsible for mapping end-user action toapplication response. For example, if the userclicks the mouse button or chooses a menu item,the controller is responsible for determining howthe application should respond. So the controllerlayer contains the code linking the business logicand the presentation and is split into severalcomponents that can be used for differentpurposes.

MVC comes in different flavors; control flow isgenerally as follows:

The user interacts with the user interface in someway (for example, presses mouse button).

The controller handles the input event from theuser interface, often via a registered handler orcallback.

The controller notifies the model of the user action,possibly resulting in a change in the model's state.(For example, the controller updates the user'sshopping cart).

A view uses the model indirectly to generate anappropriate user interface (for example, the viewlists the shopping cart's contents). The view getsits own data from the model. The model andcontroller have no direct knowledge of the view.

The model, view and controller are intimatelyrelated and in constant contact. Therefore, theymust reference each other. The picture aboveillustrates the basic Model-View-Controllerrelationship:

Advantages of MVC architecture• Modularized development: Modularization isthe process of dividing any complex problem intosmaller sub-modules. In MVC, we divide oursystem into three parts in order to reducecomplexity.

Page 67: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

ZERONE 2010 63

• More control over URLs: Almost all MVC basedframeworks have the feature of URL routing thatgives us more control over the URL so the siteswill be more secure.

• Maintainability and code reuse: The Modulardesign of MVC supports the design goal of reusablesoftware. As MVC requires a definite rule andstyle for coding, the result can be much moremaintainable and reusable software.

• Test driven development: By following MVC,one can easily tests each and every part of thesystem. Moreover, most of the MVC frameworksdo have one or more built-in testing frameworks.

• Separation of concern: Since MVC has threecomponents, operations are quite isolated fromeach other. For example; people working on viewpart can concentrate only on the UI and the partvisible to the end users; people working on modelpart can concentrate on the business logic andthe functional requirements of the system or“What” part of the system and finally peopleworking on the controller section may haveknowledge of both view and model section sothat interaction between other two componentscould be made easily. There is clear designationof roles for each stakeholder of a system.

Disadvantages of MVC• Level of complexity: MVC can increase the levelof complexity of a system since MVC requiresplanning in depth. So any wrong decision takenearly could impact the whole application life cycle.

• Difficulty in managing file: This may be contextdependent. Some people might feel odd whendealing with more files. An MVC based system

has comparatively more number of files than anon-MVC based system.

Example: Backend control panal generationusing SymfonyInstall the symfony

Generate the project

php lib/vendor/symfony/data/bin/symfonygenerate:project project_name(eg eshopping)

Generater a application named backend

$ php symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret1 backend

In project _name\config\schema.yml write downthe schema (model schema)eg:

Page 68: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Project Ideas

64 ZERONE 2010

propel: member: _attributes: { idMethod: native } id: credential: { type: varchar(225),

required: true, default: '' } first_name: { type: varchar(128) } last_name: { type: varchar(128) } email: { type: varchar(128), index:

unique } secret_question: { type: longvarchar

}secret_answer: { type: longvarchar } primary_phone: { type: varchar(32)} secondary_phone: { type:

varchar(32)} password: { type: varchar(32),

required: true } confirm_code: { type: varchar(32) } is_confirmed: { type: INTEGER,

required: true} is_deleted: { type: INTEGER,

required: true } is_active: { type: INTEGER,

required: true } access_num: { type: INTEGER,

required: true } created_at: ~ updated_at: ~ modified_at: {type: timestamp }

In project _name\config\database.yml connectwith the database eg:

dev: propel: param: classname: DebugPDOtest: propel: param: classname: DebugPDOall: propel: class: sfPropelDatabase param: classname: PropelPDO dsn:

mysql:dbname=eshopping;host=localhost username: root password: encoding: utf8 persistent: true pooling: true

Load test data in fixture eg:

in project_name\data\fixturesMember: Member_1: credential: 'member'

email: [email protected] password: test first_name: Suraj last_name: Maharjan primary_phone: 4215590 created_at: 2007-12-17 10:17:39 is_deleted: 0 confirm_code:

14ad75adde376a57cda2069a6d5902d6 is_confirmed: 1 Member_2: credential: 'member' email: [email protected] password: 1234 first_name: Test last_name: Tester primary_phone: 32123123121 created_at: 2007-12-17 10:17:39 is_deleted: 0 confirm_code:

14ad75adde376a57cda2069a6d5902d6 is_confirmed: 1

Building sql, model … from our schemaphp symfony propel:build-all --no-

confirmation

Generater the member modulephp symfony propel:generate-admin

backend Member --module=member

Loading the test dataphp symfony propel:data-load

http://www.symfony-project.org

References

“The glass is neither half-full nor half-empty: it'stwice as big as it needs to be.”

“If it weren’t for C, we’d be writingprograms in BASI, PASAL, and OBOL.”

Page 69: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

Explained: The Discrete Fourier TransformThe theories of an early-19th-century Frenchmathematician have emerged from obscurity to becomepart of the basic language of engineering.

In 1811, Joseph Fourier, the 43-year-old prefectof the French district of Isère, entered acompetition in heat research sponsored by the

French Academy of Sciences. The paper hesubmitted described a novel analytical techniquethat we today call the Fourier transform, and itwon the competition; but the prize jury declinedto publish it, criticizing the sloppiness of Fourier’sreasoning.

Now, however, his name is everywhere. TheFourier transform is a way to decompose a signalinto its constituent frequencies, and versions ofit are used to generate and filter cell-phone andWi-Fi transmissions, to compress audio, image,and video files so that they take up less bandwidth.It’s so ubiquitous that “you don’t really study theFourier transform for what it is,” says LaurentDemanet, an assistant professor of appliedmathematics at MIT. “You take a class in signalprocessing, and there it is. You don’t have anychoice.”

The Fourier transform comes in three varieties:the plain old Fourier transform, the Fourier series,and the discrete Fourier transform. But it’s thediscrete Fourier transform, or DFT, that accountsfor the Fourier revival. In 1965, the computerscientists James Cooley and John Tukey describedan algorithm called the fast Fourier transform,which made it much easier to calculate DFTs ona computer. All of a sudden, the DFT became apractical way to process digital signals.

To get a sense of what the DFT does, consider anMP3 player plugged into a loudspeaker. The MP3player sends the speaker audio information asfluctuations in the voltage of an electrical signal.Those fluctuations cause the speaker drum tovibrate, which in turn causes air particles to move,producing sound.

An audio signal’s fluctuations over time can bedepicted as a graph: the x-axis is time, and the y-

axis is the voltage of the electrical signal, orperhaps the movement of the speaker drum or airparticles. Either way, the signal ends up lookinglike an erratic wavelike squiggle. But when youlisten to the sound produced from that squiggle,you can clearly distinguish all the instruments ina symphony orchestra, playing discrete notes atthe same time.

That’s because the erratic squiggle is, effectively,the sum of a number of much more regularsquiggles, which represent different frequenciesof sound. “Frequency” just means the rate atwhich a voltage fluctuates, and it can berepresented as the rate at which a regular squigglegoes up and down. When you add twofrequencies together, the resulting squiggle goesup where both the component frequencies go up,goes down where they both go down, and doessomething in between where they’re going indifferent directions.

The DFT does mathematically what the humanear does physically: decompose a signal into itscomponent frequencies. Unlike the analog signalfrom, say, a record player, the digital signal froman MP3 player is just a series of numbers: CD-quality digital audio recording, for instance,collects 44,100 samples a second. If you extractsome number of consecutive values from a digitalsignal — 8, or 128, or 1,000 — the DFT representsthem as the weighted sum of an equivalentnumber of frequencies. (“Weighted” just meansthat some of the frequencies count more thanothers toward the total.)

Demanet points out that the DFT has plenty ofapplications, in areas like wireless technologiesspectroscopy and magnetic resonance imaging.But ultimately, he says, “It’s hard to explain whatsort of impact Fourier’s had,” because the Fouriertransform is such a fundamental concept that bynow, “it’s part of the language.”

MIT News

[Source: MIT News Office, Massachusetts Institute of Technology

http://web.mit.edu/newsoffice/]

Page 70: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

66 ZERONE 2010

SIS is an installation file for Symbian OS.Generally, Symbian OS build tools arecommand line based and would work

without any integrated development environment(IDE) if suitable Software Development Kit (SDK)is used. Development is much more complicatedif command line is used as many things are to bedone manually. IDE is used for programmer’ssimplicity and flexibility. For building any projectwith Microsoft Visual C++ 6 as IDE, S60 Version2 Feature Pack 2 is used as SDK.

Perform the following operations:

• Install Microsoft Visual C++ 6 as IDE.

• Along with IDE, following software tools are tobe installed in the computer:-

♦ Java JRE: Choose the latestversion of Java i.e. java version 1.6.0.

♦ ActivePerl: It is needed by SymbianOS tool chain to compile the project.Make sure that the installation programto set the path.

• Open My Computer -> Properties -> Advanced

-> Environment Variables

• Add C:\Program Files\Java\jdk1.6.0 \bin to thePATH variable.

• Add.pl to PATHEXT so that perl scripts don’tneed trailing.pl.

• Install S60 Version 2 Feature Pack 2.

To create a new project & run onthe emulatorLet us create a simple “HelloWorld” project.

• Select or click on Application Wizard of the SDKfrom the location C:\Documents and Settings\All

Users\Start Menu\Programs\Series 60 DeveloperTools\2nd Edition SDK Feature Pack 2\1.0\Tools

Or,

• Click on start -> All Programs -> Series 60Developer Tools -> 2nd Edition SDK Feature Pack2 -> 1.0 ->Tools -> Application Wizard.

• Fill the project name as “HelloWorld” and thewizard plugin should be set to Series 60Application Wizard and click on create button.Note that the default project folder isC:\Work\HelloWorld.

• Select any of the type of application to create.Application title & Application UID may or maynot be changed, it depends on the users. Clickon Next button.

• Fill up the copyright message and the name ofthe Author. Click on Next button.

• Click on Generate button and the ApplicationWizard will create a project named HelloWorldin the default location C:\Work\HelloWorld. Itenables the starting of IDE (i.e. Visual C++ 6.0)whenever the project is created.

• Press “Ctrl + F7” to compile the project andpress “Ctrl + F5” to execute the program in theemulator.

• It then displays virtual machine of S60 mobilei.e. emulator. Run HelloWorld with emulator andobserve the result.

Content of HelloWorld folderHelloWorld folder contains directories with someof the following names:

• Aif: The application information resource fileis located here. This contains bitmaps andcaptions associated with the application. Thebitmap files associated with the aif file are storedin this folder also.

How to create a Symbian Installation Source (SIS) using Visual C++ 6.0

Kishoj Bajracharya062 Computer

Computer Operation & ProgrammingComputer Operation & ProgrammingComputer Operation & ProgrammingComputer Operation & ProgrammingComputer Operation & Programming

Page 71: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 67

Computer Operation & Programming

• Data: Resource files for the application arestored under this folder. It is also common to putresource files in the group directory.

• Group: This contains the bld.inf file (componentdefinition file) and the.mmp (project definition)file. The generated abld.bat file will also be foundhere. Therefore, command line builds tend to bedone from this folder.

• Inc: All the header files and the stringlocalization file (.loc in Symbian pre-v.9.0 and.rlsin Symbian v9.0) are found here. For SymbianOS UI application, at least four classes arerequired and they all are created during thecreation of the new project. The four classes are:

CHelloWorldApp: It creates documents, defineUID, and define application properties.

CHelloWorldAppUi: It creates View, controlcommand handling & user interactions

CHelloWorldContainer: Display of data on thescreen is done & command handling for view isdone here.

CHelloWorldDocument: It creates AppUi, takescares of data model of application.

• Install: The installation.pkg file is located here.

• Src: All the source files will be found underhere. The classes of the source folders are asfollows:

♦ An application: The application class serves todefine the properties of the application, and alsoto manufacture a new blank document. In thesimplest case the only property that we have todefine is the application’s unique identifier, orUID.

♦ A document: A document represents the datamodel for the application. If the application isfile-based, the document is responsible for storingand restoring the application’s data. Even if theapplication is not file-based, it must have adocument class, even though that class doesn’tdo much apart from creating the application userinterface (app UI).

Page 72: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

68 ZERONE 2010

Computer Operation & Programming

♦ An app UI: The app UI is entirely invisible. Itcreates an application view (app view) to handledrawing and screen-based interaction. Inaddition, it provides the means for processingcommands that may be generated, for example,by menu items.

♦ An app view: This is, in fact, a concrete control,whose purpose is to display the application dataon screen and allow us to interact with it. In thesimplest case, an app view provides only themeans of drawing to the screen, but mostapplication views will also provide functions forhandling input events.

To run the existence project• Place the folder of existence project sayHelloWorld in that drive where SDK is installed.

• Open the folder HelloWorld and then open sub-folder named as ‘group‘.

• Click on file with.DSW as extension. It willopen the IDE that contains source code of theproject.

• Press “Ctrl + F7” to compile the project andpress “Ctrl + F5” to execute the program in theemulator.

• It then displays virtual machine of S60 mobilei.e. emulator. Run HelloWorld with emulator andobserve the result.

To get the applications HelloWorldto mobiles• Run command prompt.

• Go to the ‘group’ folder of project by typing saycd C:\Work\Helloworld\ Helloworld\group.

• Type ‘bldmake bldfiles’ and this creates abld.batand some other information files.

• To compile for mobile phones, type ‘abld buildthumb urel’ or ‘abld build thumb udeb’.

• Copy a file with extension.pkg of sis sub-folderof the project to the location given by‘C:\Symbian\8.0a\S60_2nd_FP2\Examples\toolsandutilities\install’.

• For creating a package go to the location givenby above from the command line and type makesisfollowed by file with extension.pkg. This createsa file with extension.SIS. Send this file to eitherphone memory or memory card of the mobilephones.

This is how a Symbain Installation Source(SIS)is developed.

To install HelloWorld in the cellularphoneTransfer the HelloWorld.sis file to the mobilephones through Bluetooth, Nokia PCSuite ormemory card. Install ‘HelloWorld.sis’ either to thephone memory or the memory card of the mobilephone.

Page 73: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 69

Computer Operation & Programming

If you design websites you might want to installa web server on your computer in order totest your sites in an environment that matches

the real thing as close as possible. Configure theopen-source Apache HTTP (web) server and howto make it work with not one site but as many asyou require using a technique called name-basedvirtual hosting. This article allows you to accessto your local repository using addresses such ashttp://mysite.com instead of http://localhost/~myuser/myproject/

Early Web servers were designed to handle thecontents of a single site. The standard way ofhosting several Web sites in the same machinewas to install and configure different, and separate,Web server instances. As the Internet grew, sodid the need for hosting multiple Web sites and amore efficient solution: virtual hosting wasdeveloped. Virtual hosting allows a single instanceof Apache to serve different Web sites, identifiedby their domain names. IP-based virtual hostingmeans that each of the domains is assigned adifferent IP address; name-based virtual hostingmeans that several domains share a single IPaddress. Name-based virtual hosting requiresHTTP/1.1 support.

On WindowsConfiguring Apache: The first file we'll need toedit is the Apache httpd.conf file. If you installthe Apache software using the download fromthe Apache web site, you should have a menuitem that will open this file for editing. Click Start->Programs->Apache HTTP Server->ConfigureApache Server->Edit the Apache httpd.confConfiguration File. If you don't have that startmenu item, start your text editor and open thefile. It will be in a sub-folder named conf of yourApache folder. For example,

C:\Program Files\ApacheGroup\Apache\conf\httpd.conf

ConfigurationNote that Apache changed the preferred methodfor configuring the Apache server with the releaseof Apache 2.2. For versions beginning with 2.2,the preferred configuration is more modular.Setting up a virtual host as described here willstill work with the newer versions, but to followthe modular approach, the editing of httpd.confis only to uncomment (remove the # from thebeginning of the following line:

#Include conf/extra/httpd-vhosts.conf

Everything else is entered in the file httpd-vhosts.conf, which will be located in the extrafolder below the folder containing httpd.conf.

SecurityVersion 2.2 also changed some of the defaultsecurity configuration parameters. To set thingsup the way you need them, you need to add thefollowing block to either your httpd.conf file orjust above the virtual hosts or to your httpd-vhosts.conf file:

<Directory "\MySites "> Order Deny,Allow Allow from all</Directory>

The above assumes you're using the directorystructure described below. Adjust that asnecessary to reflect your actual directory.

Now, for this example, we'll assume that you haveyour web sites located in a folder on your C drivecalled My Sites. Each web site has a sub-folder ofits own under that folder, like this:

C:\My Sites\Site1 C:\My Sites\Site2

Say also, for this example, that the domains forthe two sites are site1.com and site2.com. We'regoing to set up virtual hosts for those two sitesusing the domain names site1.local and site2.local.This way, you'll be able to tell at a glance whetheryou're looking at the live site, or testing site.

Ganesh Tiwari Biraj Upadhyaya

063 Computer

Implementing Virtual Hosting

Page 74: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

70 ZERONE 2010

Computer Operation & Programming

In reality, you can call the domains anything youwant. You could just as easily name themmicrosoft.monkeybutt and ibm.greentambourine.I choose to use the convention of using the samedomain name along with the.local TLD to simplifyand minimize the typing needed to switch betweenthe live site and the testing site. The only importantpoint, and it's really important, is that you NEVERuse an actual, real, live domain name. If you used,for example, site1.comfor the local virtualhost, you would neverbe able to actuallyreach the live site. Allrequests for the livesite would be re-directed to your localvirtual host.

Go to the very bottom of your httpd.conf file inyour text editor. You should see an example of avirtual host there. Each line of that example willbegin with an octothorpe (#). The octothorpecharacter marks the line as a comment, so theexample is not executed. Add the following linesbelow that example:

NameVirtualHost 127.0.0.1<VirtualHost 127.0.0.1> DocumentRoot "C:\My Sites\Site1" ServerName site1.local</VirtualHost><VirtualHost 127.0.0.1> DocumentRoot "C:\My Sites\Site2" ServerName site2.local</VirtualHost>

That's all you need to do! Save and close the file.That will tell the Apache server everything it needsto know in order for it to serve the pages usingthe domain names site1.local and site2.local. Onenote is that, in the above example, we have a spacein the path. Because of that, we put quotationmarks around the document root directory. If thepath does not have any spaces in it, do not quotethe path. If the directory used for your sites were,for example MySites instead of My Sites, thedocument root line would look like this instead:

DocumentRoot C:\MySites\Site1

Resolving the DNS issueObviously, if you typed http://site1.local in yourbrowser, it would not be found by your Internetprovider's DNS server. We're next going to editanother file to work around that. The second fileyou need to edit is called hosts, with no fileextension. It is a Windows system file and it will

enable you to enter specific addresses for specificdomains instead of using a DNS lookup. Thenormal location for this file is:

C:\WINNT\system32\drivers\etc\hostsorC:\Windows\system32\drivers\etc\hosts

If you don't find it there, do a search in yourwindows directory for the word hosts in the filename. The file you want is called hosts, with no

file extension. The correct filewill begin with the followinglines:

# Copyright (c) 1993-1999Microsoft Corp.

# This is a sample HOSTSfile used by Microsoft TCP/IP for Windows.Once again, in this file, the octothorpe characteris a comment marker. Lines beginning with it arecomments. In all likelihood, there will be nothingthere, except for comments. If there are any othernon-commented entries, leave them alone. Justgo to the bottom of the file, below all the commentsand any existing entries and add the followingtwo lines:

127.0.0.1 site1.local127.0.0.1 site2.local

That's all you need to do there. Save and closethe host file.

The only remaining thing you need to do is to re-start the Apache server. You need to do thisbecause Apache only reads the configuration filewhen it first starts up. Click Start->Programs->Apache HTTP Server->Control Apache Server->Restart. If you don't have that menu item, opena command prompt and change to the Apachedirectory, and type the following command andpress the Enter key:

apache -w -n "Apache" -k restart

You should see a message like this:The Apache service is restarting.The Apache service has restarted.

That's it! You're done! Close the commandwindow and start your web browser. In thebrowser's address bar, type http://site1.local andhit the Enter key. You should now see your localcopy of your site1.

Okay, now I'll mention one very small, butpossibly important, caveat. When you create thevirtual hosts like this, the default http://localhostwill no longer work. In many cases, that is

“Virtual hosting allows a singleinstance of Apache to serve

different Web sites, identified bytheir domain names”

Page 75: ZERONE 2010 - Annual Technical Journal, IOE, Nepal

ZERONE 2010 71

Computer Operation & Programming

unimportant. However, if you're using somethinglike phpMyAdmin, you'll still need it. Thesolution to that is to create one additional virtualhost called "localhost" that points to the originalApache htdocs folder. It might look somethinglike this:

<VirtualHost 127.0.0.1> DocumentRoot C:\Apache\htdocs ServerName localhost</VirtualHost>

Don't forget to include that additional virtual hostwhen you edit the Windows hosts file.

For Debian, UbuntuOnce the server is installed, it is time to get intoapache 2 configuration.

Let's open apache's main configuration file, name/etc/apache2/apache2.conf. A search for the wordvirtual brings us to the following line:

Include /etc/apache2/sites-enabled/[^.#]*

This mean that when starting apache, it will lookfor files in /etc/apache2/sites-enabled/.

Let’s go there and see what is in.$cd /etc/apache2/sites-enabled/$ls -ltotal 1lrwxrwxrwx 1 root root 36 2005-12-27

01:42 000-default -> /etc/apache2/sites-available/default

Well, this only links to the file in directory /etc/apache2/sites-available/. The point in doing suchis it allows you, mainly when you are using yourbox as a web server, to:

1. Have a simple main configuration file

2. Be able to edit or create a new host by creating/editing a file from /etc/apache2/sites-available/

3. In case your web server doesn't restart becauseof misconfiguration, you can simply remove thelink from the file in /etc/apache2/sites-enabled/pointing to the malformed file in /etc/apache2/sites-available/

Now let say you want to be able to map the domainname mysite.com to you local machine, using thecode file in /home/myuser/public_html/mysite.com/.

While in /etc/apache2/sites-available, create a newfile (let say mysite.com.conf)

$sudo vi mysite.com.conf

Now add the following lines:<VirtualHost mysite.com>ServerAdmin webmaster@localhost#We want to be able to access the web

site using www.mysite.com ormysite.com

ServerAlias www.mysite.comDocumentRoot /home/myuser/

public_html/mysite.com#if using awstatsScriptAlias /awstats/ /usr/lib/cgi-

bin/#we want specific log file for this

serverCustomLog /var/log/apache2/

mysite.com-access.log combined</VirtualHost>

Now, we specified a new host to apache but it isnot yet linked to the repertory where apacheactually looks for virtual hosts. Let go to:

$cd /etc/apache2/sites-enabled/

And create a link to the file we just created:$sudo ln -s /etc/apache2/sites-

available/mysite.com.confmysite.com.conf

Now apache is almost ready to restart, but beforedoing so, we must inform our linux system thatmysite.com and www.mysite.com are not to belooked for on the net, but on the local machineinstead.

To do so, simply edit /etc/hosts and add the newhost names at the end of the line beginning by127.0.0.1, which is localhost.

In the end, your file should look like:127.0.0.1 localhost.localdomain

localhost mysite.com www.mysite.com

And now we are done, simply reload apache:sudo /etc/init.d/apache2 reload

Open your web browser and enter the followingaddress mysite.com. Magic, it runs the same aswhen you were using http://localhost/~myuser/example.com but it is far more useful whendeveloping a web service and want to be able todevelop applications on your machine just like itis where the real web site.

to enable a new virtual host simply type:sudo a2ensite mysiteavailable-site

to disable a virtual host:sudo a2dissite mysiteavailable-site

where mysiteavailable-site is the name of thevirtual host you want to enable/disable, so in outexample: example.com.conf