Mini Project Report on
WIRELESS PC CONTROLLED ROBOT MANOEUVRING
By ARSH ARAFAAT
(200412025)
ARUNABH MISHRA
(200412026)
SAURABH SAH
(200412109)
SHASHANK SHEKHAR
(200412114)
In partial fulfillment of the requirements for the award of the degree Bachelor of Technology in Electronics and Communication (2008)
Under the guidance of Prof. Dr. R N Bera (HOD) DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG. SIKKIM MANIPAL INSTITUTE OF TECHNOLOGY MAJITAR, RANGPO, EAST SIKKIM – 737132
(A Constituent College of Sikkim Manipal University of Health, Medical & Technological Sciences)
CERTIFICATE
This is to certify that Mr. Arsh Arafaat (Regd. No. 200412025), Mr. Arunabh Mishra (Regd. No. 200412026), Mr.Saurabh Sah (Regd. No. 200412109) and Mr. Shashank Shekhar (Regd. No. 200412114) students of Bachelor of Technology, VII Semester, Department of Electronics and Communication of Sikkim Manipal Institute of Technology, have pursued the project titled “Image compression using Discrete Cosine Transformation” under the guidance and supervision of Prof. Dr. R N Bera (HOD) and the report has been submitted in partial fulfillment of requirements for the award of the degree, Bachelor of Technology in Electronics and Communication by Sikkim Manipal University of Health, Medical & Technological Sciences in the Year 2008.
Prof. Dr. R N Bera Project Guide
Prof. Dr R. Bera Head of the department Dep’t of E&C, SMIT.
CONTENTS
1) ACKNOWLEDGEMENT
2) INTRODUCTION
3) BASIC BLOCK DIAGRAM
4) BASIC COMPONENT
5) ALGORITHM
6) BASIC BLOCKS
7) DETAILED BLOCK DIAGRAM
8) DETAILS OF THE COMPONENTS i)
Mother Controller(Pentium 4)
ii)
8051 Microcontroller
iii)
Parallel port
iv)
Transmitter
v)
Receiver
vi)
H-Bridge (1)
vii)
DC Motor
viii)
DC Power Supply
ix)
Voltage Regulator(7805)
x)
Robot Body
9) Softwares Used i) Keil C ii) Dev C++
10)
Programs and Flow Charts i) User Terminal ii) Transmitting Microcontroller iii) Receiving Microcontroller
11)
Conclusion
12)
Bibliography
(2)
ACKNOWLEDGEMENT
We take this opportunity to express great sense of gratitude to Brig. Dr. S.N. Mishra (Director, Sikkim Manipal Institute of Technology) and Prof. Dr. R.N. Bera (HOD, Electronics and communication Engineering, Sikkim Manipal Institute of Technology) for providing us the opportunity to carry out this project. Now we also extend our heartiest thanks to our project guide, Prof Dr. R.N. Bera, for his invaluable guidance, support and encouragement during working on the project “wireless controlled Robot”. His effective planning, coordination, skill, knowledge and experience have made it possible to successfully complete the project within the stipulated time. We are also indebted to all the faculty members of ECE and SMIT as a whole and everything we got from here.
Arsh Arafaat
(200412025)
Arunabh Mishra
(200412026)
Saurabh Sah
(200412109)
Shashank Shekhar
(2004120114)
(3)
Introduction In a layman’s word, a robot is a body which performs a task which one wants it to do. According to dictionary we can say : A robot is a mechanical or virtual, artificial agent. It is usually an electromechanical system, which, by its appearance or movements, conveys a sense that it has intent or agency of its own. While there is still discussion about which machines qualify as robots, a typical robot will have several, though not necessarily all of the following properties: is not 'natural' i.e. artificially created can sense its environment, and manipulate or interact with things in it has some degree of intelligence or ability to make choices based on the environment, often using automatic control or a preprogrammed sequence is programmable moves with one or more axes of rotation or translation makes dexterous coordinated movements appears to have intent or agency
What about a robot which reaches the destination which you want it to reach following the directions which you give it while comfortably sitting on your computer terminal! That surely would be some relief to you. The system which we have planned to design is meant for the same task. This system can receive commands from the PC directly wherein the commands are fed by the user specifying the directions in which the robot is to move to reach its destination without bumping into any obstacle on its way.
(4)
BASIC BLOCK DIAGRAM
BASIC CONCEPT
The basic concept is just the overview of the above basic block diagram. As we can see in the above block diagram we take the the commands from the user through a computer and generate some signals. We send these signals to the transmitter through a microcontroller. Transmitter sends these signals to the receiver. The receiver receives the signal and sends it serially to the receiving microcontroller. The receiving microcontroller interprets the signal and generates respective commands. These commands are sent to the motor driving circuit. The motor driver circuit consists of two motors and two HBridges connected to each motor. H-Bridge is a circuit used to drive the motor in both directions without reversing the polarity. So this way we are trying to control the motion of the robot. This a basic way by which we can control the motion.
(5)
ALGORITHM
1. START 2. Get the input from the user. 3. Compare the user input with the respective command. 4. According to the command, generate a signal. 5. Send the generated signal to the parallel port of the computer. 6. Receive the signal from the parallel port of the transmitting microcontroller. 7. According to the input generate signals to be transmitted in the microcontroller. 8. Send the generated signal to the transmitter from the serial port of the microcontroller. 9. Receive the signal from the serial port of the receiving microcontroller. 10. Check the signals according to the transmitted data and generate commands for the motor. 11. Send generated signal to the motor driving circuit from the microcontroller. 12.
If command is to exit go to STEP 14 else go back to the STEP 2.
13.
STOP
(6)
BASIC BLOCKS
Mother controller(Pentium 4) – In the computer
Transmitter unit 1) Transmitting Microcontroller 2) Transmitter
Receiver unit 1) Receiving Microcontroller 2) Reciever
Motor unit 1) H-Bridge 2) DC Motors
On-board power supply 1) DC Battery 2) Voltage Regulator
Robot body
(7)
DETAILED BLOCK DIAGRAM:
(8)
DETAILS OF THE COMPONENTS
1)
Mother controller (Pentium 4)
Produced:
From 2000 to 2008
Manufacturer: Intel CPU speeds: FSB speeds:
1.3 GHz 3.8 GHz
to
400 MT/s to 1066 MT/s
Instruction set: x86 (i386), x86-64 Micro architecture:
Net Burst
The Pentium 4 brand refers to Intel's single-core mainstream desktop and laptop CPUs introduced on November 20, 2000 (August 8, 2008 is the date of last shipments of Pentium 4s). They had the 7th-generation architecture called NetBurst - which was the company's first all-new design since 1995, when the Intel P6 architecture of the Pentium Pro branded CPUs had been introduced. The NetBurst differed from the preceding Intel P6 - of CPUs branded Pentium III, II, etc. - by featuring a very deep instruction pipeline to achieve very high clock speeds (up to 4 GHz) limited only by max. power consumption (TDP) reaching up to 115 W in 3.6–3.8 GHz Prescotts and Prescotts 2M (a high TDP requires an additional cooling that can be noisy or expensive). In 2004, the initial 32-bit x86 instruction set of the Pentium 4 branded microprocessors was extended by the 64-bit x86-64 set.
(9)
2)
8051 Microcontroller
Intel 8051 is CISC architecture which is easy to program in assembly language and also has a good support for High level languages. The memory of the microcontroller can be extended up to 64k. This microcontroller is one of the easiest microcontrollers to learn. The 8051 microcontroller is in the field for more than 20 years. Intel 8051 is CISC architecture which is easy to program in assembly language and also has a good support for High level languages. The memory of the microcontroller can be extended up to 64k.
Architecture of 8051 Architecture is must to learn because before learning new machine it is necessary to learn the capabilities of the machine. This is some thing like before learning about the car you cannot become a good driver. The architecture of the 8051 is given below.
The 8051 doesn’t have any special feature than other microcontroller. The only feature is that it is easy to learn. Architecture makes us to know about the hardware features of the microcontroller.
(10)
The features of the 8051 are 4K Bytes of Flash Memory 128 x 8-Bit Internal RAM Fully Static Operation: 1 MHz to 24 MHz 32 Programmable I/O Lines Two 16-Bit Timer/Counters Six Interrupt Sources (5 Vectored) Programmable Serial Channel Low Power Idle and Power Down Modes
The 8051 has a 8-Bit CPU that means it is able to process 8 bit of data at a time. 8051 has 235 instructions. Some of the important registers and their functions are ACCUMULATOR- All logical & arithmetical operations B-Mainly used in Multiplication & Division Program Status Word (PSW)- Keeps current status of ALU Stack Pointer (SP) -Points the Stack Program Counter (PC)- Location of the next instruction Data Pointer (DPTR) -Points the Location of the Data
Every microprocessor & microcontroller uses clock signals. The clock signals are used to synchronize CPU with other peripherals in the CPU. Clock signals are very much important for a time critical jobs. If the oscillator used is not of good quality we will be surely loosing lots of data in serial communication.
(11)
Pin diagram
(12)
Power supply 8051 can handle power supply of 3.5 volts to 7 volts with no problem. Always use a Decoupling Capacitor between the Power supply and the Ground. Decoupling capacitors are used to avoid the spikes. Pin 40 is for VCC and Pin 20 is for Gnd.
Reset Circuitry As soon as you give the power supply the 8051 doesn’t start. You need to restart for the microcontroller to start. Restarting the microcontroller is nothing but giving a Logic 1 to the reset pin at least for the 2 clock pulses. So it is good to go for a small circuit which can provide the 2 clock pulses as soon as the microcontroller is powered. This is not a big circuit we are just using a capacitor to charge the microcontroller and again discharging via resistor.
Crystals Crystals provide the synchronization of the internal function and to the peripherals. Whenever ever we are using crystals we need to put the capacitor behind it to make it free from noises. It is good to go for a 33pf capacitor. We can also resonators instead of costly crystal which are low cost and external capacitor can be avoided. But the frequency of the resonators varies a lot. And it is strictly not advised when used for communications projects. The 8051 operates based on an external crystal. This is an electrical device which, when energy is applied, emits pulses at a fixed frequency. One can find crystals of virtually any frequency depending on the application requirements. When using an 8051, the most common crystal frequencies are 12 megahertz and 11.059 megahertz--with 11.059 being much more common.
(13)
3)
Parallel port We have used the parallel port of the computer to send the signal from the mother controller(Pentium 4) to the transmitter unit The pins from 2-9 were used to send the signal to the transmitter and 18-25 pins were grounded The pin configuration and register orientation of parallel port is given below:
Parallel communication In telecommunications and computer science, parallel communications is a method of sending several data signals over a communication link at one time. It contrasts with serial communication; this distinction is one way of several ways of characterizing a communications channel. The basic difference between a parallel and a serial communication channel is the number of distinct wires or strands at the physical layer used for simultaneous transmission from a device. Parallel communications implies more than one such wire/strand, in addition to a ground connection.
(14)
4)
Transmitter
Features
Range LOS, Open Ground : 80m Working Voltage : 3 – 12v Dimensions : 22mm x 23mm Working Current : 10 – 15 mA Working Mode : Amplitude Modulation Transport Speed : 4KB/sec Transmit Frequency : 315/433 MHz Transmit Power : 10mW External Antenna : 315 MHz ( use 25cm normal cores or single core wire)
(15)
Amplitude modulation (AM) is a technique used in electronic communication, most commonly for transmitting information via a radio carrier wave. AM works by varying the strength of the transmitted signal in relation to the information being sent. In its basic form, amplitude modulation produces a signal with power concentrated at the carrier frequency and in two adjacent sidebands.
(16)
5)
Reciever
The RX3310A is a fully integrated, amplitude-shift-keying (ASK) modulation, single chip receiver. It is designed to operate in a variety of low power radio applications. All popular radio frequencies from 250 MHz to 450 MHz may be supported by simply choosing the appropriate external components. Particular emphasis has been placed on low current consumption. Average current consumption is 2.6 mA in normal operation mode and 25 mA in power down mode under VCC=3.0volts.
Features
Wide frequency range: 250 MHz to 450 MHz High sensitivity Low power consumption Automotive temperature range High integration level requiring few and inexpensive external components SOP 18L package or SSOP 20L package
(17)
Pin diagram
(18)
6)
H-Bridge
To control a dc motor we have to first convert digital output to a signal which can run motors so we have used the H-bridge. Here we have a simple Hbridge circuit. The motor is denoted by M and the input signals are provided at A and B respectively. An H-bridge is an electronic circuit which enables DC electric motors to be run forwards or backwards. These circuits are often used in robotics. Hbridges are available as integrated circuits, or can be built from separate components.
Structure of a H-bridge (highlighted in red)
The two basic states of a H-bridge. The term "H-bridge" is derived from the typical graphical representation of such a circuit. An H-bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4 (according to the first figure) are closed (and S2 and S3 are open) a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this (19)
voltage is reversed, allowing reverse operation of the motor. Using the nomenclature above, the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4. This condition is known as shootthrough. A solid-state H-bridge is typically constructed using reverse polarity devices (i.e., PNP BJTs or P-channel MOSFETs connected to the high voltage bus and NPN BJTs or N-channel MOSFETs connected to the low voltage bus). The most efficient MOSFET designs use N-channel MOSFETs on both the high side and low side because they typically have a third of the ON resistance of P-channel MOSFETs. This requires a more complex design since charge pump circuits must be used to drive the gates of the high side MOSFETs. However, integrated circuit MOSFET drivers like the Harris Semiconductor HIP4081A make this easy. Often 2 transistors are connected together in a similar configuration as the 2 transistors connected to one end of the motor. Such a configuration is called a "half bridge". A half bridge is used in some switched-mode power supply that use synchronous rectifier, in switching amplifiers -- and of course, 2 half bridges are used to make a whole H-bridge.
(20)
(21)
7) DC Motor
We have used two DC geared motors with power ratings 5-12V. The two motors are placed opposite to each other in a straight alignment which means we will have to provide them with opposite polarity to move the body in a straight line. To turn the body we have to provide power to one of the motor at a time depending on the left or the right turn
8) DC Battery Lead Rechargeable Battery Working Voltage : 12V 1.3 Ampere (less than 0.99amp at startup) 20 Hours Backup Approximate weight : 500 gms (feasible to be mounted on the body) .
(22)
9) Voltage regulator(IC 7805) IC 7805 is a voltage regulator which gives us constant 5V provided it is given a voltage more than 5V. It is a three terminal device with one pin ground one as input voltage and one as output voltage i.e. 5V. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. It may use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages.
Electronic symbol for Voltage regulator
With the exception of shunt regulators, all modern electronic voltage regulators operate by comparing the actual output voltage to some internal fixed reference voltage. Any difference is amplified and used to control the regulation element. This forms a negative feedback servo control loop. If the output voltage is too low, the regulation element is commanded to produce a higher voltage. For some regulators if the output voltage is too high, the regulation element is commanded to produce a lower voltage; however, many just stop sourcing current and depend on the current draw of whatever it is driving to pull the voltage back down. In this way, the output voltage is held roughly constant. The control loop must be carefully designed to produce the desired tradeoff between stability and speed of response.
(23)
10)
Robot Body
It is a three wheel body with two wheels attached to two DC Motors at the posterior of the body and a castor wheel in the front. The three wheels are attached to a polyacrlic sheet. Polyacrlic sheet is a light plastic sheet with high tensile strength which makes it advantageous to use to make robot bodies. The motors used are DC Motors with specifications as mentioned above. The wheels attached to the motors are plastic wheels which are light and tough. The can be easily attached to the motors shaft using a adhesive. The wheel in the front is a castor wheel. The castor wheel is a free rotating wheel with two dimensional degree of freedom i.e. it can move in any direction depending on the direction of force on a plane. The body of the robot should be levelled with respect to a plane surface and wheels should placed according to the centre of the mass of the body. So that the robot can move in a specified direction with optimum speed without changing its direction due to imbalance. Below is a diagram how a robot body will look like:
Fig: ROBOT BODY
(24)
SOFTWARES
Softwares used: 1. KEIL C Keil development tools for the 8051 Microcontroller Architecture support every level of software developer from the professional applications engineer to the student just learning about embedded software development. The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Realtime Kernels, Single-board Computers, and Emulators support all 8051 derivatives and help you get your projects completed on schedule. The Keil 8051 Development Tools are designed to solve the complex problems facing embedded software developers. When starting a new project, simply select the microcontroller you use from the Device Database and the µVision IDE sets all compiler, assembler, linker, and memory options for you. Numerous example programs are included to help you get started with the most popular embedded 8051 devices. The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN, UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your 8051 device. Simulation helps you understand hardware configurations and avoids time wasted on setup problems. Additionally, with simulation, you can write and test applications before target hardware is available. When you are ready to begin testing your software application with target hardware, use the MON51, MON390, MONADI, or FlashMON51 Target Monitors, the ISD51 In-System Debugger, or the ULINK USBJTAG Adapter to download and test program code on your target system.
(25)
2. DEV C++ Dev-C++is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. It can creates native Win32 executables, either console or GUI, as well as DLLs and static libraries. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler. Dev-C++ features are: Support GCC based compilers (Mingw included) Integrated debugging (with GDB) Support for multiple languages (localization) Class and Debug variable Browser Code Completion Function Listing Project Manager Customizable syntax highlighting editor Quickly create Windows, console, static libraries and DLL Support of templates for creating your own project types Make file creation Edit and compile Resource file Tool Manager Find and replace facilities
(26)
PROGRAMS USED:
USER TERMINAL PROGRAM RECEIVING MICROCONTROLLER PROGRAM TRANSMITTING MICROCONTROLLER PROGRAM
(27)
1) USER TERMINAL Flow Chart: START
GET THE INPUT FROM USER
YES
EXIT
STOP NO NO
INPUT FORWARD
NO
NO
INPUT BACKWARD
YES
YES
X= 1000
X= 0100
NO
INPUT LEFT
RIGHT
YES
X= 0010
SEND X TO PARALLEL PORT
DELAY
INPUT
YES
X= 0001
Program: #include
#include #include "pt_ioctl.c" int __cdecl main() { OpenPortTalk(); char input; printf("start"); while(1) { input=getch(); if(input=='w') { outportb(0x378,128); sleep(100); outportb(0x378,255); } if(input=='z') { outportb(0x378,64); sleep(100); outportb(0x378,255); } if(input=='a') { outportb(0x378,32); sleep(100); outportb(0x378,255); } (29)
if(input=='d') { outportb(0x378,16); sleep(100); outportb(0x378,255); } if(input=='s') break; } ClosePortTalk(); }
(30)
2) TRANSMITTING MICROCONTROLLER Flow Chart: START
GET THE INPUT FROM USER
NO INPUT 1000?
NO
NO
INPUT 0100?
YES
YES
SBUF=’l’
SBUF=’a’
NO
INPUT 0010?
0001?
YES
SBUF=’h’
SEND SBUF TO SERIAL PORT
INPUT
YES
SBUF=’z’
Program: #include #include Main () { TMOD = 0x20; TH1=0xFD; SCON=0x50; TR1=1; while(1) { if(P0_0==1) { SBUF='1'; while(TI==0); } TI=0; if(P0_1==1) { SBUF='a'; while(TI==0); } TI=0; if(P2_0==1) { SBUF='h'; while(TI==0); } TI=0; if(P2_1==1) { SBUF='z'; while(TI==0); } TI=0; } } (32)
3) RECEIVING MICROCONTROLLER Flow Chart: START
GET I/P FROM SERIAL PORT
NO NO
SBUF=’l’?
YES
PORT2=0X05
NO
NO
SBUF=’a’ ? YES
PORT2=0X0A
SBUF=’h’ ? YES
PORT2=0X0D
SBUF=’z’?
YES
PORT2=0X07
Program: #include #include void main() { unsigned char mybyte; long int i; TMOD=0x20; TH1=0xFD; SCON=0x50; TR1=1; while(1) { P2=0xFF; while(RI==0); mybyte=SBUF; P1=mybyte; RI=0; if(mybyte == '1') P2=0x05; else if(mybyte == 'a') P2=0x0A; else if(mybyte == 'h') P2=0x0D; else if(mybyte == 'z') P2=0x07; } }
(34)
CONCLUSION
The system was working properly and ninety percent was implemented. The user interface at the computer successfully generated the signals according to the user commands. These signals were successfully transmitted and received at the robot end and checked at the oscilloscope. The received signal was interpreted by the microcontroller at the receiving end and corresponding commands were sent to the motors. The problems faced were in the serial communication at the microcontrollers at both receiving and transmitting side. As the signal was to be synchronized and proper baud rate was to be set. And secondly since we did not include any signal amplification or signal processing block at the receiving side. The signal we received had some noise and more importantly was weak. Due to this there was interrupted motion and it also caused some delay in processing at the receiver side.
(35)
BIBLOGRAPHY BOOKS 1. The 8051 microcontroller and embedded system….M.A. Mazidi and J.G. Mazidi 2. Electronic devices and circuit theory….Boylsted and Nashelsky 3. Electronic Communication Systems….Kenedy and Davis 4. Linear integrated circuits and systems….Gaykwad 5. The 8051 Microcontroller….K.J. Ayala 6. C and 8051….T.W. Schulz INTERNET 1. http://en.wikipedia.org 2. http://www.ieee.org 3. http://www.atmellabs.com 4. http://www.appinlabs.com 5. http://www.smartdata.com 6. http://www.vegakit.com 7. http://www.smartdata.com (36)