|
Post by ddraigx on May 11, 2018 11:47:23 GMT -8
Howdy,
I recently purchased the USB PowerControl, and I'm kind of thinking I might have purchased the wrong thing. After reading and re-reading the documentation I'm hoping to get a better understanding of how to use it. I'm newish to working on electronics at this level so I hope this makes sense.
I need to have the Pi start and stop on it's own based on power. This installation will be at a remote site that will not be able to get to very easily and will most likely be using a 12v battery as the power source. I'm looking at few different scenarios on how to use this.
#1: Solar Panel w/USB Output -> Using a USB Battery Pack -> USB PowerControl -> Raspberry Pi.
If I'm understanding the documentation, I should be able to use the grove connector connected to two GPIO pins? One setup to Enable it to look for voltage from the Pi, and then the other from the Pi to read the voltage. (Which one would that be, googling seems to be pin 35?). What's the best way to hook this up? Do I need to jumper the LIPOBATIN pin, with a resistor to enable it, then use the grove connectors?
#2: Solar Panel -> Charge Controller -> 12v Battery -> 12v to 5v DC to DC Buck Converter -> USB PowerControl -> Raspberry Pi.
Same as above?
#3: LiPO -> USB PowerControl -> Raspberry Pi
I would obviously need to put some type of USB connector on it. Do I need to splice another lead to the + lead from the LIPO and connect the new lead to the LIPOBATIN?
With Scenarios 1 and 2 I think my problem is going to be the converters trying to keep the voltage at 5v and then just dying out. Does that sound correct? If so do you have any suggestions to get around this?
What can I do with the TP points?
Thanks for the help!
|
|
|
Post by SDL on May 13, 2018 10:01:25 GMT -8
I need to have the Pi start and stop on it's own based on power. This installation will be at a remote site that will not be able to get to very easily and will most likely be using a 12v battery as the power source. I'm looking at few different scenarios on how to use this. I'm not sure what you mean by the above. "start and stop on it's own based on power". What do you mean specifically by that?
What are the criteria that you are using to stop and start the Raspberry Pi? #1: Solar Panel w/USB Output -> Using a USB Battery Pack -> USB PowerControl -> Raspberry Pi. Most USB Battery Packs won't work this way, but you can give it a try. We have no idea if they will work with the USB in and Out that way. I know some customers have found out that USB Battery Packs switch on and off by them selves in certain situations.If I'm understanding the documentation, I should be able to use the grove connector connected to two GPIO pins? One setup to Enable it to look for voltage from the Pi, and then the other from the Pi to read the voltage. (Which one would that be, googling seems to be pin 35?). What's the best way to hook this up? Do I need to jumper the LIPOBATIN pin, with a resistor to enable it, then use the grove connectors?
Grove connectors OVERRULE the LiPo Bat in. Look at the truth table in the specification.#2: Solar Panel -> Charge Controller -> 12v Battery -> 12v to 5v DC to DC Buck Converter -> USB PowerControl -> Raspberry Pi.
This should work. But we still need to know what exact criteria do you want to use to shut the Raspberry Pi on and off. It's complicated. Look at the solar power sections in this instructable: www.instructables.com/id/GroveWeatherPi-Raspberry-Pi-Based-Weather-Station-/Same as above? #3: LiPO -> USB PowerControl -> Raspberry Pi
This won't work. You need to put the LiPo in through a solar power controller (or a Buck Up to 5V) for this to work. SunAirPlus or SunControl does this: shop.switchdoc.com/collections/solar/products/sunairplus-solar-controller-charger-sun-tracker-data-gathering-grove-headershop.switchdoc.com/products/suncontrol-advanced-solar-controller-charger-sun-tracker-data-gathering-grove-headerI would obviously need to put some type of USB connector on it. Do I need to splice another lead to the + lead from the LIPO and connect the new lead to the LIPOBATIN? With Scenarios 1 and 2 I think my problem is going to be the converters trying to keep the voltage at 5v and then just dying out. Does that sound correct? If so do you have any suggestions to get around this?
It's complicated. Look at the instructable above.What can I do with the TP points?
You shouldn't need these with the new USB PowerControl that you have.
Send a picture to us so we can make sure.
BP
|
|
|
Post by ddraigx on May 15, 2018 5:43:58 GMT -8
Howdy,
Just a quick reply saying thank's for responding. I'm at work at the moment and will update as soon as possible.
|
|
|
Post by ddraigx on May 18, 2018 4:31:32 GMT -8
|
|
|
Post by ddraigx on May 19, 2018 10:00:57 GMT -8
Just to update the USP PowerControl I have 0042-112116-001
|
|
|
Post by ddraigx on Jun 5, 2018 4:43:05 GMT -8
Alrighty,
I believe I understand how to hook it up to the battery etc. My next question is, how do I get it to send a shut down command to the raspberry pi so that it doesn't corrupt the card?
I've looked through just about every post I can see and I don't see any example python code or anything to do this safely? Can you point me in the right direction of the code to to have this send a signal to the PI to shut down safely or am I miss understanding how this product works?
|
|
|
Post by SDL on Jun 6, 2018 6:58:13 GMT -8
Ddraigx,
Here is the code from GroveWeatherPi:
def shutdownPi(why):
pclogging.log(pclogging.INFO, __name__, "Pi Shutting Down: %s" % why) sendemail.sendEmail("test", "GroveWeatherPi Shutting down:"+ why, "The GroveWeatherPi Raspberry Pi shutting down.", config.notifyAddress, config.fromAddress, ""); sys.stdout.flush() time.sleep(10.0)
os.system("sudo shutdown -h now")
def rebootPi(why):
pclogging.log(pclogging.INFO, __name__, "Pi Rebooting: %s" % why) os.system("sudo shutdown -r now")
BP
|
|
|
Post by ddraigx on Jun 13, 2018 7:55:15 GMT -8
Ddraigx, Here is the code from GroveWeatherPi: def shutdownPi(why):
pclogging.log(pclogging.INFO, __name__, "Pi Shutting Down: %s" % why) sendemail.sendEmail("test", "GroveWeatherPi Shutting down:"+ why, "The GroveWeatherPi Raspberry Pi shutting down.", config.notifyAddress, config.fromAddress, ""); sys.stdout.flush() time.sleep(10.0)
os.system("sudo shutdown -h now")
def rebootPi(why):
pclogging.log(pclogging.INFO, __name__, "Pi Rebooting: %s" % why) os.system("sudo shutdown -r now")
BP Thanks for the response. What pins do I connect from the USB Power control to the Raspberry Pi? I also don't have a GroveWeatherPi so I don't know how the code even relates to the USB Power Control? I thought I would need to have a python script monitoring a gpio pin or something? Maybe I am not understanding the function of this unit. Is the USB Power Control simply just a hardware switch to turn power on and off to the USB Port?
|
|
|
Post by SDL on Jun 15, 2018 11:22:42 GMT -8
It is a hardware switch but it is under software control. Read through the spec and look at software examples.
It's pretty easy to figure out.
BP
|
|
|
Post by ddraigx on Jun 22, 2018 16:13:22 GMT -8
It is a hardware switch but it is under software control. Read through the spec and look at software examples. It's pretty easy to figure out. BP Ok thanks, I have read through the spec, the various blog posts, and even the add on products that are not related. I don't see any software examples in there nor very concise documentation that doesn't refer me to another product and that documentation. I am sure it is easy for some people that are experienced with hardware etc but I'm obviously not "getting it". I was hoping that you would be able to point me to the specific section of the documentation that would walk me through it better. Perhaps in the future you could do some tutorial videos because some of us are visual learners and can't conceptualize things from reading blog posts.
|
|
|
Post by SDL on Jun 24, 2018 11:20:56 GMT -8
There are two modes in the USB PowerControl product. 1) You control it with a voltage line coming from a battery (LiPo for example). Battery > ~ 3.5V its on. < ~3.5, then its off. 2) You use the Grove connector with a Grove Digital port to do the following: This circuitry is provided to allow the USB PowerControlV2 to be controlled by either LIPOBATIN or the state of the CONTROL Line (J3 Pin 1). ENABLE (J3 Pin 2) controls whether the USB POWERCONTROLV2 is switched by LIPOBATIN or the CONTROL line. Remember that LIPOBATIN is not a digital input. It is designed to look at the voltage level of the battery. The truth table for the USB PowerControl V2 is given below: Turn your RaspberryPi/Arduino on and off using this solid state relay. You use Enable to switch off the LIPOBATIN and then you just control it with the Control pin on the Grove Connector - two GPIO pins.'' BP
|
|