Anda di halaman 1dari 95

ABSTRACT

I propose a novel methodology towards a complete system working to assist users in a library. With this aim, the system must be capable to looking for a specific book in a shelf, asked by any user, and whether it is found, deliver it as soon as possible to the user. To get its objectives the system integrates automatic object recognition, visually guided grasping using Augmented Reality (AR), and force feedback, among other advanced capabilities. Implementation details about the main modules developed presently using Robotics. I developed a computer algorithm for the process and obtained remarkable improvement in accuracy from tests. An implementation using IR sensors and a new algorithm to enhance the accuracy of an operation process, book pick and place process. The side of the books from the robot point of view, oriented towards outside the shelf, is all of them, approximately, in the same spatial plane. The code picks up the data information from infrared sensing system and analyses these data to generate an actual book location at the end. Once the actual book location is generated, the robot updates the pick-up book position and executes picking-up the book. Finally, after success in preliminary results obtained in the Campus; I am encouraged to follow working in this way to obtain the complete prototype.

LIST OF TABLES
Table NO.
Table 2.1 Table 2.2 Table 2.3 Table 2.4 Table 5.1 Table 5.2 Table 5.3 Table 5.4 Table 5.5

TITLE
PIN DESCRIPTION PIN ALTERNATE FUNCTIONS PIN ALTERNATE FUNCTIONS 2 SWING COMPONENTS ADMIN TABLE BOOK TABLE BOOK SEARCH TABLE USER DATA TABLE USER AND PASSWORD TABLE

PAGE NO.
11 16 17 19 45 45 46 46 46

ii

LIST OF FIGURES
Figure NO.
Fig 1.1 Fig 1.2 Fig 1.3 Fig 1.4 Fig 2.1 Fig 2.2 Fig 2.3 Fig 2.4 Fig 3.1 Fig 4.1 Fig 4.2 Fig 4.3 Fig 4.4 Fig 4.5 Fig 4.6 Fig 4.7 Fig 4.8 Fig 4.9 Fig 4.10 Fig 4.11 Fig 4.12 Fig 5.1 Fig 5.2 Fig 5.3 Fig 5.4 Fig 5.5 APPENDIX -C

TITLE
MECHANICAL DESIGN QUICK RETURN MECHANISM SCREW ROD MECHANISM SPIRAL GEAR RF TRANSMITTER RF RECEIVER PERIPHERAL FEATURES ARCHITECTURE SYSTEM DESIGN HARDWARE DESIGN POWER SUPPLY TO MC POWER SUPPLY SYSTEM AT89S52 DC MOTOR CIRCUIT RS232 SYSTEM SIDE CIRCUIT ROBOT SIDE CIRCUIT PROTOCOL OF ROBOT PROTOCOL ON SENDER SIDE I-PUP (FRONT VIEW) I-PUP (SIDE VIEW) USE CASE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM CLASS DIAGRAM COMM API SCREEN SHOTS

PAGE NO.
3 4 5 5 9 10 13 15 22 23 24 24 25 28 29 30 31 32 33 34 35 38 39 40 41 46 70

iii

LIST OF ABBREVATIONS
ACK CISC CTS EEPROM EPROM FET J2SE GPR ISR ATMEL PSP PWM RD/ WR RISC RTS SFR Acknowledgement Complex Instruction Set Computer Clear To Send Electrically Erasable Programmable Read Only Memory Erasable Programmable Read Only Memory Field Effect Transistor Java Software Enterprise General Purpose Register Interrupt service Routine Advanced Technology Memory and Logic Parallel Serial Port Pulse With Modulation Read/Write Reduced Instruction Set Computer Request To Send Special Function Register

iv

1. INTRODUCTION
A robot is an automatically guided machine, able to do tasks on its own. Another common characteristic is that by its appearance or movements, a robot often conveys a sense that it has intent or agency of its own. How computers simplified human work load, robots make it much simpler. Most of the applications like supermarket, library, tool Manufacture Company will have a pic and place work which is being handled by an intelligent human brains. The aim of this project is to replace that intelligent with a machine of same intelligence level. I-LiBot (Intelligent Librarian Robot) works in a known environment. Here the environment is the dimension of the room and size, location of the books and on a plain surface.

1.1 INTRODUCTION:
The main aim of this project i-LiBot is to replace all the functions and activities of a Librarian. The functions include book returning, book issuing, and Verify book. I-LiBot is a 4 legged walking robot with an arm mounted on its base. In this context, some of the capacities of robot may include, among others: This robot is a legged mobile robot. The books are identified with the help of RFID. Each book is tagged and differentiated with a tag number. Mapping techniques: The robot locates the book on the basis of point to point making in the room. So the room is understood by the robot as a graph and moves by marking the points. Human-robot interaction made possible with an application. The robot is completely autonomous system which does the functions by only listening to the commands from the application. Fully autonomy. The machine will create and complete all its tasks without human interaction. Motion planning and other artificial intelligence techniques is being used to figure out how the robot has to act. I thought if the intelligence of the human in the library system can be implemented on a robot, the work load on the human can be reduced. This system was designed from the inspiration from the ATM machine. There are many library robot systems being already implemented earlier. The 1

aim of this project is to focus on simplicity of the problem, cost efficient, simple installation and service, more intelligent machine, and an environment friendly machine.

1.1.1 Human-robot interaction


If robots are to work effectively in homes and other non-industrial environments, the way they are instructed to perform their jobs, and especially how they will be told to stop will be of critical importance. The people who interact with them may have little or no training in robotics, and so any interface will need to be extremely intuitive. There are two general classes of Human robot interaction: Teleoperated Communication Autonomous Communication

1.1.1.1

Teleoperated communication

A Teleoperated Robot is a vehicle that is controlled by a human operator at a remote location via a communications link. All cognitive processes are provided by the operator based upon sensory feedback from either line-of-sight visual observation or remote sensory input such as video cameras. A basic example of the principles of teleoperation would be a toy remote control car. Each of the robot are controlled at a distance via a wired or wireless connection while the user provides all control based upon observed performance of the vehicle.

1.1.1.2

Autonomous communication

An Autonomous robot is a vehicle that operates autonomously on the surface of the ground. A fully autonomous robot in the real world has the ability to:

Gain information about the environment.


Work for extended durations without human intervention. Travel from point A to point B, without human navigation assistance. Avoid situations that are harmful to people, property or itself, unless those are part of its design specifications Repair itself without outside assistance. Detect objects of interest such as people and vehicles. A robot autonomous learning includes the ability to: Learn or gain new capabilities without outside assistance. 2

Adjust strategies based on the surroundings and Adapt to surroundings without outside assistance. 1.2 OVERVIEW I started this project by envisioning the ideal for use in the Library management systems. I wanted to be more realistic in my system design so as to influence the interest in the development of the industrial. The design of my system included the following two stages of development: Design of Hardware Modules to implement the Robot model. Design of Software modules to create an interactive Graphical user Interface with special features for surveillances.

1.2.1. Hardware design:


The hardware design of my robot has been developed in the following stages: Robotics (Mechanical Design) Kinematics (Robot Mobility) Embedded Design(Electronic Circuit and Programming)

1.2.1.1. Robotics (mechanical design):


All the inventions like aircrafts, wheel, helicopter and many more were being invented from the natures inspiration. This robot has been designed on the bases of how human hand works. There are 3 Degree of freedoms Leg (Base) This is a four legged walking robot. The legs are being driven with the help of one motor connected with a chain. The legs have 2 degree of freedom 1) Moving Forward 2) Moving Backward Figure 1.1 MECHANICAL CHASES

Arm The arm is being mounted on to the Base (Leg). This can turn only to an angle of 90 degrees. This has 2 degree of freedom. They are 1) Stretching forward 2) Stretching Backward Finger The Finger is mounted on to the Arm. The purpose of Finger is to catch the book with 2 fingers. There are 2 Degree of freedom. 1) Holding a book 2) Releasing a book

1.2.1.2. Kinematics (robot mobility)


The mobility development part of my robot could be considered as one of toughest module that I have undergone in implementing my system design. The development stages for implementing the mobility part of my robotic model includes the following:

Design of the leg: The materials that I choose to design the leg were Mild steel. Mild steel is an alloy of Steel and Iron. It is easy to machine and not hard like EN18, material. This four legs holds the base and carries the machine forward. Each leg work on the bases of Quick Return Mechanism. A quick return mechanism such as the one seen below is used where there is a need to convert rotary motion into reciprocating motion. As the disc rotates the black slide moves forwards and backwards.

b Wheel c Threaded Screw dThreadedRod Figure 1.2 Quick Return Mechanism 4

Design of the Arm: The Arm has 2 degree of freedoms. One is to release the arm and other is to pull the arm forward. This part works on the principle of Screw Rod mechanism.

Figure 1.3 Screw Rod Mechanism The Spiral Gear is being connected to the teeth of another Circular Gear which is being turned with the help of a DC motor. This way the Arm is controlled mechanically. Design of the Hand: The Hand is mounted on to the Arm. This hand again works with a Spiral Gear. But the hand is closed with the gear being driven with the finger loop. Here the Gear is again hammered to the shaft of the DC motor and is being controlled. Here there is two degree of freedom. They are to hold the book and release the book.

Figure 1.4 Spiral Gear

1.2.1.3. Embedded design (electronic circuit and programming)


The hardware of the thesis is built with the power supply, micro controller, DC motors, RFID, and RF transmitter/receiver. The purpose of using the three DC motor is for the movement of the ROBOT, Arm and Hand (Pick Book). The robot arm can rotate up to an angle of 90 degrees. A simple 40pin Atmel8052 microcontroller is used in this project. An RFID reader is used to read the RFID tags. The data has to be sent from the computer to robot and from RFID reader to the computer. The communication is through serial port. Thus the electronic development stage can be explained with more specifications in the following chapters.

1.2.2. Software design:


The software part is of this project is a simple Library management system accessing the data from the database. The software part was designed with swings for better user interaction. The design of the software part includes the following primitive modules: System Side Application with java Swings Database Interface with the Robot (Comm API)

1.3. Purpose:
The purpose of this project is to replace all the functions and activities of a Librarian with an intelligent robot (Machine). The functions include book returning, book issuing, and Verify book. This machine will reduce time, increases accuracy, easy system interaction, and completes the work on a smart world in a smart manner. Apart from the above purpose it is also capable of the following: Issue and return the book (Works similar to ATM machine) Recognize the book with RFID Tag (So secure authentication) The book weight may vary the leg part of the robot is being drive with high torgue motor that ranges from 268N-377N. Powering the robot The Robot should be powered with 5A/12V Battery. Easy to control the robot Simple command. As it is being commanded in the real time. Reach the target or the point by calculating the point distance (point to point marking).

1.4. RFID READER AND RFID TAG


Radio-frequency identification (RFID) is the use of an object (typically referred to as an RFID tag) applied to or incorporated into a product, animal, or person for the purpose of identification and tracking using radio waves. In this project all the books are being tagged with a RFID tag number.

1.5. ACTUATORS:
Actuators are the motors responsible for motion in the robot, as I have mentioned earlier that I have three DC motor for the motion of my model mobility and to drive the arm and hand.

1.6. HARWARE REQUIREMENTS:


ATMEL 8052 Microcontroller. RF Transmitter and Receiver. RFID Reader and RFID Tags. DC Motor. Power Supply.

1.7. SOFTWARE REQUIREMENTS:


Java Version 1.6. Java Comm API. Database (MySQL). Embedded C

2. LITERATURE SURVEY
This chapter explains the Radio Frequency, RFID Reader working, its specifications and the details of Atmel 8052 microcontroller required for the hardware design and also the basics of Java Swing and database required for the software design.

2.1. RADIO FREQUENCY:


Radio frequency (RF) is a frequency or rate of oscillation within the range of about 3 Hz to 300 GHz. This range corresponds to frequency of alternating current electrical signals used to produce and detect radio waves. Since most of this range is beyond the vibration rate that most mechanical systems can respond to, RF usually refers to oscillations in electrical circuits or electromagnetic radiation. RF transmitter and receiver: RF transmitter module: Functional block of Tx section where 1,2,3,4 are the pins 1 - Antenna 2 - Data input 3 - Ground 4 VCC Figure 2.1 RF Transmitter

In this transmitting section the 1st pin is the antenna pin where I can able to fix the antenna for transmitting the data in the Radio Frequency, the 2nd pin is the data input pin in which the output of the encoder is given; the 3rd pin is the ground and the 4th pin is the VCC which is given to operate the transmitter section.

RF receiver module: Functional block of Rx section where 1,2,3,4 are the pins 1 - Antenna

2 - Data input 3 - Ground 4 - VCC Figure 2.2 RF Receiver In this receiving section the 1st pin is the antenna pin where we can able to fix the antenna to receive the data in the Radio Frequency, the 2nd pin is the data output pin to the decoder circuit, the 3rd pin is the ground and the 4th pin is the VCC which is given to operate the receiver section.

2.2.1. AT89S52 Microcontroller


AT89S52 microcontroller is used in this project. Atmel stands for Advan ced Technology Memory and Logic. The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the indus-try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and costeffective solution to many embedded control applications.

10

2.2.2.1 Features:
Compatible with MCS-51 Products 8K Bytes of In-System Reprogrammable Flash Memory Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes 4.0V to 5.5V Operating Range Full Duplex UART Serial Channel Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag Fast Programming Time Flexible ISP Programming (Byte and Page Mode)

2.2.2.2 Pin description:


Pin Number 18 9 10 17 18 19 20 Description P1.0 - P1.7 - Port 1 RST Reset P3.0 - P3.7 - Port 3 XTAL2 Crystal XTAL1 Crystal GND Ground

11

21 28 29 30 31 32 39 40

P2.0 - P2.7 - Port 2 PSEN - Program Store Enable ALE - Address Latch Enable EA - External Access Enable P0.7 - P0.1 - Port 0 Vcc - Positive Power Supply

Table 2.1 Pin Description

2.2.2.3. Peripheral features:


Figure below shows a simplified diagram of the main peripherals present in the 89S52 and their interaction with the CPU and with the external I/O pins. You can notice that there are 3 timers/Counters. I use the expression "Timer/Counter" because this unit can be a counter when it counts external pulses on it's corresponding pin, and it can be a timer when it counts the pulses provided by the main clock oscillator of the microcontroller. Timer/Counter 2 is a special counter, that does not behave like the tow others, because it have a couple of extra functionality.

12

Figure 2.3 Peripheral Features The serial port, using a UART (Universal Asynchronous Receive Transmit) protocol can be used in a wide range of communication applications. With the UART provided in the 89S52 you can easily communicate with a serial port equipped computer, as well as communicate with another microcontroller. This last application, called Multi-processor communication, is quite interesting, and can be easily implemented with 2 89S52 microcontrollers to build a very powerful multiprocessor controllers. If all the peripherals described above can generate interrupt signals in the CPU according to some specific events, it can be useful to generate an interrupt signal from an external device, which may be a sensor or a Digital to Analog converter. For that purpose there are 2 External Interrupt sources (INT0 and INT1). 13

2.3. PIN DIAGRAM:


The PIN diagram ant the description of the corresponding associated with the AT89S52 has been added to the APPENDIX.

2.4. ARCHITECTURE OVERVIEW:


1) VCC Supply voltage. 2) GND Ground. 3) Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes dur-ing program verification. External pull-ups are required during program verification.

14

Figure 2.4 Architecture Overview 4) Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 15

2 trigger input (P1.1/T2EX), respectively, as shown in the follow-ing table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Table 2.2 Pin Alternate Functions 5) Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and dur-ing accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash program-ming and verification. 6) Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

16

7) RST Reset input. A high on this pin for two machine cycles while the oscillator is running

Table 2.3 Pin Alternate Functions resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled. 8) ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped dur-ing each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. 9) PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to exter-nal data memory. 10) EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. 17

11) XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. 12) XTAL2 Output from the inverting oscillator amplifier.

2.5. J2SE
Java Platform, Standard Edition or Java SE (formerly known up to version 6.0 as Java 2 Platform, Standard Edition or J2SE), is a collection of Java programming language APIs useful to many Java platform programs. The Java Platform, Enterprise Edition includes all of the classes in the Java SE, plus a number which are more useful to programs running on servers than on workstations. Starting with the J2SE 1.4 version (Merlin), the Java SE platform has been developed under the Java Community Process. JSR 59 was the umbrella specification for J2SE 1.4 and JSR 176 specified J2SE 5.0 (Tiger). Java SE 6 (Mustang) was released under JSR 270.

2.5.1. Swing
Swing is a GUI toolkit for Java. It is one part of the Java Foundation Classes (JFC). Swing includes graphical user interface (GUI) widgets such as text boxes, buttons, split-panes, and tables. Swing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit. Since they are written in pure Java, they run the same on all platforms, unlike the AWT which is tied to the underlying platform's windowing system. Swing supports pluggable look and feel not by using the native platform's facilities, but by roughly emulating them. This means you can get any supported look and feel on any platform. The disadvantage of lightweight components is slower execution. The advantage is uniform behavior on all platforms.

18

The swing component classes are, Class Abstract Button Description Abstract super class for Swing Buttons

Button Group

Encapsulates a mutually exclusive Set of Buttons

Image Icon

Encapsulates an Icon

JApplet

The swing version of Applet

JButton

The Swing Push Button class

JCheckBox

The swing CheckBox class

JComboBox

Encapsulates a combobox

JLabel

The swing version of a Label

19

JRadioButton

The swing version of a Radio Button

JScrollPane

Encapsulates a scrollable window

JTabbedPane

Encapsulates a Tabbed window

Table 2.4 Swings Components

2.5.2. Design concepts:


The design of this project has three parts. 1) Java Desktop Application 2) Back End (Database with MySQL) 3) Communication through Serial port

2.5.3. Java desktop application design goal:


1) A Library management system is being deisgned. 2) Store Data on to a database and retrieve data from the database 3) Implement a search technique to search the book

20

3. SYSTEM DESIGN
3.1 SYSTEM DESIGN
The design of the robot i-LiBot was initially considered with an idea of creating a realistic model so that it can be used as an ideal model for the pick and place assistant robot system. Therefore I concentrated on various issues of challenge in the part of hardware as well as with the software part of the model and came to an architectural diagram of the system as it is shown in the diagram as follows; generally the design of the system has been broadly classified into the following: HARDWARE DESIGN SOFTWARE DESIGN The modules of the system can be explained from the architecture diagram, which can be explained in detail as follows

3.2. ARCHITECTURE:
The diagram consist of two parts the upper module of the diagram explains the design of the part of the system transmission along with the com port communication while the other lower module of the diagram refers to the design of the robotic model along with its association with the microcontroller and the electronic components. The command is being retrieved from the user and the respected process is being mapped and the command is transmitted over the RF transmitter to the robot. In the system side another process is being carried out. The book number is being read and send to the system through serial port. The serial port is connected to the system kit by RS232. The Receiver of the signal is in the robot part, where the robots execute the command as the system code asks to do. The logical part is being programmed in the robot microcontroller.

21

Figure 3.1 System Architecture

22

4. HARDWARE DESIGNS IMPLEMENTATION


This chapter explains some of the hardware design involved in the development of the system design.

4.1. BLOCK DIAGRAM OF HARDWARE DESIGN:

Figure 4.1 Block Diagram of the Hardware Design

4.2. POWER SUPPLY:


Any invention of latest technology cannot be activated without the source of power. So in this fast moving world, a proper power source, which will be apt for a particular requirement, is deliberately needed. All the electronic components starting from diode to Intel ICs only work with a DC supply ranging from 5V to 12V. The cheapest and commonly available energy source of 230V-50Hz is utilized which is stepped down, rectified, filtered and regulated.

23

Figure 4.2 Power Supply to controller The circuit diagram of the power supply unit is shown in figure 4.2 The sensors and motors uses the +12V dc power supply circuit and the microcontroller uses +5V power supply circuit. Initially the step down transformer steps down

Figure 4.3 Power Supply

24

the 230V to +12V and +5V. It is given to a bridge rectifier, which converts AC into a pulsing DC. A filtering capacitor is used to remove the ripples present in it. It is then given to a voltage regulator, which gives a constant regulated voltage of +12V and +5V.

4.3. AT89S52 MICROCONTROLLER CIRCUIT:


ATMEL 8052 (Advanced

Technology Memory and Logic) is the IC, which was developed to control peripheral devices, alleviating the load from the main CPU. Compared to a human being, the brain is the main CPU and the PIC is equivalent to the autonomic nervous system. The clock frequency determines the speed at which a program is read and an instruction is executed. The circuit diagram of PIC in fig.4.4

Figure 4.4 AT89S52 Microcontroller Circuit

4.4. RFID READED AND RFID TAG


RFID is the Radio Frequency identification. The RFID system consists of two parts; 1. RFID reader 2. RFID tag

25

These tags contain transponders that emit messages readable by specialized RFID readers. A reader retrieves information about the ID numbers from a database, and acts upon it accordingly. The specified information is stored in the tags. Whenever the tag comes nearer to the reader, then the RFID tag reader reads that information by transmitting the RF signal.

4.4.1 Working principle of rfid:


RFID will slowly replace the typical bar-code as CDs replaced vinyl records - although they won't go away completely.Radio frequency identification (RFID) technology, so far confined to warehouse tracking and other small-area applications, is now can be used to track vehicles. This new system is related to hit the vehicle tracking market, where card- swiping equipment is the norm. The communication between the tag and the tag reader is RF communication. The RF signal is transmitted by the TAG reader; through this signal only the RFID reader can read the information which is stored in the RFID tag.

4.4.2 RFID Tag:


RFID tags come in three general varieties: - passive, active, or semi-passive (also known as battery-assisted or semi-active) and beacon types. Passive tags require no internal power source, thus being pure passive devices (they are only active when a reader is nearby to power them by wireless illumination), whereas semi-passive and active tags require a power source, usually a small battery. Beacon tags transmit autonomously with a certain blink pattern and do not respond to interrogation.

26

1. Passive tag: Passive RFID tags have no internal power supply. The minute electrical current induced in the antenna by the incoming radio frequency signal provides just enough power for the integrated circuit in the tag to power up and transmit a response. 2. Active tag: Active RFID tags have their own internal power source, which is used to power the integrated circuits and to broadcast the response signal to the reader. Active tags, due to their onboard power supply, also may transmit at higher power levels than passive tags, allowing them to be more robust in "RF challenged" environments.

4.4.3 RFID Reader:


An RFID reader is a device that is used to interrogate an RFID tag. The reader has an antenna that emits radio waves; the tag responds by sending back its data. A number of factors can affect the distance at which a tag can be read (the read range). The frequency used for identification, the antenna gain, the orientation and polarization of the reader antenna and the transponder antenna, as well as the placement of the tag on the object to be identified will all have an impact on the RFID systems read range. The objects are fitted with RFID transponders (tags), whereby their movement is tracked, monitored and managed. Each vehicle has been designated a unique ID. Monitoring is done and updated every half-an-hour, as the vehicle moves along the highway. The system uses different instruments such as RFID tags, RFID reader for capturing vehicle information. The data is then transferred to centralized server. The registered user can log on to the system through internet and can view the current status of the vehicle. For example we can use the Passive RFID tags are used in retail stores to reduce shoplifting. These are the little white tags you find attached to clothing items and hidden in the pages of books the pet may also have an RFID "chip" implanted in its neck to help bring him / her back if ever lost. RFID is also used in the "express" lane of the toll-booth by millions every day.

27

4.5. DC Motor:
An electric motor uses electrical energy to produce mechanical energy. The reverse process that of using mechanical energy to produce electrical energy, is accomplished by a generator or dynamo. Tractions motor used on locomotives often perform both tasks if the locomotive is equipped with dynamic brakes. Electric motors are found in household appliances such as fans, refrigerators, washing machines, pool pumps, floor vacuums, and fan-forced ovens.

4.5.1. DC Motor circuit diagram:


A DC motor is an electric motor that runs on direct current (DC) electricity. The Diagram of the DC Motor Interface is shown in figure 4.5

Figure 4.5 DC Motor Circuit diagram

28

4.5.2 RS232:

Figure 4.6 RS232 Circuit Diagram In telecommunications, RS-232 (Recommended Standard 232) is a standard for serial binary single-ended data and control signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment).

29

4.6. CIRCUIT DIAGRAM OF THE SYSTEM DESIGN INVOLVES IN THE FOLLOWING TWO CIRCUITS: 4.6.1. System module with the transmitter/receiver

Figure 4.7 CIRCUIT: System Side

30

4.6.2. Hardware module circuit diagram in the model:

VDD
12V

2x16 LCD DISPLAY

X1
5V

VDD
IO9 IO10 IO11 IO12 IO13 IO14 IO15 IO16

S1
12V M

VCC

10K _LIN Key = A 5V

IO1 IO2 IO3 IO4 IO5 IO6 IO7 IO8

COIL NO NC

ULN2003A VCC
5V 5V

R6

50% 5V

VCC

VCC X2
IO1 IO2 IO3 IO4 IO5 IO6 IO7 IO8 IO9 IO10 IO11 IO12 IO13 IO14 IO15 IO16 IO17 IO18 IO19 IO20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21

R8 R11
5V

VCC C2 R10
10uF 1.00K 100K

10.0K

Key = Space RE SE T SW ITCH

J2

R9

Q2

1.00K

VCC

LED3

LED4

2N2222A

R1

10k

VCC
5V

R2 R7 R5 Q1

C3

33pF

X3

AT89S52 MC
1.00K

10.0K 100K

HC-49/U_11M Hz

R4

C4

33pF

1.00K

LED1

LED2

2N2222A

SW

Figure 4.8 CIRCUIT: Robot Side

31

4.7.1 Protocol of the robot


The Robot checks for the status and if it gets the command GOTO the robot understands it has to return. If the Command is COME the robot understands it has to issue. The books are located in locations 1, 2 and 3. So the location number is sent to the robot to make the robot go to that location

Figure 4.9 Protocol Robot Side

32

4.7.2 Protocol on the sender side


The sender checks for the status that the user wants to update and sends the status to the robot and then again sends the location to the robot. This sender also sends the book number by reading it from RFID reader.

Figure 4.10 Protocol Sender Side

33

4.8.1 Front view (i-pup)

Figure 4.11 Front View

34

4.8.2 Side view (i-pup)

Figure 4.12 Side view

35

5. SOFTWARE DESIGNS IMPLEMENTATION


5.1. INTRODUCTION:
The aim of the software design was to build a library management system. The system should be user friendly. The design of the software includes the following primitive modules: 1)Interactive GUI Design 2)Database 3)Communication There is never a completion without an interactive interface to operate on any software been created, I have also designed an interactive Graphical User Interface for the end user to work on my system with ease and comfort.

5.2 NOTATIONS
Actor: An actor in the Unified Modeling Language (UML) specifies a role played by a user or any other system that interacts with the subject.

DATA FLOWS: Data move in a specific direction from an origin to a designation. The data flow is a packet of data.

PROCESS: People, procedure and devices that produce data. The physical components is not identified.

36

SERVICES: The services provided by the various components.

DECISION BOX: This is the decision making box. The condition is given inside and the flow is branched into two streams upon the condition.

DATA SOURCE: Data referenced by a process in the system

37

5.2.1 Use case diagram:


A use case diagram in the Unified Modeling Language (UML) is a type of behavioral diagram defined by and created from a Use-case analysis. Its purpose is to present a graphical overview of the functionality provided by a system in terms of actors, their goals (represented as use cases), and any dependencies between those use cases. The main purpose of a use case diagram is to show what system functions are performed for which actor.

Figure 5.1 Use case diagram

38

5.2.2 Activity diagram


Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams can be used to describe the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control.

Figure 5.2 Activity Diagram

39

5.2.3 Sequence diagram


A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that shows how processes operate with one another and in what order. It is a construct of a Message Sequence Chart. Sequence diagrams are sometimes called Event-trace diagrams

Figure 5.3 Sequence Diagram

40

5.2.4 Class diagram


A class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, and the relationships between the classes.

Figure 5.4 Class Diagram

5.3.1 Classes in package lims


Class Summary AdminPage cdate demo Enter LogPage MemberPage staff TableDisp 41

5.3.2 Hierarchy for package lims Class hierarchy


o

java.lang.Object
o o

lims.cdate java.awt.Component java.awt.Container


o

(implements

java.awt.image.ImageObserver,

java.awt.MenuContainer, java.io.Serializable)
o

java.awt.Window (implements javax.accessibility.Accessible)


o

java.awt.Frame (implements java.awt.MenuContainer)


o

javax.swing.JFrame javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants)


o o o o o o o

(implements

lims.AdminPage lims.demo lims.Enter lims.LogPage lims.MemberPage lims.staff lims.TableDisp

1) Class Enter java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.Enter 42

2) Class AdminPage java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.AdminPage 3) Class cdate java.lang.Object lims.cdate 4) Class demo (Search page) java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.demo 5) Class LogPage java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.LogPage 6) Class MemberPage java.lang.Object 43

java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.MemberPage 7) Class staff java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.staff 8) Class TableDisp java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame lims.TableDisp

44

5.4 Database:
In this project the data have to be stored in a database from which data have to be rectified and return functions. In this project the database being used is MySQL. MySQL is a relational database management system (RDBMS)[1] that runs as a server providing multi-user access to a number of databases. MySQL works on many different system platforms, including AIX, BSDi, FreeBSD, HP-UX, i5/OS, Linux, Mac OS X, NetBSD, Novell NetWare, OpenBSD, OpenSolaris, eComStation, OS/2 Warp, QNX, IRIX, Solaris, Symbian, SunOS, SCO OpenServer, SCO UnixWare, Sanos, Tru64 and Microsoft Windows. A port of MySQL to OpenVMS also exists. To connect the java application to the database the JDBC-MySQL connector Driver has to be imported and the connection code has to be included. Tables: There are 5 Tables being included in this project they are, Adminlog Stores admin and staff username and password.

Table 5.1 Admin Table Bk Stores the details of the books in the system.

Table 5.2 Book Table

45

Bksearch List of books searched with the key word.

Table 5.3 Book Search Table Userdata List of information of the user.

Table 5.4 User Data Table Usernpasswd User name and password of the users.

Table 5.5 User and password Table

5.5 COMMUNICATION API


The Java Communications (a.k.a. javax.comm) API is a proposed standard extension that enables authors of communications applications to write Java software that accesses communications ports in a platform-independent way. This API may be used to write terminal emulation software, fax software, smart-card reader software, and so on Developing good software usually means having some clearly defined interfaces. The high-level diagram of the API interface layers are shown in this figure.

Figure 5.5 Comm API

46

5.5.1 The javax.comm api: what is provided


The javax.comm API provides the following functionality to developers: A complete API specification for serial and parallel communication ports. Without a common API in your development efforts, workload will increase because you'll have to provide support to serial devices. Full control of all serial framing parameters (baud stop bits, parity, bits/frame) as well as manual or automatic control of the flow control lines. Normally, in RS-232, there are two signal lines and the rest are intended for control lines. Depending on the type of communication (synchronous or asynchronous), the number of control lines selected may vary. This API provides access to the underlying control signals. The basic I/O via a subclass of Java IO streams. For input and output, the javax.comm API uses streams; the concept of streams should be familiar to all Java programmers. It is important to reuse Java concepts when building new functionality or the APIs will become unwieldy. Streams that can be extended to provide client flow control and threshold controls.

5.6 INTERACTIVE GUI MODULE:


The GUI module was tested for the ease of access by asking an external person to work on the application GUI that we have created for the system to be operated by the soldier in the future. Thus the GUI was found to be ease and an integrated environment to control the vehicle.

47

6. TESTING
Testing is the stage of implementation, which is aimed at ensuring the system works accurately and efficiently before live operation commences. System testing makes the logical assumption that if all the parts of the system are correct, the goal will be successfully achieved. The testing for the system was carried out in the following two development stages Hardware testing Software testing

6.1. HARDWARE TESTING:


The hardware testing of the system was done during the development of the mobility development stage and the arm movement where I achieved the mobility of the system, the videos taken during the stages of different testing has been attached with the soft copy of the documentation. During this time I underwent the real modifications that were done to make the mobility and arm movement of the system more efficient. I found disabilities in the Chain; therefore the length of the chain had to be changed frequently. The spiral gear on the finger also had some teeth problem which in turn had to be changed two times. Finally we made the modification and succeeded in achieving the motion of the robot and the fingers.

6.2. SOFTWARE TESTING:


The software testing of the system has been considered with a lot of methods of software testing strategies. Some of the testing methods that we have subjected to the system application are as follows: Unit Testing Integration Testing

48

6.2.1. Unit testing:


Unit testing tests the minimal software component and sub-component or modules by the programmers. In computer programming, unit testing is a procedure used to validate that individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, web page, menu etc, while in object-oriented programming, the smallest unit is always a Class; which may be a base/super class, abstract class or derived/child class. Units are distinguished from modules in that modules are typically made up of units.

6.2.2. Interactive gui module:


The GUI module was tested for the ease of access by asking an external person to work on the application GUI that we have created for the system to be operated by the soldier in the future. Thus the GUI was found to be ease and an integrated environment to control the vehicle.

6.3. I NT E G RA T I O N T E S T I NG :
Integration testing exposes defects in the interfaces and interaction between integrated components (modules). Integration testing is the phase of software testing in which individual software modules are combined and tested as a group. It follows unit testing and precedes system testing. We tested the integrated GUI by integrating the unit modules that have been tested in my unit testing and was successful in achieving an integrated GUI to control my robot model. The test cases are being displayed below.

49

6.4. TEST CASES:


Login Input: valid username and password. Desired Output: You have been logged in successfully. Actual Output: Enter the valid username and password. Test result: Success SERIAL PORT WRITE/READ : Input: Open port Desired Output: Written to port Actual Output: Exception arise (Run time error) Test result: Failure Remark: null point exception (The opened serial port wasnt closed) MEMBERS PAGE: Input: Read from database Desired Output: Display the details Actual Output: Displayed the details Test result: Success

50

7. USER MANUAL
We have developed a basic model of the system from the real system that can be used in the war fields. Thus the system can be used by any kind of user with ease of operation developed in the interactive GUI application.

7.1. STEPS FOR EXECUTION OF THE ROBOT i-LiBot:


The Model is given power by plugging in the 12V power supply to the microcontroller in the beginning and then to the stepper motor and the DC motor. Once the power is given to the model, switch on the transmitter/receiver in the side of the PC. Now the system is ready for working and get commands from the user. Execute the JAR file that I have created for my integrated GUI.

Open the GUI Application and perform the necessary operation to carry out the system working.

51

8. CONCLUSION
I have created an idea model of the Intelligent Librarian Robot that can be operated in library environment and assist the human efforts. These robots can replace the human work completely provided full efficiency and accuracy. This idea of building a library robot is being undergone in many places throughout the world. The world book bank has also implemented a mechanical model for automatic book receive and return, but the system is more costly, less intelligent, and not suitable for human interaction. These disadvantages of the existing system will be replaced by this robot. I-LiBot can not only be introduced in library, but it can work where ever assistances and a pick and place job is required. I conclude by summing up all my efforts of hardship that I have designed an Intelligent robot that can replace human effort to the maximum.

52

9. FUTURE ENHANCEMENTS
The Library robot was not only designed for the purpose of library but it can be implemented in any location where a pick and place assistant is required. The technology of augmented reality can be implemented in the library robot. So that the user can confirm his book from the place he is located. In the current project only front and back is being processed. This can be changed with the angular motors and can move on both X and Y axis. Here only one robot is shown underworking. This can be increased to multi-robots for multiprocessing. The point to point making algorithm is being used in front and back process, which is pretty easy. This can be implemented in the graph marking where the shortest path has to be implemented. The hand process is being now done on calculated process. This can be changed with the sensor based feedback to make the book picking accurate and faster. There are many more enhancements that can be done on this robot.

53

REFERENCES
BOOKS:
1.

H.M.Deitel, P.J.Deitel, Java: how to program, Fifth edition, Prentice Hall of India private limited. Mohamed Ali Mazidi, Janice Gillispie Mazidi, The 8051 microcontroller and embedded systems, Pearson education, 2004. Java: The Complete Reference, Seventh Edition (Complete Reference Series) by Herbert Schildt "Microprocessor Based Robotics", Mark J. Robillard Howard Sams and Co. 1983 Kinematic Design of Machines and Mechanisms by Homer D. Eckhardt The Art of Gear Fabrication by Prem H Daryani

2.

3.

4. 5. 6.

SURFED SPOTS: http://java.sun.com http://www.jfree.org/ http://www.netbeans.org/

54

APPENDIX -A Sample Code


1. Robot RX Program:
void leg_motor_fw() {RELAY4=0; RELAY3=1;} void arm_Motor_fw() {RELAY8=0; RELAY7=1;} void arm_Hand_fw() {RELAY6=1; RELAY5=0;} void leg_motor_rw() {RELAY4=1; RELAY3=0;} void arm_Motor_rw() {RELAY8=1; RELAY7=0;} void arm_Hand_rw() {RELAY6=0; RELAY5=1;} void main() {while(1) { if(P1==0xF1) //retern mode { arm_Motor_fw(); ddlay(60000); stop_mot(); 55

arm_Hand_fw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); leg_motor_fw();//distance forwared delay(60000); stop_mot(); arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_rw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); leg_motor_rw();//distance reverse ddlay(60000); stop_mot();} if(P1==0xF2) //retern mode { arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_fw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); 56

leg_motor_fw();//distance forwared delay(60000);delay(60000); stop_mot(); arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_rw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); leg_motor_rw();//distance reverse delay(60000);delay(60000); stop_mot();} if(P1==0xF3) //retern mode { arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_fw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); leg_motor_fw();//distance forwared delay(60000);delay(60000);delay(60000); stop_mot(); arm_Motor_fw(); ddlay(60000); stop_mot(); 57

arm_Hand_rw(); ddlay(60000); stop_mot(); arm_Motor_rw(); ddlay(50000); stop_mot(); leg_motor_rw();//distance reverse delay(60000);delay(60000);delay(60000); stop_mot();} if(P1==0xF4) //issu mode { leg_motor_fw();//distance forwared ddlay(60000); stop_mot(); arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_fw(); ddlay(50000); stop_mot(); arm_Motor_rw(); ddlay(60000); stop_mot(); leg_motor_rw();//distance reverse delay(60000); stop_mot(); arm_Motor_fw(); ddlay(60000); stop_mot(); arm_Hand_rw(); ddlay(50000); stop_mot(); 58

arm_Motor_rw(); ddlay(60000); stop_mot();} if(P1==0xF5) //issu mode { leg_motor_fw();//distance forwared delay(60000); delay(60000); arm_Motor_fw(); ddlay(60000); arm_Hand_fw(); ddlay(50000); arm_Motor_rw(); ddlay(60000); leg_motor_rw();//distance reverse delay(60000); delay(60000); arm_Motor_fw(); ddlay(60000); arm_Hand_rw(); ddlay(60000); arm_Motor_rw(); ddlay(50000); stop_mot();} if(P1==0xF6) //issu mode { leg_motor_fw();//distance forwared delay(60000); delay(60000); delay(60000); arm_Motor_fw(); ddlay(50000); arm_Hand_fw(); ddlay(60000); arm_Motor_rw(); delay(60000); leg_motor_rw();//distance reverse 59

delay(60000); delay(60000); delay(60000); arm_Motor_fw(); ddlay(60000); arm_Hand_rw(); ddlay(60000); arm_Motor_rw(); ddlay(50000); stop_mot();} else }} { stop_mot(); ddlay(60000); }

2. Robot TX Program:
while(1) { reciv_dat=strstr(rex,"28006F79A1"); lenth=strlen(reciv_dat); if(lenth>7) { trans('A'); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"28006F49AB"); lenth=strlen(reciv_dat); if(lenth>7) { trans('B'); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"28006F8062"); lenth=strlen(reciv_dat); 60

if(lenth>7) { trans('C'); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"GOTO1"); lenth=strlen(reciv_dat); if(lenth>2) { P1=0xF1; delay_tx(); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"GOTO2"); lenth=strlen(reciv_dat); if(lenth>2) { P1=0xF2; delay_tx(); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"GOTO3"); lenth=strlen(reciv_dat); if(lenth>2) { P1=0xF3; delay_tx(); clear_buff(); 61

ser_count=0; } reciv_dat=strstr(rex,"COME1"); lenth=strlen(reciv_dat); if(lenth>2) { P1=0xF4; delay_tx(); clear_buff(); ser_count=0; } reciv_dat=strstr(rex,"COME2"); lenth=strlen(reciv_dat); if(lenth>2) {P1=0xF5; delay_tx(); clear_buff(); ser_count=0;} reciv_dat=strstr(rex,"COME3"); lenth=strlen(reciv_dat); if(lenth>2) {P1=0xF6; delay_tx(); clear_buff(); ser_count=0; } else {P1=0xF7; }

62

3. SERIAL PORT COMMUNICATION CODE: 3.1 Simple Read:


public class SimpleRead implements Runnable, SerialPortEventListener { CommPortIdentifier portId; Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; StringBuffer strBuf = new StringBuffer(); public static void main(String[] args) { System.out.println("1"); SimpleRead reader = new SimpleRead(); } public SimpleRead() { System.out.println("1"); portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { System.out.println("2"); portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("3"+portId.getName()); if (portId.getName().equals("COM1")) { System.out.println("4"); try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { } 63

try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { } serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } readThread = new Thread(this); readThread.start(); } } } } public void run() { try { System.out.println("inside run"); Thread.sleep(20000); } catch (InterruptedException e) { } } public String readValue(){ return strBuf.toString(); } public void closePort(){ serialPort.close(); } 64

public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } strBuf.append(new String(readBuffer)); System.out.print(new String(readBuffer)); } catch (IOException e) { } break; } } }

65

3.2 Simple Write:


public class SimpleWrite { private static String defaultPort; private static boolean portFound; static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!\n"; static SerialPort serialPort; static OutputStream outputStream; public void TrialStart() { portFound=false; // determine the name of the serial port on several operating systems String osname = System.getProperty("os.name","").toLowerCase(); if ( osname.startsWith("windows") ) { System.out.println("windows"); // windows defaultPort = "COM1"; } else if (osname.startsWith("linux")) { // linux defaultPort = "/dev/ttyS0"; } else if ( osname.startsWith("mac") ) { // mac defaultPort = "????"; } else { System.out.println("Sorry, your operating system is not supported"); return; } System.out.println("Set default port to "+defaultPort); portList = CommPortIdentifier.getPortIdentifiers(); 66

while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {e.printStackTrace();} try { // write string to serial port outputStream.write(messageString.getBytes()); System.out.println("Writing \""+messageString+"\" to "+serialPort.getName()); } catch (IOException e) {} } } 67

} serialPort.close(); } public SimpleWrite() { TrialStart(); } public static void main(String args[]) { SimpleWrite obj=new SimpleWrite(); } void Setmessage(String as) { SimpleWrite.messageString=as; } }

68

APPENDIX -B
1. PIN DETAILS OF AT89S52:

69

APPENDIX -C SCREEN SHOTS

Opening page

70

First Page (Welcome Page)

71

Admin Page

72

Add Member

73

Add Book

74

Delete Member

75

Delete Book

76

Login Page

77

Librarian Page (Staff Page)

78

Issue Book

79

Return Book

80

Member Page

81

Change Password

Search Page

82

Table Display

83

i-Pup (Perspective View - Base)

84

i-Pup (Side View - Base)

85

i-Pup (Arm)

86

i-Pup (Finger working)

87

i-Pup (With Base, Hand and Body)

88

i-Pup (Model Perspective View)

89

i-Pup (Side View)

90

i-Pup (Top View)

91

Anda mungkin juga menyukai