You are on page 1of 11

LINE FOLLOWING ROBOT

-:

the wheel on that side slows down and the robot will make a right turn. A circuit inside takes an input signal from two sensors and controls the speed of wheels’ rotation. the motor slows down or even stops. in the figure on the right. The control is done in such a way that when a sensor senses a black line.INTRODUCTION-: This simple robot is designed to be able to follow a black line on the ground without getting off the line too much. For instance. Then the difference of rotation speed makes it possible to make turns. if the sensor somehow senses a black line. and two DC motors drive wheels moving forward. The robot has two sensors installed underneath the front part of the body. .

Also called a "computer on a chip." billions of microcontroller units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. Watchdog timer. and also to know about the size. the Atmel AT89S52 is a powerful microcontroller. high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. and we can do it by studying the internal hardware design (devices architecture). volatile memory for input and output (RAM). which provides a highly flexible and cost-effective solution to many. number and the size of the registers. For example. embedded control applications. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip. The AT89S52 provides the following standard features: 8K bytes of Flash. The following picture describes a general block diagram of microcontroller. a single vehicle can use 70 or more microcontrollers. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER: When we have to learn about a new computer we have to familiarize about the machine capability we are using. 32 I/O lines. A microcontroller is a single chip that contains the processor (the CPU). non-volatile memory for the program (ROM or flash). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industrystandard 80C51 instruction set and pinout. 256 bytes of RAM. a clock and an I/O control unit. AT89S52: The AT89S52 is a low-power. two data .

and interrupt system to continue functioning. serial port.pointers. disabling all other chip functions until the next interrupt . on-chip oscillator. a full duplex serial port. a six-vector two-level interrupt architecture. the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. three 16-bit timer/counters. In addition. and clock circuitry. timer/counters. The Power-down mode saves the RAM con-tents but freezes the oscillator. The Idle Mode stops the CPU while allowing the RAM.

the user can then apply the microcontroller to the problems easily.The hardware is driven by a set of program instructions. . or software. Once familiar with hardware and software.

The pin diagram of the 8051 shows all of the input/output pins unique to microcontrollers: The following are some of the capabilities of 8051 microcontroller.  Internal ROM and RAM  I/O ports with programmable pins  Timers and counters  Serial data communication .

4 register banks. each containing 8 registers 80 bits of general purpose data memory 32 input/output pins arranged as four 8 bit ports: P0-P3 Two 16 bit timer/counters: T0-T1 Two external and three internal interrupt sources Oscillator and clock circuits.The 8051 architecture consists of these specific features:           16 bit PC &data pointer (DPTR) 8 bit program status word (PSW) 8 bit stack pointer (SP) Internal ROM 4k Internal RAM of 128 bytes. .

output current is produced. This is done by sending a train of PWM (Pulse Width Modulation) pulses to a power MOSFET in order to turn it on and off. 0PB710F that are already ready in the Electronic Lab. When a light emitted from the diode is reflected off an object and back into the phototransistor. The speed of rotation is proportion to this average voltage. so we can detect the black line somehow by measuring the current. depending on the amount of infrared light.) ii) How to control a DC motor Instead of applying a constant voltage across a DC motor. . The single sensor consists of an infrared emitting diode and a NPN Darlington phototransistor. we repeat switching on and off the motor with a fixed voltage (Vcc) applied to the motor. Then. the amount of light reflected off a black line is much less than that of a white background.THEORY OF OPERATION-: How to sense a black line The sensors used for the project are Reflective Object Sensors. In my case. (This current is converted to voltage. which triggers the base current of the phototransistor. the motor sees the average voltage while it depends on duty cycle of PWM pulses.

All we have to do is to modulate pulse width.By PWM method. in ord BLOCK DIAGRAM-: . it’s easier to control the DC motor than by directly controlling the voltage across it.

I put it down on the track. the robot project wasn’t successful. Next. Overall. I held my robot in the air and I approached a white paper to sensors. I will have to find a suitable DC motor with large torque. Then. This experience hopefully would be helpful in the future work . Even though the chosen DC motor was slowest and gave highest torque among other DC motors in the lab. it didn’t move. building up a circuit by soldering and putting all parts together. but it was quite a fun to go through all the process.CONCLUSION-: For a test. I also realized that there were many things to consider practically such as installation of motors. both wheels rotated as expected and they slowed down when either the paper moved away or sensors passed across a black line. I found the torque of motors not enough to drive my robot. it wasn’t enough. For solving this problem. but unfortunately.

com  About AT89s8252 from www.in .References-:  “8051 and embedded system” by Mazidi and Mazidi  All datasheets from www.co.datasheetcatalog.atmel.triindia.com  And www.