My current project has 2 USB cameras with infrared. It works fine until I turn the lights out and the power draw crashes the raspberry pi. Only one of the cameras needs to be working at any given time. Also I am running this off solar panel and battery so ideally I'd just shut them both off until I needed them(using a motion detector) to take a picture that way the infrared wasn't draining the battery all night.
So what I'm trying to figure out is a couple things:
1) Is there a way to control the USB ports power on the raspberry pi itself? From everything I looked at online there doesn't seem to be a way. I have both the RPi2 B and the Rpi3 B.
2) If not does anyone have any good ideas on how to accomplish this another way? I was thinking maybe along the lines of pulling the power cable out of the USB camera and powering it through a different board. That board would be hooked up to a gpio so if I turned that gpio pin on it would complete the circuit and allow the camera to startup if not then it stayed off.
Any ideas would be awesome!