the ‘Crumble Line Follower Widget‘ is a small board with two infra-red sensors in. Their resistance changes depending on the colour/ amount of light they sense. This means we can use the analogue values on the Crumble, along with some motors, to make a buggy follow a line!
There are many different ways to program a line-following buggy, and we are going to have a look at these. It is worth noting before we go any further, that there are many factors that can influence how successful your line-following adventure will be. Everything from how white your surface is, how reflective it is (for infra-red), how close the line follower is to the surface, to how charged your batteries are.
First of all, we need to wire up our Crumble and line follower. If you look at the back of your buggy, the right motor needs to connect to the motor two pads (red + and black -). The left motor connects to the motor 1 pads, but because the motor is flipped we need to reverse the wiring so that the ‘forwards’ block still makes the motor move forwards. So we will connect the black to + and the red to – . The line follower then needs connecting. The power (+ and -) connects to the corresponding pads on the Crumble or battery box and then the ‘left’ and ‘right’ pads need connecting to two of the I/O pads e.g. A and B.
note: This may be different depending on your motor configuration/set up. If you are in doubt have a play and find out!