01270 747 008 (UK)

A DIY Robot – PC or Laptop Controlled

This robot was developed as a final year project for Bradford University Cybernetics Department in 2003/2004. This page is a shortened version of the final project report. The full report is available by clicking the link at the bottom of this page.

DIY RobotProject MIRC

MIRC, which stands for Mechanized Interface for Robots and Computers – it is not a robot in itself, but a mechanism for interfacing robotic hardware with standard computer systems (MIRC + Computer = Robot).

This project aimed to develop a modular system (MIRC) for interfacing already commonly available hardware for conducting household or industrial tasks, with standard computers. Ultimately, it was designed to link to an already established infrastructure to develop new and more effective ways of utilizing it.

The MIRC could ultimately enable the technology of the PC to become mobile, thus minimising the need to carry out mundane or repetitive activities and to enable long distance completion of tasks. In the proposed approach, the MIRC was operated by command from a laptop which had been programmed using fuzzy algorithms to carry out basic object avoidance and wheel tracking. By using fuzzy algorithms rather than the more standard IF/THEN statements currently used in programming the MIRC has increased flexibility and potential for adaptation for a range of uses.

Currently most advanced robots are custom made for a particular task and expensive to produce. Other robots are designed simplistically as toys or gadgets, and as such are mass produced and relatively cheap to produce. The MIRC which has been produced as a result of this project combines these factors by using mass produced components to create a technically advanced robotic system which has the additional capacity for customisation, giving endless flexibility. Ultimately it could allow the consumer to purchase a MIRC and then to create a robot custom built for their needs from standard components without the need for extensive knowledge of robotics or expensive outlay.

Robot with laptopPCs today are much faster than they used to be. So much so, that the average computer has enough processing power to adequately analyse sensor data such as stereo video images in real time. Due to the PCs huge variety of applications and its popularity across the world it seemed clear that a robot could be based on this technology. This would allow for USB devices and component upgrades to come from the same sources as normal PC equipment. The same manufacturers could also make the products, allowing it to reach world markets very quickly. The versatility of the PC in part comes from the variety of IO ports it is able to use. This allows it to connect to many different types of hardware, and with ever growing processor power the bandwidth capabilities of the ports grows too. The most important part of the MIRC was the sensors, so a good interface for these was essential. It needed to have the capability of capturing analogue and digital sensor data and also outputting in the same way. A fully constructed model could be capable of many things. If many different manufacturers created USB and FireWire upgrades, the robots could have a huge range of functions. Devices like robot arms, vacuum cleaners, paint sprayers, even robotic legs could be added simply by attaching them in the correct place and installing the software. Wireless networking would enable robots to communicate with each other from almost anywhere and the owner to control them all via the internet.


The aim of this project was to create a prototype MIRC to show how a PC based robot could be developed. The objective was to produce a basic model with four wheels, standard sensors and a web cam forming the centre around which an individual could create their own custom robot with extra USB devices.

It was intended that the structure of the robot should be simple to facilitate easy adaptation and upgrading. The housing was designed to create three distinct layers within the MIRC to separate elements of the robot, thus leaving room to add more devices and a laptop computer when complete. The bottom layer would be designed for battery housing and mechanical hardware, such as wheels and sprockets, the middle layer to contain the main interface electronics, and the top layer to be for the external devices.

The MIRC was developed over a period of eight months. Initially research was conducted into robotic control systems, pc interfaces, sensors and actuators. A K8000 interface board formed the basis of the project, as it allowed for the connection of analogue sensors and actuators to the pc. The PC was chosen rather than built in micro processor because it was far more powerful and customisable.

Sharp IR RangefinderSensors

The first type of sensors needed was proximity detectors. The sensors chosen for this were simple photo reflective IR devices. These sensors consist of an infra red LED and phototransistor in a plastic case; they would output a voltage that was dependant on the amount of IR light hitting the detector. Using analogue sensors enabled development of fuzzy logic to control how the robot avoided objects. These sensors worked well at short range as long as there was no ambient sunlight. It wasn’t until the weather got sunnier that it was realised how much the sunlight would affect operation. Sunshine affected the photo reflective sensors outputs by increasing output to about ¾ of maximum. Adding sunshine sensor and adjusting the other sensor values relative to it stopped the sunshine from making the outputs go too high but it reduced the range so much that they were useless.

A much better type of sensor is the Sharp GPD-12 Infra red range finder. It is much larger in size than the photo reflective sensors but is much more accurate as it measures the angle of the reflected light as well as the intensity. On board signal processing then converts this to an analogue output voltage. The downside to this sensor is that it costs over £10. The GPD-12 is one in a range of infra red range finders by Sharp. They come with various output types and ranges.

Robot Head AssemblyThe head module on the MIRC contains several sensors, one of which is an ultrasonic range finder by Milford instruments [21]. This sensor uses the Polaroid transducer system, which has a single transducer for sending and receiving echoes. This is mounted on a servo for panning and is controlled by a board connected to the computers serial port. Another sensor in the head is a USB webcam of 640*480 pixels. Currently this has not been used in the project as the laptop being used does not support USB. With a more modern laptop this camera could be utilized for many functions, such as object recognition, motion tracking and remote avatar web conferencing.

Ultrasonic SensorOne sensor on the MIRC is an ultrasonic proximity detector. This is the Velleman K3502 parking radar kit. This kit usually sounds a buzzer when an object passes a preset distance from the sensor. To connect this sensor to the K8000 the buzzer was removed and the buzzer output was connected to a digital input on the K8000. There was no need to alter the voltage or the buzzer output, as the K8000 can tolerate a wide range of voltages (5-20V DC).


The main actuators of the MIRC are the two drive motors. Each motor drives one wheel independently. The original design involved using a four wheel drive system. Steering was done using he ‘tank drive’ method. This allows for a zero turning circle and therefore greater manoeuvrability in a small space. This method was found to be insufficient due to large amounts of slippage and torque requirements. The current method employs two large back drive wheels and castors at the front. The steering is done in the same way as the ‘tank drive’, but as the wheels are on the back the turning circle is increased to twice the length of the MIRC. The great reduction in slippage with this method meant that less torque was required and therefore better performance was achieved. The speed and direction of the motors can be controlled via the K8000 and H-Bridge driver board [22]. The motors are fitted with a 148:1 gear box to give greater torque, but this was still insufficient for the ‘tank drive’.
The other actuators are the pan and tilt servos for the head assembly. The panning servo is controlled by the same board that controls the Polaroid transducer range finder. The tilt servo is controlled by a separate board [21] which is capable of controlling up to 8 servos. This board is not currently connected due to the lack of ports on the laptop used in development.

Robot Body (chasis)

The body of the MIRC consists of three layers. The bottom layer is for the drive mechanics and batteries, the middle layer is for the interface electronics and the top layer for the computer and room for expansion. The base was initially made from an aluminium sheet with aluminium shelving brackets along the sides for strength. This eventually had to be changed as the original base did not prove sturdy once the heavy batteries were added. Rapid acceleration and turning caused the whole base to flex, which eventually caused the chains between the motors and wheels to slip, and one of the gearboxes to break. This was one of the main obstacles that was overcome as it slowed progress and wasted funds. The new base is made from a piece of thick MDF with wooden supports for the bearings, and performs much more effectively.


The software currently being used to control the MIRC is written in QBASIC. This language is neither modern nor powerful, but it is relevant to the dated laptop used. At the beginning of the project it was difficult trying to get java programs to work adequately on the laptop. Finally it was realised that the laptops slow processor could not handle all the computation required by this platform independent code. Although QBASIC could not be used to produce an adequate final working program with a GUI, it was sufficient to control the majority of hardware. If a more modern computer had been available to work with better quality programs could have been produced and more advance hardware added. C++ was the preferred language but the editor and compiler were too complex for the laptop used. Editing on a PC and transferring compiled programs to the laptop was not practical due to it having faulty disk drives and communication ports.

Sonar ScanFuzzy Logic Control Software

In order for a robot to function effectively in the home, it must be able to adapt to circumstances that the programmer may not have considered. If the program was not able to learn and adapt, the user would soon find that the robots abilities were quite limited. No matter how many situations and tasks it was programmed to deal with, there would always be something it would fail to ‘understand’. This is why software developed for the MIRC uses fuzzy algorithms.

The current software does not involve fuzzy learning as this will take considerable time to develop, but example programs were created to demonstrate this. The first example does not involve learning but uses fuzzy logic to determine how the MIRC moves. This program (Appendix H) causes the MIRC to act like a finite state machine. [23] The program simply captures data from analogue range sensors on the front and sides of the MIRC. This data is then combined and converted to a value for the speed of each motor. If the MIRC approached an object that was on its left side, the right motor will slow down causing it to move away. The closer the MIRC is to the object the more the wheel will slow down, causing it to turn sharper. The outcome of this is that the MIRC behaves more like an animal than a machine. The QBASIC code for combining the sensor values and changing the motor speed is shown in figure 6 below.


LTemp = (64 – (2 * SQR((((RFront – RFrontC) / 3) * ((RFront – RFrontC) / 3)) + (((sen%(3) – senC%(3)) / 3) * ((sen%(3) – senC%(3)) / 3)))))


Figure 6. Changing speed of the motor, relative to all sensor readings

This is one line of code. LTemp is eventually used as the speed value for the left motor. The other variables are the sensor values. This applied to both motors, causes the effect mentioned previously and also will cause the MIRC to slow down if passing through a small space.

Another example program created was a fuzzy line follower (Appendix I). This program uses similar algorithms to the object avoider program. Two photo reflective sensors are mounted on the front of the MIRC for detecting lines. Different types and colours of lines were tried and the relevant programs created for them, but it was found that slow polling of the sensors would only allow for gently bending lines to be followed. If a faster computer was available, sensor data could be captured faster and therefore sharper bends could be followed.

To demonstrate fuzzy learning, a program was created that simulated evolution. (see A.I.) The program creates a type of predator and prey environment where one species hunts another for food. The prey are just simple circles which move around randomly on the computer screen. Each one has its own set of parameters which define how fast it moves and how erratically it behaves. The predators are the evolving species which eat the prey, move around and breed. Each one has its own unique set of variables which governs behaviour. This is their simulated DNA. When the program starts several prey are generated and one just predator. The ‘DNA’ for this initial predator is randomly generated. It is attracted to the prey so it chases them until it is close enough to eat. Once the predator has eaten enough food it will make a copy of its self but with some slight mutations in its ‘DNA’. The mutations may have positive or negative effects, such as being able to survive longer without food, or becoming less agile. At first the majority of predators will group together, but by the time several generations have lived and died, distinct groups can be seen. Using this method, a robot could be the predator, and the prey could be its charging station or tasks it meant to perform.


The resultant MIRC combined with a laptop appears in presentation as a robot. It has achieved its original objective of mobilisation of which can perform a range of simple tasks determined by the software used. Whilst the project has achieved its aims, there is limitless capacity to develop further to reach its full potential. With funding and further experimentation this humble foundation could prove a stepping stone to real functional usage of this type of technology. The production of an advanced MIRC is possible at a reasonable cost with mass production and as such could impact on everyday life. 
Currently there is no main program or OS. Eventually it will be a mainly fuzzy controlled system. It appears rather pointless trying to create a precise, accurate system as it would cost large amounts of money and time to make it work. The intended outcome is to create a kind of fuzzy logic based cyber pet. This would mean that a MIRC based robot would act more like an animal than a sophisticated machine. Learning algorithms could enable you to teach it tricks just like you do with a dog, rewarding good behaviour and punishing it if it does something wrong. 
Throughout this project a great deal of knowledge has been gained in various areas of cybernetics, and a significant project achievement has been reached. Images of the competed MIRC are available on the attached CD. The MIRC created for this project will continue to provide learning opportunities as it continues to develop and improve. A point to stress is how difficult turning theory into practice actually is. Testing very often showed unexpected results. A lot of time can be used getting things to work the way they were intended to, and very often a compromise is necessary.

Further Work

There is much more work that can be carried out on this project: – Once the oddometry is working effectively, a charging station for the robot could be built to locate when in need of recharging. Armed with a modern laptop, the next step will be to incorporate the webcam and wireless networking. With image processing a robot could recognise objects, rooms or even faces. Another thing to add is a robot arm. There are already robot arms available for purchase that can plug into a USB port, although a custom design may prove more effective. Eventually the entire MIRC will be connectable to a laptop by one single USB cable as this would make connection simple. Also a USB hub could be built in to the MIRC for simple addition of hardware such as robot arms or a barcode reader.

The ability of modern computers to connect to wireless networks is an important factor to the potential success of the MIRC. Being connected to the internet not only gives the MIRC access to large amounts of data. It also means that it could be connected to other networks such as mobile telephone networks. This opens the doors for a whole new interactive system. A person wishing to make a MIRC based security robot could monitor it from anywhere. Data and images could be sent to a multimedia telephone or instructions sent back to it. The most popular use of this is expected to be web conferencing. A person could use the MIRC like a remote avatar, allowing them to ‘step inside’ it and drive it around.

Laptop controlled MIRCs could be networked together, enabling them to work as a team to complete the same objective. This could even be done with the robots in different parts of the world. Groups of robots could be simultaneously controlled by a single user. Using the fuzzy style of programming described earlier, several robots could share all their sensor data and process it between them. This could act like a shared ‘conciseness’ making each individual robot more like a single part of one machine, rather than individual robots communicating and working as a team.

This article is a short version taken from the main project report.
To see the full documentation for Project MIRC, click here.

THere is a new version of this project using moder electronics and software. See the DIY Robot II

Leave a Reply