I have built a little robot using the pi zero, explorer Phat, zumo chassis and ubec to regulate the voltage from the 4 AA batteries that the zumo chassis holds.
When battery powered the battery connects via one of the 5v headers on the explorer pHat.
I have just added an ultrasonic sensor to the robot and written some new code to analyse the readings and avoid obstacles. This works fine when connected to the raspberry pi power supply but if I power the robot up via the batteries nothing happens.
I have the script setup as a cronjob and if I connect my usb hub to the robot while its on battery power it suddenly continues with the script.
So it seems like a power issue when the new sensor is connected. I have connected the sensor to the second 5v header/ground and one of each of the input/output pins.
If someone can explain to me what is causing this and how to fix it that would be great. I am wondering if using a usb phone charger battery pack might make a difference?
I have added a photo below.