Society of Robots - Robot Forum

General Misc => Misc => Topic started by: macbook on October 01, 2009, 09:29:38 AM

Title: LDR for line following
Post by: macbook on October 01, 2009, 09:29:38 AM
Hey,
I want to ask if I can use LDR or light dependent sensors (if they exist) in place of photo sensors for colour detection in line following?
I want to distinguish between black and white colour. Now the intensity of light coming from the light reflected from both these colours would be different due to which the LDR should give different readings for both colours and hence it could distinguish between them..
Is it possible and feasible?
Thank you.
Title: Re: LDR for line following
Post by: arixrobotics on October 02, 2009, 07:30:27 AM
Yes, you can do that, and LDRs do exists  ;)

Its probably the easiest way of making a line-following robot. Wire up the LDR in a voltage divider, and feed it into your microcontroller digital input. The signal will be high or low depending on whether the LDR is on a black or white surface, and depending on how you wire up the voltage divider.

I've also used LDRs to follow a green line on a yellow surface. Its just a bit harder as you will need to read the analogue value instead of digital (unless you carefully design and calibrate the voltage divider).
Title: Re: LDR for line following
Post by: Admin on October 02, 2009, 08:47:13 AM
Quote
I've also used LDRs to follow a green line on a yellow surface. Its just a bit harder as you will need to read the analogue value instead of digital (unless you carefully design and calibrate the voltage divider).

This tutorial will show you exactly how to optimize the voltage divider for any color:
http://www.societyofrobots.com/schematics_photoresistor.shtml (http://www.societyofrobots.com/schematics_photoresistor.shtml)

 :P
Title: Re: LDR for line following
Post by: arixrobotics on October 02, 2009, 10:12:38 AM
Wow that's a really good tutorial  :o  :D