Shop OBEX P1 Docs P2 Docs Learn Events
Lane Detection — Parallax Forums

Lane Detection

ghost_dcghost_dc Posts: 3
edited 2009-09-28 21:16 in Accessories
Gday, for a school project we have purchased a few TS230r (Light to Frequency Converters), Memsic 2125's (Accelerometers) and a couple of PING's. The sensors were supposed to help a car stay on the road, however we are having a few issues.

We have the Ping's working fine. However·our choice of the·TS230's may have been the worng one, as we are trying to sense the difference between white and black lines and we are having a lot of trouble. This is our main priority atm and if anyone could help us, it would be awesome. Even if that just means confirming our thoughts that there is no way of using the TS230 to determine difference in lines.


Thanks again.

Comments

  • LeonLeon Posts: 7,620
    edited 2009-09-27 16:20
    Have you tried moving the sensor over the line and checking the output with a scope? You should see a change in frequency as it goes from black to white.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 9/27/2009 5:08:45 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-27 16:45
    For best performance, you will need to restrict the sensor's field of view. Otherwise, there will be very little difference between the white line and black pavement, since the sensor will always be looking at both. This can be done either with a lens or a simple tube or baffle. For best results, it's always a good idea to provide your own bright illumination. Ambient light can vary, and shadows present an extra challenge. By providing your own lighting, you can reduce or eliminate a huge source of error in your application.

    -Phil
  • ghost_dcghost_dc Posts: 3
    edited 2009-09-28 04:45
    Thanks for your replies. We have tried using an scope, but was looking at an animation of black and white lines on a computer screen, maybe that was our problem. At the moment i dont have access to a scope, any ideas how i can convert the signal for display on an lcd, using an atmega32. Thanks again. (dont know what this will look like, messaging from phone)
  • SRLMSRLM Posts: 5,045
    edited 2009-09-28 06:57
    You should be able to write a simple program for your microcontroller that converts the frequency to a number. You can then display that number and watch it as it changes when you move the detector. These aren't the forums though for atmega32 programming questions however.
  • ghost_dcghost_dc Posts: 3
    edited 2009-09-28 08:35
    Thanks SRLM, I have the L2F working now with the LCD. If the numbers didnt vary as much as they do it could be a feasible sensor system. Oh well. Thanks again.
  • SRLMSRLM Posts: 5,045
    edited 2009-09-28 16:41
    ghost_dc said...
    If the numbers didnt vary as much as they do it could be a feasible sensor system.

    Huh? Isn't that what you want? A wide range of numbers between dark and light?
  • LeonLeon Posts: 7,620
    edited 2009-09-28 17:42
    He probably means that the frequency is varying a lot with a fixed level of illumination.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-28 18:42
    The frequency won't vary with fixed illumination, but it will vary with a bare road surface passing under it or a white line passing under it, since neither is either perfectly black, perfectly white, or perfectly even. To get any kind of useful consistency, you cannot use ambient light (unless you can observe the road and white line simultaneously and differentially), and you will have to take a running average of the streaming data to even out the bumps.

    Another factor to consider is that if you're testing one of these sensors in the lab, where the lighting is fluorescent, the readings will jump all over the place, in sync with the 50/60Hz line frequency.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-28 21:16
    qhost_dc,

    Take a look at this thread for an alternate approach. It didn't bring this up sooner, since I wasn't sure how good it would be without trying it first.

    -Phil
Sign In or Register to comment.