aumudin
Posts: 6
Joined: Tue May 24, 2016 9:23 pm

Turn on/off USB ports/hub

Mon Sep 19, 2016 9:43 pm

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!

User avatar
Burngate
Posts: 6303
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Turn on/off USB ports/hub

Tue Sep 20, 2016 9:35 am

[quote="aumudin"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.[/quote]
Not individually - the power to all four is controlled by one chip, which can be turned off by talking to the LAN9514 chip.
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.
That sounds like a good idea.

Return to “Advanced users”