Project only working while plugged into laptop

I am currently building a small arduino buggy that is designed for navigating its own way out of a maze. Ideally it would do this with light sensors, detecting a drop in light level when it approaches a wall and reacting accordingly. The light sensors are run through a nano on the breadboard with the raw light reading being wired to the arduino uno which drives the motors. When still plugged into my laptop it does this just fine, picking up my approaching hand before entering panic mode, stopping, reversing and turning 90 degrees. However, when unplugged from my laptop, it will default to panic mode, with no explanation. I have no idea why it is doing this, neither does my teacher. I will attach the code below if that helps, however I don't see it as likely, considering it works 50% of the time. Any ideas? Nano 1st is on the nano that deals with the lights and TestingMaze is on the Uno. Thanks for any help you give.

No code, no circuit diagram, no details of any of the components used...that doesn't give us a lot to go on.

How EXACTLY is it powered when it's not plugged in? If it's a weedy weak battery then probably one or both Arduinos are resetting as the voltage drops when you try to draw too much current from it.

Steve