Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Circuit to detect a white line

  1. Dec 23, 2008 #1
    Hey, I need to be build a circuit to detect a white line on any background surface. I have researched and tested with IR technology it detects every colour ( ex red, green, brown ) except black, does anyone have any ideas ? Thanks in advance
     
  2. jcsd
  3. Dec 23, 2008 #2

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    Do you specifically need to follow only a white line?

    Usually in line following robot projects you just have a single high contrast line.
    If you want to follow only white then you have to work in color.
    Either use a color camera or in place of the normal photocell you will need a set of red/green/blue cells and compare the outputs.
     
  4. Dec 23, 2008 #3
    Hey, thanks for the reply, the robot will need to drive forward until it reaches a white line, then it will perform a function. I don't have the budget to buy a color camera, is their a cheap solution ?
     
  5. Dec 23, 2008 #4

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    Normally the line is the only thing on the floor. A black line on a white floor is more common - but only because most classroom floors are white! White on black is the same principle.
    I thought this was an advanced version where you had a whole mess of multi colored lines (lie a subway map) and you had to follow the white one.

    The usual method is to have a simple photocell (light dependant, resistor, photodiode, silicon-cell, phototransistor or whatever) mounted on the front of the robot to detect the change in brightness of either the reflected room lights - or a flashlight beam on the front of the robot.

    The software is pretty simple - if you are steering to the left and signal drops then steer to the right, and vice-versa. Then you need a strategy in case you loose the line completely (go around in a circle?) A more advanced solution is to have two detectors either side of the line - then you know which direction you have gone off.

    But is sounds like you are just going in a straight line until you 'see' a mark - that should be easy.
     
  6. Dec 23, 2008 #5
    But the thing is the carpet of the floor will either be blue or red, thats why I'm having troubles. I have detected a white line on a black surface, but only on a black surface, is there nay possible way to detect a white line on an any colour surface?
     
  7. Dec 23, 2008 #6

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    The color doesn't matter you just have to be sensitive to the change in brightness.
    Obviously white/black or black/white gives you biggest change, black on gray will give a much smaller one - so you might need either a more senstive light detector or better electronics.
    If you are using a simple photocell and a comparator you will have to position the cell over the floor and over the line, measure the output at each and set the detection level halfway between.
     
  8. Dec 23, 2008 #7
    I was thinking of that idea as well, but the robot only takes in digital signals ie 1 or a 0, 1 for reflective 0 for non-reflective, how could I change the response to detect my desired brightness ? Thanks.
     
  9. Dec 23, 2008 #8

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    You can't just run the output of the analog light sensor into the digital input, it will just switch by chance at some unknown level.
    You need to compare the analog output with some adjustable reference level and then have a circuit which switches to a digital 1 or 0.
    Look up "Schmidt trigger" and "comparator"
     
  10. Dec 27, 2008 #9
    Thanks for all the help, so I should measure the output current when the sensor is over the white line then get the accompanying schmitt triger to turn it into a 1 when it reaches that current magnitude ?
     
  11. Dec 27, 2008 #10
    we did this in my robotics class by using infrared sensors, since it returns higher values for black and much lower values for white because of the way the infrared light is reflected off of black surfaces compared to white surfaces.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Circuit to detect a white line
Loading...