Line Follower Issues

My partner and I are using a Line follower to differentiate for out marble sorter, and for some reason, when we have it plugged into the cortex we’re only getting a reading of 247 to 248, we tried different line followers but we have the same issue, does anyone had a work around

Is the battery on?

You may be running into a problem with both marbles being very reflective. If the colors are not different enough, it certainly could be that the specular reflection is too great compared to the diffuse reflection, and the diffuse reflection is where the differentiation is generally made. I’m not sure how much specular reflection you would get with marbles with the wavelengths the line followers use. If the issue is specular reflection, you can take advantage of the angles and the curve by sliding a little off-center so that the specular reflection does not hit the sensor while the diffuse reflection still does.

1 Like

I’m assuming it’s the clear marble and the steel marble, correct? Those are much easier sorted by weight. (I built one of these earlier this year.)

Your lighting conditions can effect the values. Also make sure your sensor does not move.
I helped someone out with a marble sorter earlier this year and some of the problems were that the lighting was a little different and that the sensor kept on moving.

@gabewells903 as @callen and @STek have already pointed out lighting conditions could influence performance of the line following sensor a lot.

Could you share more details, like the picture of the way line sensor is interacting with objects, the types of the marbles you need to sort, and probably, the snippets of your code where you initialize and read the values from the sensor?

We would certainly expect wider range of values returned by the sensor.

Line following sensor has a little LED that emits infrared light which, after it reflects off the object, is detected by a light sensitive element inside the sensor.

In general, you want to mount your sensor about 5mm from the surface of the object and point it away from any source of external lighting (usually down) and, if necessary, surround it with a little non transparent shield (like a thick paper) if you need to operate it in the room with a lot of sunlight. If there is too much sunlight coming directly into the light sensor it could flood it with IR and overwhelm it.

It would be cool to build a contraption that could distinguish different types of marbles by their weight or size like @gilmorkn472 did but, if you have to do it based only on the color or surface finish, then line follower or light sensor would be required.

If you need it to work in variable lighting conditions and shielding the sensor is not enough, you may need to use differential sensor setup, where you have two sensors with one reading input marble and another reading known sample marble above each container.

When reading from both sensors would match within small tolerance - the sorter would drop the marble into the container. This way you wouldn’t need to hardcode any sensor values into the program and the sorting machine will “know” about new marble type as soon as you set a new sample marble along with a new container.

1 Like

were sorting aluminum, wood, and semi clear plastic we’ve separated the steel marble by weight, we haven’t started any code yet, just trying to get the hardware working at this point, the battery is on and we have the debugger window open
@technik3k,

I’ll post a video here in a second of mine working. We had to do the exact same thing.

Sorry for the jumping around. I was trying to get that to work for about 30 minutes before that run.

2 Likes

thanks for all the tips, but my partner just informed me that we had the line follower in the wrong slot, so that’s why we had a bad reading.

1 Like