Pages

Saturday, August 14, 2010

Membuat line follower sederhana

Theory: by Lol Elner

Obviously the line following robot will need to see the line, therefore we require an light detector of some sort. We also would like it if the line following robot could do this regardless of the ambient conditions (is the room dark or light? is it lit by sunlight or artificial light?). So the robot will also need its own illumination source. The weapon of choice here will be Infra Red (IR) light.

To make this easy for ourselves the light only needs to be constant... if a white line is present then it will reflect a lot of IR from our source. If the line is black then we see the opposite effect.

The circuit

All we need is an IR source, an IR photo-transistor and a couple of resistors! Here are the resources:


  • IR emmiters and detector pairs: UK - Maplins,CH10L and CH11M, or SFH409 and SFH309.
  • IR emmiters and detector pairs: US - Solarbotics QRD1114 (this has both in one package)
On top of these, it would be nice if the signal that we get could be TTL (on or off, 0V, 5V). So to do this we will also require our favourite BEAM chip, the 74AC240, heres the circuit:







Circuit operation is simple.... no line to follow put the input to the inverter high, and therefore the inverter outputs a low, line detection turns on the transistor (or photodiode) and thus the inverter gets a low and outputs a high. If your robot is following a black line on a white page, then add another invereter after or before the first.

So what should the values for R1 and R2 be? and how do I set up the 74AC240 chip exactly..... The value for R1 affects the source IR brightness, for maximum brightness we set R1 to give the maximum allowable forward current for the IR led. So what should it be?? Well, look at the datasheet for your LED, lookup the value of the maximum forward current. Now a simple bit of electronic theory tells us V=IR, I will assume you are using 5V because this is the volatge the 74AC240 should be run at (6V is OK... 4 AA batteries).

Now lets say that the max forward current is 100mA so we have 5V = 100mA * R , therefore:

5/100*10^-3 = R = 50ohms.

Experiment with different values until you get a sensitivity that you are happy with... too bright and the detector will see it when it shouldn't! Also remember this will affect the distance you can have it from the line you are following.

So how about R2? just set R2 to about 4K.

The chip setup is simple too... ground pins 1, 10 and 19, put 5V onto pin 20. Now choose a pin to input your signal to, if you look at the 74AC240 datasheet on page 1, you will see a connection diagram, any pin with an I is an input, follow it across to find its output.
Pins 1 and 19 are the enable pins, which we have grounded to permanently enable the inputs on both side of the chip, this leaves you free to use any of the input pins. For example (in case I haven't spelt it out enough already)... input your signal at pin 4 and take the ouput from pin 16.

The output signal could be used to directly drive your motor... just connect one side of the motor to the ouput, and the other side to ground. If you do this for two motors (2 sets of line detectors will require two sets of emitters and detectors, but only one 74AC240 chip), then you have a basic line follower already! The left detector should be used to drive the right motor and vice versa
The behaviour of this robot as it stands will be too turn a motor on IF a line is present, if both detectors are over the line then it will drive straight, if the left detector goes of the line, it will turn off the right motor causing the robot to turn back onto the line, if the right detector goes off the line then it will turn off the left motor and again go back onto the line. If both detectors come off the line (end of line) then the robot will stop altogether, perfect! 


originally post : http://www.tombot.net/beam/linefollowingcircuit.html
Theory: by Lol Elner

Obviously the line following robot will need to see the line, therefore we require an light detector of some sort. We also would like it if the line following robot could do this regardless of the ambient conditions (is the room dark or light? is it lit by sunlight or artificial light?). So the robot will also need its own illumination source. The weapon of choice here will be Infra Red (IR) light.

To make this easy for ourselves the light only needs to be constant... if a white line is present then it will reflect a lot of IR from our source. If the line is black then we see the opposite effect.

The circuit

All we need is an IR source, an IR photo-transistor and a couple of resistors! Here are the resources:

* IR emmiters and detector pairs: UK - Maplins,CH10L and CH11M, or SFH409 and SFH309.
* IR emmiters and detector pairs: US - Solarbotics QRD1114 (this has both in one package)

On top of these, it would be nice if the signal that we get could be TTL (on or off, 0V, 5V). So to do this we will also require our favourite BEAM chip, the 74AC240, heres the circuit:







Circuit operation is simple.... no line to follow put the input to the inverter high, and therefore the inverter outputs a low, line detection turns on the transistor (or photodiode) and thus the inverter gets a low and outputs a high. If your robot is following a black line on a white page, then add another invereter after or before the first.

So what should the values for R1 and R2 be? and how do I set up the 74AC240 chip exactly..... The value for R1 affects the source IR brightness, for maximum brightness we set R1 to give the maximum allowable forward current for the IR led. So what should it be?? Well, look at the datasheet for your LED, lookup the value of the maximum forward current. Now a simple bit of electronic theory tells us V=IR, I will assume you are using 5V because this is the volatge the 74AC240 should be run at (6V is OK... 4 AA batteries).

Now lets say that the max forward current is 100mA so we have 5V = 100mA * R , therefore:

5/100*10^-3 = R = 50ohms.

Experiment with different values until you get a sensitivity that you are happy with... too bright and the detector will see it when it shouldn't! Also remember this will affect the distance you can have it from the line you are following.

So how about R2? just set R2 to about 4K.

The chip setup is simple too... ground pins 1, 10 and 19, put 5V onto pin 20. Now choose a pin to input your signal to, if you look at the 74AC240 datasheet on page 1, you will see a connection diagram, any pin with an I is an input, follow it across to find its output.
Pins 1 and 19 are the enable pins, which we have grounded to permanently enable the inputs on both side of the chip, this leaves you free to use any of the input pins. For example (in case I haven't spelt it out enough already)... input your signal at pin 4 and take the ouput from pin 16.

The output signal could be used to directly drive your motor... just connect one side of the motor to the ouput, and the other side to ground. If you do this for two motors (2 sets of line detectors will require two sets of emitters and detectors, but only one 74AC240 chip), then you have a basic line follower already! The left detector should be used to drive the right motor and vice versa
The behaviour of this robot as it stands will be too turn a motor on IF a line is present, if both detectors are over the line then it will drive straight, if the left detector goes of the line, it will turn off the right motor causing the robot to turn back onto the line, if the right detector goes off the line then it will turn off the left motor and again go back onto the line. If both detectors come off the line (end of line) then the robot will stop altogether, perfect!

Thursday, July 29, 2010

Line Follower


This Robot use two motors control  rear wheels and the single front wheel is free. It has 4-infrared sensors on the bottom for detect black tracking tape, when the sensors detected black color, output of  comparator, LM324 is low logic and the other the output is high.
Microcontrollor AT89C2051 and H-Bridge driver L293D were used  to control direction and speed of motor.

Circuit Robot




Circuit diagram of Infrared sensor



position of sensors


Software
Software for write to AT89C2051 is robot1.hex ,which was written by C-language ,the  source code is robot1.ccompiled by using MC51 in TINY model with my start up code robot.asm .
MPEG files
Sample of competition between 2051 and 68HC11.

  • movie1.mpg (1,303kB)

  • movie2.mpg (373kB)

  • Source : www.kmitl.ac.th
    Contact Owner : plermjai@loxinfo.co.th

    Rangkaian led 7 segment

    Rangkaian Led 7-Segment Interface Circuit

    The circuit uses a serial-in-parallel out shift register, 74HC595 for receiving serial data from uController board. See example of U5 in the schematic, SER is for data input, SRCLK is shift clock and RCLK is Latch clock. Each data bit is shifted into the register on rising edge of the shift clock. When all data bits are shifted into the 8-bit register, the rising edge of RCLK will clock the data to be latched at each output bit, i.e. QA – QH.
    The Big LED is made from cheap dot LED. Each segment has five dot LED connected in series with a limiting resistor tied to +12V. The logic high at the input of ULN2003 makes the output active low, thus sinks the LED current into the chip. The driver has 7-bit for segment a, b, c, d, e, f, and g. Q1 is for optional point display.
    Multiple digits can easily be made by connecting the QH to the next digit serial input bit, see the circuit below. Please note that, the shift clock and latch signal are tied to every 74HC595.

     
     

    Blogger