Reverse line following


I am using a Zumo reflectance array for a line following project which incorporates a PID algorithm. It works really well but I had a technical question relating to the capability of the sensor array.

I occasionally need the bot to follow the line in reverse, but is the array actually capable of this? I wasn’t sure if the array was designed specifically for going forwards and so wouldn’t get any meaningful reflected readings.

Thank you for any input provided.


The array will take reflectance readings the same regardless of movement direction. However, a line following robot like that will probably not work very well if the line sensor array is mounted opposite the travel direction. If the sensor is in the front and the line is on the right side of the sensor, for example, the robot will need to turn to the right and rotating to the right will move the line towards the center of the sensor array. If the sensor is on the back instead and the line is again on the right side of the sensor, rotating the robot to the right will move the line even further from the center position of the sensor. It might be possible to adjust your code to somehow account for this difference, but, in general, it makes the problem more difficult.


Thanks Nathan.

Yes, I did notice the difficulties from tinkering with the line following code. But I wanted to rule out any hardware limitations prior to doing any further work on coding. Thanks for confirming that.

The project involves leaving and returning to a lined grid to conduct additional tasks. It means that the bot needs to be perfectly aligned at certain times. Being able to line follow in reverse for a second or two would solve all my problems as I’ve had no joy with the onboard compass (due to the amount of metal around).

I’d appreciate if anyone had any helpful ideas or hints. Right now I’ve made the bot reverse blind, but it does not always work due to the natural variations in the surface of the track.


Are you using the Zumo 32U4 robot? If so, you might be able to perform dead reckoning using the encoders and then backtrack. A Google search for “dead reckoning encoders” seems to return a lot of results that might be helpful if you wanted to try to write some code to do that.


No, I’m using the base Zumo kit unfortunately.

Thanks for your help though. I just wanted to ask the question so someone more skilled/experienced than me could confirm either way.