Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Line follower sensors

  1. #1

    Default Line follower sensors

    With IR LEDs and photodiodes using the specular reflection (the direct reflected beam), I get a good (almost digital) sensor for detecting whether the line is below the sensor or not, but the values will fall off rapidly as the sensors goes off the line. I want to get analog values to detect how far off the edge of the line I am (up to 1-1.5 cm on either side of the edge). What are the ways of doing this?

    1. There is no ambient light (it has been filtered out using some method like modulation)
    2. There are 2 sensors, one over the left edge of the line, one over the right edge.
    3. Max turn angle is 90 (at least for now)
    4. The floor is flat (or very close to flat)

  2. #2


    hey bro the usual way to tackle the problem is by using a sensor array but in ur case if two sensors are the limit what u can do is instead of using the led and sensor pair kept close together make a small array as shown

    led sens led sens

    such tht either sensor can be used to switch on the led and now by cyclic switching of the two leds u can tell where exactly is ur posn ie btw led sens pair 1 pair2 or pair 3!!!!

  3. #3


    i read quite many posts of yours kartik, and i think you are not on the rite track...

    and i guess, you should first think on your own, then search web to get the answer, and then practically implement the thing....

    now, how will you get analog value corresponding to the distance from the line?? again do you want to use diffused light?? do one thing na...try to make a real moving machine using reflected light and then using diffused light...i think then you will get how to think about robotics....

    and about your question...have an array of sensors, and then use PD algo to follow line...PID even better! and you design array according to your need...single line, double line whatever! use your brain!!!

  4. #4
    Senior Member T-1000
    Join Date
    Mar 2005
    Blog Entries


    Framing a question with constraints so as to lead the thread to a conclusion required by you??

    I get a good (almost digital) sensor for detecting whether the line is below the sensor or not,
    I strongly disagree. I repeat, I strongly disagree. you can get .5V, 1V,2V,3V and 4V with a simple LDR+light combination!!! you need the right calibration. I am saying you can, ot just by assumptions, It has been TESTED!!

    So you don't need complex answers, all you need is simple calibration, and you can get output proportional to the light intensity entering the sensor.

    Always, the sensor out will be always proportional to the light entering it. Its up to the algorithm to decide how far the line is. In fact, there are situations in a two sensor arrangement when the sensors will give the same output, which might lead us to think the line is exactly at the middle of the bot, while it aint!!

    here are some of the situations:

    while the first four will have same outputs from sensors, the last two will also have same output levels from the sensor. So its all in an algo!!

    If you want to make a good lone follower, increase the sensors. I am not sure if the original post was to do that.

    There is no ambient light (it has been filtered out using some method like modulation)
    I dont want to argue about the assumption made, but but ambient light reduction with modulation IS very tricky, Its somewhat easy with IR, since hardly will your sensor get saturated. You will know what i mean, if you try a line follower with sensors uncovered, no reflected light from the line-sensor, in a room, with windows on one side!!

    And the robot takes the fist turn.. guess you got what i mean.

    I didnt mean a discussion on ambient light here, i guess i might be starting a discussion on a new thread.
    .... I didnt do it ! ....

  5. #5
    Super Moderator T-1000 docel's Avatar
    Join Date
    Sep 2005
    Blog Entries


    ( You need to spend a little time on this....)
    Get a torch, a white paper, stick a 3cm black tape on it. Flash the Torch light beam ( a visible light LED is great for this) on the black tape and slowly move the beam towards the white. CAREFULLY OBSERVE the circle of light every 1mm and make a serial sketch of the shape.
    Now , tell us:
    a. Is it Digital :?:
    b. or is it Analogue :?:
    c. What is the relationship to the shape of the light beam and its intensity :?:
    d. Calculate the angles for the best reading at an imaginary sensor.

    You can repeat this experiment with a LDR connected to a Analog multimetermeter in the OHMs range ( so that you can see the results clearly)

    Plot this and draw the curve.

    By then, you'll realise WHAT we are all trying to tell you!
    ^Anything is possible..
    after YOU prove it!!

  6. #6


    @docel: Currently I am a bit busy since my exams are going on, will try the experiment sometime later.

    @allbits: Of the cases you mentioned, the second case cannot occur because the distance between the sensors is almost equal to the width of the line, so both cannot be outside the line when the bot is at some angle. Cases 3 and 4 are when the bot has already strayed away from the line and these are the cases which we have to prevent. For the last two, the robot has to turn to the turn, so there is no ambiguity.

  7. #7


    arey baap re!!! kartik, you want to keep the distance between the sensors almost equal to the width of the line???????? 8O

    do one thing na, try this out practically na...

    as for your information let me tell you, your bot will be a god slow bot, for it will always be in correction mode and never to its max velocity...

    and now i strongly recommend you to try something practically before you post here,,,maybe after your exam.... :wink:

  8. #8


    I had made a line follower with the distance between the sensors about the same as the line width. It ran at a decent speed. I accept it was always in correction mode, the corrections were done using a PD controller so for small errors there was not much reduction in the speed.
    I don't get the problem with this approach?

  9. #9


    well how do you achieve PD control using just two sensors??? 8O

  10. #10


    Whats the problem in that? You can get analog values from the sensors to detect how far from the center you are which acts as the error for the PD controller.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts