Arduino line maze solver

Sorry but that is a physical layout diagram NOT a schematic. Technically it shows you very little.

So you should show this.

This is why we hate that Fritzing crap here.

A schematic would show the name of each board, and the name of each connector on each board. As it is this is just a blury mess, and you can't see any detail.
It would also help if you could post more information about this IR sensor array, like a link to a data sheet or where you got it from. The same applies to that motor board.

A L298 based board is a very poor choice for working with such a low voltage. This is because that chip uses transistors to switch and you loose so much voltage across it when it switches. Have you measured the voltage on the motor when it is running?

You may want to read this before you proceed:-
how to get the best out of this forum