Home 2018 Forums Crumble Support Line following

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2293
    killerwhat
    Participant

    Hi, I want to move my bot on to line following. How do I find out what values the analogue inputs (LDR’s) are returning?

    #2294
    DeeJay
    Participant

    It’s just the value given by [ANALOGUE [x]] for the channel the sensor is connected to, on a scale within the range 0-255.

    More description and code snippet for a 4tronix LDR Crumb here: http://4tronix.co.uk/blog/?p=921 (under the heading LUX/LIGHT)

    That’s taking your question at face value – an LDR isn’t what I would first think of using for line-following, but that doesn’t mean you are wrong.

    • This reply was modified 5 years, 4 months ago by DeeJay.
    #2298
    Joseph
    Keymaster

    Hi,

    Just to clarify that the trick to interrogating the analogue input values is to read the input into a variable first. The current version of the software can monitor the value of variables, but not analogue inputs directly.

    The attached image shows how you might do this if your LDR is wired directly to A and B.

    Joseph

    Attachments:
    You must be logged in to view attached files.
    #2300
    killerwhat
    Participant

    Thanks guys, that will get me moving.
    To pick up on DeeJay’s comment, I’m planning to use LDR’s to keep it as low cost as possible as I’m planning to use this project for 100 year 8’s but effectiveness is also important so if there is a better alternative I’m happy to take advice.

    #2301
    Simon
    Moderator

    IR detectors are the norm for line followers as nowhere near as sensitive to changes in visible light levels

    Something like this
    http://www.ebay.co.uk/itm/3-Way-Infrared-IR-Line-Tracking-Sensor-Module-For-Raspberry-Pi-Arduino-CHIP-24/221759541670?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20140107083358%26meid%3D2dc635f1c5424cb5b720d7966bf300f5%26pid%3D100011%26rk%3D1%26rkt%3D3%26sd%3D141385963222

    You can have a play with a IR Proximity Crumb but its not ideal for close range line following use but if you tilt it at an angle – it does the job 🙂
    http://4tronix.co.uk/store/index.php?rt=product/product&product_id=494

    #2303
    Mike
    Participant

    Presumably, if you put an LED next to the LDR, pointing down, and the line is big and black against white paper, then the change of voltage across the LDR would be pretty easy to detect?

    Might take some experimenting, but could save £££?

    #2305
    DeeJay
    Participant

    Interesting idea. Certainly worth experimenting, and I’d love to hear how you get on. No reason to follow the crowd.

    In terms of ££ – an LDR costs about 20p, and an IR sensor (tx/rx pair) costs about 25p. By the time you’ve added your own LED transmitter there may not be much in it. [Prices based on multi-packs from 4tronix – other suppliers are available.]

    #2306
    Mike
    Participant

    Thanks DeeJay! I hadn’t realised they were so cheap. I was thinking of the IR range sensors.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.