May 28, 2015 at 9:07 am #2293killerwhatParticipant
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?May 28, 2015 at 3:51 pm #2294DeeJayParticipant
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.
May 28, 2015 at 10:50 pm #2298JosephKeymaster
- This reply was modified 6 years, 2 months ago by DeeJay.
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.
Attachments:You must be logged in to view attached files.May 29, 2015 at 7:07 am #2300killerwhatParticipant
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.May 30, 2015 at 9:53 am #2301SimonModerator
IR detectors are the norm for line followers as nowhere near as sensitive to changes in visible light levels
Something like this
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=494June 1, 2015 at 1:46 pm #2303MikeParticipant
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 £££?June 2, 2015 at 5:48 am #2305DeeJayParticipant
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.]June 2, 2015 at 10:37 am #2306MikeParticipant
Thanks DeeJay! I hadn’t realised they were so cheap. I was thinking of the IR range sensors.
- You must be logged in to reply to this topic.