An Electromechanical Device Robot Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

In this new era of technology, many devices have been produced to make people life easier. Robot, an electromechanical device automates the work in many applications like military, Industrial Power Plant and others. Robots are reliable means to bring object, do settings at places where human interventions is rather impossible or can cause hazardous effect on human health for example at nuclear power plants, chemical factories and many more. A modern and efficient sewerage system is vital for the country so as to ensure that wastewater is treated before being discharged into our rivers. This will help preserve the country's waste resources, protect public health and provide a cleaner and safer environment. A physical survey will be performed to isolate the problem areas and to determine the general physical conditions of the sewer sections, which are identified for rehabilitation work. Manhole and sewer inspection will determine the actual condition of the sewer system. An inventory of the length, size, type, depth and the general conditions of the sewer pipes would provide a basis for the estimation of work required for the preparatory cleaning and internal inspection. The depth of flow in the sewers would provide a rough indication of the capacity of the sewer and whether or not inflow/infiltration (I/I) is present in the particular section of sewer.


1.1 Problem Statement

Current situation, they are using a manpower to check situation inside the tunnel. In Malaysia, to survey the sewer, workers had to hazard his life to enter into the sewer to do surveys. The workers need to come down every time and since the tunnel is disgusting, it highly risk for the workers to get infected from any diseases.

For certain country, their robot has been build using a cable. The major problem using a cable is how far the robot can go to view the situation inside the tunnel. The range is very limited plus the cost for every meter for the cable is high.

Another problem is what type of wireless will be use in this project. There has Bluetooth, Infrared and Wi-Fi. Every type of wireless has their advantage and disadvantage. The type of wireless will be decided according to the scope for this project.

1.2 Project Objective

There are few objectives that can be obtained from this project:

To develop and design a prototype robotic controlled wirelessly through a computer. The robot will transmit video images back to the computer and receive directions.

To monitor microcontroller of prototype robotic received data from computer.

1.3 Project Scope

This project is to build the robot for Indah Water tunnel. It will be use to view the situation inside the tunnel whether the tunnel has a liking or not. For the prototype, it will cover the classroom area. The robot will be embedded the Bluetooth device which make it can be control with computer using application through the wireless. The range should at least work in approximately 20 to 50 meters range.

This prototype embedded the Audio/Video camera that combined with infrared LED for viewing the situation even in the dark situation. Bluetooth device is for wireless transmission and microcontroller which acts as a 'brain' for the robot. Visual Basic will be use to design the interface to sent the command. The C language will be use to program the microcontroller to received command from computer and to instruct the robot what to do and the MPLAB application will be use to 'burn' the programming into the microcontroller.

1.4 Project Significant

This project will be focus for Indah Water Company. Indah Water Konsortium Sdn Bhd (IWK) is a national sewerage company in Malaysia. IWK is wholly government-owned company which has been entrusted with the task of developing and maintaining a modern and efficient sewerage system for all Malaysians. IWK still using people to inspect the dangerous sewer different with modern country like United States they are using camera truck.

But to develop the equipment is too expensive. The prototype can be use to replace the camera truck and IWK can afford to buy this prototype. This robot is not only for those in the sanitary sewer system industry, but any other industries that have similar working environment as in the tunnel can use our prototype for surveying proposes.



2.0 What is the definition of a 'robot'?

An electromechanical device, automates the work in many application like military application, Industrial Power Plant and others. Robots are reliable means to bring objects, setting at places where human interventions is rather impossible or can cause hazardous effect on human health for example, at nuclear power plants, chemical factories, sewerage system or any others places.

Robots are categorized based on the type of control mechanism into two types:

Autonomous robot

These robots have to think itself and take decision on behalf of human on many aspects. This is due to deep development in the field of Artificial Intelligence. These robots though are better having not become popular in market due to several reasons:

Autonomous Robots have decision capabilities but at many places like nuclear power plant, decision must be taken by the expert persons handling the power plant and not by the robot, else some disasters may occur.

When a robot is used a spy, it must be handled by military authority as some decisions require some harsh decision initially to get benefit later.

Cost of the making and programming of autonomous robots is very high.

Non-Autonomous Robot

These robots have the programming logic to do the desired task but the decision power lies in the hand of the controller handling the robot. The interface between the controllers can be made using two methods:

Wired - Here the connection between the controller and robot is maintained using wired interfaces. These interfaces can be serial or parallel and in both these techniques, the underlying technology is transmission of the electrical signals, which are sent in form of specific patterns, and the robot to carry out the specific task analyzes these patterns. These signals sent are analyzed by microcontroller mounted on the robot.

Wireless - Here the connection between the controller and robot is maintained using wireless interfaces (Radio Frequency) such as:





The underlying technology is transmission of the signals wirelessly in air by the transmitter, which are captured by the receiver and sent to microcontroller mounted on the robot to carry out the decision.

For this project, we will develops the 2nd mechanism which is non-autonomous using Bluetooth wireless method.

2.1 What is a PIC Microcontroller?

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Programmable Interface Controller". PIC microcontroller is a chip that can be downloading the program inside and make the system do what we want. PIC microcontroller is used in the embedded system to combine between hardware and firmware. There have two languages that can be used to program the PIC microcontroller, which are assembly language and C language. The characteristic of PIC microcontroller is:

PIC microcontrollers are embedded inside some other device so that they can control the features or actions of the product.

PIC microcontrollers are dedicated to one task and run one specific program. The program is stored in read only memory (ROM).

PIC microcontrollers are often low-power devices. A desktop computer is almost always plugged into a wall socket and might consume 50 watts of electricity. A battery-operated might consume 50 milliwatts.

A PIC microcontroller has a dedicated input device and often has a small LED or LCD display for output. A microcontroller also takes input from the device it is controlling and controls the device by sending signals to different components in the device.

A PIC microcontroller is often small and low cost. The components are chosen to minimize size and to be as inexpensive as possible.

2.1.1 PIC Microcontroller

There are too many PIC microcontroller type in market nowadays. Each one of them has it advantage and were used for any purpose. Since there a lot of type of PIC microcontroller, research has been done to choose the better one for this project. Here is some PIC microcontroller type that has been search:

Table 1: PIC Microcontroller type

2.1.2 Interrupt

Microcontrollers must provide real time (predictable, though not necessarily fast) response to events in the embedded system they are controlling. When certain events occur, an interrupt system can signal the processor to suspend processing the current instruction sequence and to begin an interrupt service routine (ISR, or "interrupt handler"). The ISR will perform any processing required based on the source of the interrupt before returning to the original instruction sequence. Possible interrupt sources are device dependent, and often include events such as an internal timer overflow, completing an analog to digital conversion, a logic level change on an input such as from a button being pressed, and data received on a communication link. Where power consumption is important as in battery operated devices, interrupts may also wake a microcontroller from a low power sleep state where the processor is halted until required to do something by a peripheral event.

2.2 Universal Asynchronous Receiver/Transmitter (UART)

The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications subsystem of a computer. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes.

Serial transmission is commonly used with modems and for non-networked communication between computers, terminals and other devices. There are two primary forms of serial transmission: Synchronous and Asynchronous. Depending on the modes that are supported by the hardware, the name of the communication sub-system will usually include a A if it supports Asynchronous communications, and a S if it supports Synchronous communications. Some common are:

UART Universal Asynchronous Receiver/Transmitter

USART Universal Synchronous-Asynchronous Receiver/Transmitter

2.2.1 Synchronous Serial Transmission

Synchronous serial transmission requires that the sender and receiver share a clock with one another, or that the sender provide a strobe or other timing signal so that the receiver knows when to "read" the next bit of the data. In most forms of serial Synchronous communication, if there is no data available at a given instant to transmit, a fill character must be sent instead so that data is always being transmitted. Synchronous communication is usually more efficient because only data bits are transmitted between sender and receiver, and synchronous communication can be more costly if extra wiring and circuits are required to share a clock signal between the sender and receiver.

A form of Synchronous transmission is used with printers and fixed disk devices in that the data is sent on one set of wires while a clock or strobe is sent on a different wire. Printers and fixed disk devices are not normally serial devices because most fixed disk interface standards send an entire word of data for each clock or strobe signal by using a separate wire for each bit of the word. In the PC industry, these are known as Parallel devices.

The standard serial communications hardware in the PC does not support Synchronous operations.

2.2.2 Asynchronous Serial Transmission

Asynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in advance and special bits are added to each word which is used to synchronize the sending and receiving units.

When a word is given to the UART for Asynchronous transmissions, a bit called the "Start Bit" is added to the beginning of each word that is to be transmitted. The Start Bit is used to alert the receiver that a word of data is about to be sent, and to force the clock in the receiver into synchronization with the clock in the transmitter. These two clocks must be accurate enough to not have the frequency drift by more than 10% during the transmission of the remaining bits in the word.

After the start bit, the individual bits of the word of data are sent, with the Least Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted for exactly the same amount of time as all of the other bits, and the receiver "looks" at the wire at approximately halfway through the period assigned to each bit to determine if the bit is a 1 or a 0. For example, if it takes two seconds to send each bit, the receiver will examine the signal to determine if it is a 1 or a 0 after one second has passed, then it will wait two seconds and then examine the value of the next bit, and so on.

The sender does not know when the receiver has "looked" at the value of the bit. The sender only knows when the clock says to begin transmitting the next bit of the word. When the entire data word has been sent, the transmitter may add a parity bit that the transmitter generates. The parity bit may be used by the receiver to perform simple error checking. Then at least one stop bit is sent by the transmitter.

When the receiver has received all of the bits in the data word, it may check for the parity bits, and then the receiver looks for a stop bit. If the stop bit does not appear when it is supposed to, the UART considers the entire word to be garbled and will report a framing error to the host processor when the data word is read. The usual cause of a framing error is that the sender and receiver clocks were not running at the same speed, or that the signal was interrupted.

Regardless of whether the data was received correctly or not, the UART automatically discards the start, parity and stop bits. If the sender and receiver are configured identically, these bits are not passed to the host. If another word is ready for transmission, the start bit for the new word can be sent as soon as the stop bit for the previous word has been sent. Because asynchronous data is "self synchronizing", if there is no data to transmit, the transmission line can be idle.




Methodology can be defined as a strategy and approach to achieve some goal presented as a framework in which related processes made up of activities or steps are grouped. It also can be a guideline to run the project and as a reference for a knowledge sharing purpose.

This project is based on Embedded Design Life Cycle (EDLC) Model which refers to a methodology for embedded systems. The selection of this methodology is based on the concept of embedded systems that require the configuration of hardware and software. This methodology involves six main phase, product specification, hardware and software partitioning, iteration and implementation, detail hardware and software design, hardware and software integration and testing. Below is the diagram about each phase:

C:\Documents and Settings\arestinpeace\Desktop\method.bmp

Figure 3.1: Model of "Embedded Design Life Cycle" adapted from Arnold S. Berger. (2002). Embedded Systems Design an Introduction to Processes, Tools, & Techniques.

3.1 Phase 1 : Product Specification 

In this phase of the product specification to be developed will be identified. The products will be developed here is prototype robotic.

3.2 Phase 2 : Hardware and Software Partition

Since an embedded design will involve both hardware and software components, which portion of the problem will be solve in hardware or software will decide in this phase. The main hardware use to develop this prototype is toy car, LCD, sensor, servo, wireless Bluetooth, PIC microcontroller, computer and camera. Software used was MPLAB and Visual Basic.

3.3 Phase 3 : Iteration and Implementation

In this phase, the hardware and software stop communicate with each other. This phase represents the early design work before the next phase which is detail hardware and software design. Implementation hardware and software will be implemented separately but running in the same period. All hardware and software used will be configured to allow it can communicate between each other.

3.4 Phase 4 : Detail Hardware and Software Design

This phase will involve detail hardware and software design. This architecture includes designing the hardware configuration, user interface, and applications programs. Before installation and wiring is done, the study of how the installation and wiring must be done first. It is intended that the right connections and wiring done.

C:\Documents and Settings\arestinpeace\Desktop\schematic controller robot.JPG

Figure 3.2: Schematic circuit

3.4.1 OverviewC:\Documents and Settings\arestinpeace\Desktop\untitled.bmp

Figure 3.3: Design Architecture

Users will connect the Bluetooth device with laptop or computer. Then user will start the GUI to sent data to the PIC microcontroller. The data will receive into the microcontroller and users can control both the camera and the motor by the request.

3.4.2 Hardware

PIC16F877A it has an on-board RAM(Random Access Memory), EPROM(Erasable Progammable Read Only Memory) an oscillator, a couple of timers and several Input/Output (I/O) pins, serial port and 8 channel Audio to Digital converter. It will use UART serial communication. All the program is install inside this PIC.

C:\Documents and Settings\arestinpeace\Desktop\New Folder (2)\pic.JPG

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02050.JPG

Figure 3.3: PIC Microcontroller and schematic diagram PIC16F877A

3.4.3 Hardware Installation

Figure 3.4 show the circuit that has been used to embedded the PIC Microcontrollers. The LCD will be used for display the data that has been sent. C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02045.JPG

Figure 3.4

Figure 3.5 show that the PIC Microcontroller is embedded to circuit.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02079.JPG

Figure 3.5

Figure 3.6 show the toy car that be used.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02070.JPG

Figure 3.6

Figure 3.7 show the Bluetooth device that been used for transmission.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02048.JPG

Figure 3.7

Figure 3.8 show that Bluetooth device has been embedded to the PIC Microcontroller.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02080.JPG

Figure 3.8

Figure 3.9 show that the A/V camera for users to view the situation.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02078.JPG

Figure 3.9

Figure 3.10 show that the A/V camera has been embedded to the toy car.C:\Users\Shafik\Desktop\gmbr report\DSC02088.JPG

Figure 3.10

Figure 3.11 show that sensor for robotic to automatically stop if there is any other object in front when it moves.C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02245.JPG

Figure 3.11

Figure 3.12 shows that the circuit with PIC Microcontroller embedded to the toy car motor for the final stage before it can be connect to computer.C:\Users\Shafik\Desktop\gmbr report\DSC02089.JPG

Figure 3.12

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02219.JPG

Figure 3.13 show the hardware installation for the prototype robot has been completed.

3.4.4 Software Installation

C language:

There have two languages that can be used to program the PIC, which are assembly language and C language. In general, c language is easy to learn and understand compared to assembly language. For this project, we used C language which is often used with microcontrollers because of its small size, high speed and the access it allows to the real world.

Visual Basic:

For the interface, we used Visual Basic to design. It is because the application is simple and easy to understand.


There are many software and compilers that can be used to program the PIC. MPLAB IDE is a Windows-based Integrated Development Environment (IDE) for the Microchip Technology Incorporated PICmicro microcontroller (MCU) families. MPLAB IDE allows us to write, debug, and optimize PICmicro MCU applications for firmware product designs. MPLAB IDE includes a text editor, simulator, and project manager.

// run all functions


void run(void)


unsigned char rec_data;

speedL = 180;

speedR = 180;






rec_data = bluetooth_data;



if(rec_data=='f') forward();

else if(rec_data=='r') reverse();

else if(rec_data=='k')






else if(rec_data=='l')






else if(rec_data=='s') stop();

if(rec_data=='1') servo1_pos = 5;

else if(rec_data=='2') servo1_pos = 8;

else if(rec_data=='3') servo1_pos = 11;

else if(rec_data=='4') servo1_pos = 14;

else if(rec_data=='5') servo1_pos = 17;

else if(rec_data=='6') servo1_pos = 20;

else if(rec_data=='7') servo1_pos = 23;



while(sensor3==0) reverse();





C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\New Picture (1).bmp

Figure 3.14 : Interface that been used to control the robot.

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\New Picture.bmp

Figure 3.15 : The MPLAB application that been used to program the PIC Microvontroller




Load control panel


Send command

Control robot

Robot moving






3.4.5 Flowchart


Yes No

Figure 3.16: Flowchart

3.5 Phase 5 : Hardware and Software Integration

The process of integrating embedded software and hardware is an exercise in debugging and discovery. This is a process that is very important and complex. Every care should be given to all aspects of hardware and software that can work together. This phase requires a very long period of time.

3.6 Phase 6 : Acceptance Testing

In this phase the wireless network need to be test whether the PC can connect to the Bluetooth or not. All the weakness and error can be corrected in this phase. Other than that, it is important to achieve the objective and aim of the project.




In this chapter, the results and findings get from the development of this project will discuss in details. Each of the topics was based on the results that were accumulated during the project.

4.1 Outputs

The output can be view in LCD whether the PIC microcontroller has received correct data or not. When laptop or computer are connected to the robot, all instruction which is move forward, move left and right, reverse, stop and camera movement can be display as:

Moving forward - f and g

Reverse - r

Moving left - l and m

Moving right - k and j

Stop - s

Camera movement - 1, 2, 3, 4, 5, 6, 7

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02040.JPG

Figure 4.1: Output for stop command

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02035.JPG

Figure 4.2: Output for forward command

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02036.JPG

Figure 4.3: Output for right command

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02037.JPG

Figure 4.4: Output for left command

C:\Documents and Settings\arestinpeace\Desktop\fyp\gmbr report\DSC02038.JPG

Figure 4.5: Output for right command




This chapter explains the conclusions of the project that has been done through all the research and the recommendations that can be used to further enhance the project in the future.

5.1 Conclusion

As the conclusion, this project is completely done and achieved the objective set in the beginning of the project. The first objective of this project is to develop and design a prototype robotic controlled wirelessly through a computer. The robot will transmit video images back to the computer and receive directions. The second objective is to monitor microcontroller of prototype robotic received data from computer. Hopefully, this project will be implemented in the future.

5.2 Recommendations

Regarding to this project, there are a few recommendations that would be useful to this project in the future:

Hopefully this project can use the wireless router instead of others wireless device to communicate between computers and robots.

This robotic can be controlled using internet connection.

The camera can be replaced with a web camera that can capture images and video.