Test your sensors for line following robots

6
12017

There are two ways of making a line sensing/following robot, using a light dependent resistor(LDR) or Infrared(IR) LED. The fundamental logic behind a line sensing robot is that, a dark object reflects less light than a bright object, or we can also say, a dark object absorbs more light than a bright object. So, in a line following robot, we basically build a sensor that can detect the difference between a dark and a bright object, or say, a black line and a white surface.

Before you fix the sensors onto your robot, you need to see  if the sensors are really reflecting less light on black line and more light on white surface.

Assemble your components in the following ways:

a. LDR based line following robot- sensor tester

testing-line-following-robot-with-LDR

SEE MORE PHOTOS ON FLICKR

Resistors connected to LDR: 1k

Resistors connected to White LEDs: 220Ohm.

You can get the source code for testing your sensors at the end of this post.

For this circuit arrangement, remember that the LDRs should be slightly above the LEDs so that they get right level of reflection. If you put LDRs below the LEDs, they will be illuminated with LED light.

b. Infrared based line following robot- sensor tester

line-sensing-robot-tester_using-Infrared-and-photodiode

SEE MORE PHOTOS ON FLICKR

Resistors connected to infrared LED: 220Ohm

Resistors connected to photo diode: 10k.

You can get the source code for testing your sensors at the end of this post.

In this circuit also, keep the photodiodes or phototransistors just above the infrared LEDs. The blue LEDs are all infrared LEDs and the gray ones are photodiodes.

How to connect a photo diode?

A photo diode has two terminals, one is anode and the other is cathode. Photo diodes are often connected in reverse biased mode, wikipedia says so, CHECK IT HERE. Therefore, connect the longer terminal(anode) to GND and shorter terminal(cathode) to 10k.

I have found a schematic on sparkfun.com. It is the schematic of QRE1113 line sensing module. I adopted the same circuit for my robot also. The only difference is that the QRE1113 line sensing module has both transmitter and receiver on the same casing.

If you have never worked with a photo diode, follow this link: PHOTO DIODE PROJECTS.

I found that the LDR and IR based sensors can clearly detect the difference between a black line and non-black surface. You can see the results on serial monitor, out of three sensors, the sensor right above the black line gives more values than other two.

tester-result

Tips:

When you test your sensor, you can just use a small black tape or a use a black marker/color and color on a white surface.

SENSOR-TESTER-FOR-LINE-FOLLOWING-ROBOT

SEE MORE PHOTOS ON FLICKR

– Keep your sensors just 5-7mm above the surface.

SENSOR-ABOVE-THE-LINE

SEE MORE PHOTOS ON FLICKR

After you test your sensors, you are ready to make the robot.

Related documents:

try this also

BuildCircuit proudly recommends EasyEDA for circuit and PCB design

EasyEDA: A Powerful Free Circuit, Simulation & PCB Design Tool

Register now to use it for free. No Need to download. Lots of resources and Step by step tutorials

 

SHARE

6 COMMENTS

  1. please show the circuit diagram accurately as i cannot figure out how the sensors and resistors are connected with each other , thank you

  2. i cant download the code for testing the LDRs it gives me an error ,please upload it again or write it here please
    thank you

LEAVE A REPLY