Saturday 18 July 2020

Line Sensors




One of the easiest way for a robot to navigate, is to follow a line.
So it's time to add the some line sensors.
I got several types of eBay:
   
This was the first type I tried, it has a TCRT5000 infrared transmitter/receiver, with a 74HC14 which is a hex inverter with Schmitt-trigger inputs.
Having no comparator, this type is only good for detecting objects.
Didn't matter the colour of the object, (black or white) it detected proximity.

Next I tried, one with a TCRT5000 infrared transmitter/receiver and a LM393 comparator.
   
This had a potentiometer that would adjust the sensitivity of the infrared receiver.
This worked in a fashion, but the black line has to be a black that absorbs infrared well.
To mount this I moved the potentiometer and pins to the opposite side.
I decided to try another.
This is similar to the last one except the infrared transmitter and receiver are separate components.
    
This worked just like the last one, but because the infrared transmitter and receiver are separate components, I decided to swop out the infrared receiver for a Light Dependent Resistor, and change the infrared transmitter for a normal Light Emitting Diode.
I also rearrange them and the pins.
   
I found for following a black line this setup worked best.
The only down side to using LDR is; I will have to always adjust for ambient light or use a shade when it is bright outside.

There are several options in using sensor(s) to follow a line, in fact there are lots, too many to mention them all.
I will show a few:

With one sensor it actually follows an edge.
The line needs to be quite wide.
Looking at the image above, if the sensor detects black, it will turn right, if it detects white it will turn left.
If using DC motors, this could be made to work using a few transistors to switch the drive motors on or off.
I have stepper motors, not impossible but not good.

With two sensors there are a couple of ways to follow a line.
Have the sensors outside the line, the line can be quite narrow.
Have the sensors inside the line, the line will need to quite wide.

I have decided to use three sensors and arrangement the sensors in a triangle configuration.

Having three sensors gives me more control.
The two outer sensors work in the traditional way, using feedback from these two sensors, the wheel speed is adjusted to keep the sensors either side of the line.
Wheel speed is changed, rather than switching motors off/on, because I have stepper motors.
The middle sensor acts like a preview of what's ahead.
If it is still on the line, then only small adjustment to the speed of the wheels is needed.
But say it comes to right-angled or sharp turn then the middle sensor will leave the line, indicating larger adjustments to the wheel speed is required.







If you like what I have done, or want to know more.
Please leave a comment below.


No comments:

Post a Comment