Sie sind auf Seite 1von 8

The Simplest Line Follower

Construction
Alright. Lets first look at the circuit for the robot

Here are the parts you will need: Sr . N o. 1. 2. 3. 4. 5.

Part

Description

R1, R2 RV1, RV2 LDR1, LDR2 LED1, LED2 V1

220 1/4W Resistors. 20K Potentiometers (Use presets) Light Dependent Resistors White LEDs Use four 1.5 V batteries. With this you will get 6V. Alternatively you can use four 1.2V batteries to get 4.8V

6. 7. 8. 9.

V2 L293D M1, M2 Breadboar d or PCB

Use a 9V battery The L293D is a motor driver. See http://focus.ti.com/lit/ds/symlink/l293.pdf for the datasheet. Also use a 16-pin IC base if you are soldering the circuit on a PCB. DC Motors. I used 200rpm DC motors. (12V, 2A) A general purpose PCB can be used to solder the components. Alternatively you can also use a breadboard. Ive used a PCB

The circuit can be constructed on a bread board or soldered on to a general purpose PCB. Make sure that the wires connecting the LEDs and LDRs are long enough since they need to look at the line which the robot will follow. Solder the 16-pin IC base to the PCB and then fix the L293D to that. Heres a photograph of the circuit excluding the LEDs and LDRs:

The two connectors on the left are for the motors. I did not solder the connections to the motors directly. Instead, I used 2-pin female RMC connectors for the motors. On the PCB I connected the outputs on the L293D to berg strips (use two pairs of pins one for each motor). With this you can change the polarity of the motors if needed. Once the circuit is done, you will need to put the motors, wheels and circuits together. Heres what you will need: 1. Chassis You could choose any appropriate material you 2. Wheels (see the photograph of the robot below). 3. Caster Wheel (spherical) This is a free moving wheel fixed to the front of the robot.

4. 5.

Spacers. Clamps To fix the motors to the chassis.

In addition to this, I covered the LEDs and LDRs using plastic LED holders. This protects the LDRs from the light of the room (LDRs are extremely sensitive). Next I paired an LED with an LDR and taped the two together. This is what the sensor section looks like:

The sensors were mounted using two cardboard strips. I made two grooves on each strip one for each LED-LDR pair. Fix the motors using clamps and then fix the wheels on to them. Next place the PCB on the top of the base. If you are using a metal base, make sure you insulate the bottom of the PCB with some tape. Fix the caster wheel at the front using spacers between the chassis and the wheel. Finally place the batteries and youre done. Here are photographs of the completed robot:

It shouldnt take you more then a few hours to finish if you are not new to soldering components. In the workshop I conducted, there were participants who were soldering for the first time and they were able to complete the robot successfully in 9 hours (spread over two days).

How Does It Work?

First, lets understand how the sensors work. For that, we need to first look at how an LDR changes its resistance depending on how much light falls on it. The LDR is basically a semiconductor. If you have studied about semiconductors, you will be familiar with the Band Model. We know that a semiconductors crystal has two main energy bands where electrons (or holes) can exist. These are the valence band and the conduction band. The electrons must exist in the conduction band for conduction to take place. However, an Energy gap prevents electrons from moving to the conduction band freely. The electrons need energy to jump to the conduction band. This energy is usually given in the form of electrical energy i.e. by connecting the semiconductor across a voltage source. The energy gap and the number of electrons in the conduction band define the resistance of the material. When light falls on an LDR, the electrons gain energy from this light and move into the conduction band causing the resistance to decrease.

Thats how the LDR works. Light falls on the LDR when light from the LED is reflected off the white surface. Little or no light falls when the sensors are on the black line since reflection wont take place. Now lets see how we can use this as a sensor. Take a look at the circuit again. The LDR and the potentiometer form a voltage divider system:

The voltage at the point between the potentiometer and LDR is connected to the L293D IC. Lets look at two cases. 1. Case 1: When the sensor is placed over the black line, no light falls on the LDR. It thus has a very high resistance, typically in the M range. Suppose the resistance of the LDR is 1M. Thus the voltage at the node is:

2.

Case 2: When the sensor is placed over the white line, light falls on the LDR. Therefore its resistance is quite low, possibly 1 or 2. Thus the voltage at the

node is equal to: Hence the sensors give a Logic 0 when they are above the black line and a Logic 1 when on the white surface. Finally, lets look at the L293D IC. Heres a schematic of the chip:

Ignore the insides of the chip. Lets look at what the pins are for. The pins EN1, IN1, IN2, OUT1 and OUT2 control one of the motors while the pins EN2, IN3, IN4, OUT3 and OUT4 control the other. Heres how it works 1. EN1 and EN2 are enable pins. Setting these to Logic 1 (i.e. 5V) enables control to the motor. If these are kept at Logic 0, the motors will not run. 2. IN1 and IN2 control the motors direction of rotation. If IN1 = 1 and IN2 = 0, the motor will rotate in one direction and if the inputs are switched, the motor will rotate in the opposite direction. The control signals to the motors are given through OUT1 and OUT2. If IN1 = IN2 = 0 then OUT1 and OUT2 will both have 0V and the motor is free to run. This means that if the robot is moving while this signal is given, it will still move due to its inertia. However, if IN1 = IN2 = 1, OUT1 and OUT2 will both have 10V and the motor is prevented from rotating. This can be used for a braking action. 3. The pin Vcc is connected to 5V and Vss is connected to 10V. The latter is used to drive the motor. The L293D has four ground connections. Suppose EN1, IN1, IN2, OUT1 and OUT2 control the left motor and EN2, IN3, IN4 and

OUT3 and OUT4 control the right one. Since the robot isnt going to perform any complicated line following, well make sure that the motors always cause the robot to move forward. For this we have set IN1 and IN4 to Logic 1 and IN2 and IN3 to logic 0. Connect the EN1 and EN2 pins to the voltage divider system formed by the LDRs and the potentiometers. The left sensor is connected to EN1 while the right sensor is connected to EN2. Having understood how one can use an L293D, lets see how the robot actually follows a line. When the black line turns towards the right, the right sensor moves on the black line. This causes the sensors to give a Logic 0 at EN2 causing the right motor to stop. The left motor continues running. This causes a right turn. The turning causes the robot to align itself on the line again and now both sensors will be on the white surface and both motors will now run causing the robot to move forward. Thats how this line follower works. Simple isnt it? Try it yourself and feel free to comment if you have any questions, suggestions or videos/pictures of your own robots. I have attached the presentation I made for the workshop (check the sidebar on the right). Hope you have fun building it

Das könnte Ihnen auch gefallen