Battery fallback for Onion Omega
Can somebody help me to build a battery fallback for my Onion.
I use my onion in the car, it captures photos while driving and creates together with some gps data a map.
So Onion is connected via usb adapter to the 12v jack of the car.
When i stop the car... the power is off. And mama told me that this isnt the way to shutdown a computer ;)
So i thought about smth like connecting a 5v (usb) battery to some pins (i dont know which) and cut the connection to it with an relay that is controlled by input voltage on regular micro usb jack.
I would be really happy to get some help with this because this is definitely nothing i have knowledge about.
Better idea - get one of those emergency battery packs you can get for charging a mobile phone. Have the car charge the battery pack and run the Omega off the pack. You've still got a battery pack that way if you go off anywhere.
@Benjamin-Rau The suggestion from @mark-doutre is a good one. I have a USB battery pack that has both an micro-USB for charging and a standard-USB for output (I suspect most do) so I can simultaneously charge the battery pack and use it to supply my Omega.
A couple of alternatives you might like to consider:
- Get yourself an Omega Battery Dock - though you may have to wait some time for this. I have had one on order since November 2015 and am still awaiting it. I understand they are having shipping issues because it contains a Lithium battery (though other suppliers of Lithium battery containing equipment seem to have no problems). The page https://onion.io/blogs/shipping-schedule-and-status indicates they won't be shipping these until May 2016 and I note that it is also no longer listed on the page https://store.onion.io/collections/onion-omega-expansions
- While you may not want to take this route for other reasons, an Arduino Expansion Dock can be used - this has a power connection for a 9v (or similar) supply which will also supply power to the Omega. Additionally, it can be powered using an Arduino Power Shield (such as https://www.adafruit.com/products/2078). I do this regularly and it works well.
Actually, this is related to something I'm trying to work out.
What I want to do is run the Omega in a remote location. I can run the Omega off of a remote battery pack, but I want to be able to charge the pack either off of a solar panel or some other energy harvesting device.
Any ideas on how I can solve the power bit?
I was just looking at how to make my omega Solar powered and this I found,
and a L7805CV
Thats What I bought You dont need a charge controller for 6v 2w, just the l7805cv
One solution might be to use this combination of charger and power booster.
The charger will charger the battery via solar, usb, power adapter, etc. the power booster will take the load output and boost it to 5 v for the Omega.
Just seems like a simple, inexpensive solution... They also have the 6volt solar cells.
Been out for some days - thanks for the great contribution to this post.
One problem with battery packs seems to be that there is a short period where output is low when input connected /disconnected. I think this is because most battery packs switch from battery directly to Vin when there is input power.
This causes the Onion to crash but i need un-interrupted power also when input (car power jack) is connected / disconnected.
Also very important: I need to be able to monitor if power is delivered from battery or not because i need to shutdown the Onion before the battery pack is empty.
I found this: https://www.adafruit.com/products/1944
My technical english is not the best so may one be able to tell me if:
- power is un-interrupted when Vin is disconnected / connected (i am already pretty sure it is capable of it)
- read if output power is delivered from battery or not
- one can put this between micro-usb and computer and serial interface will still work
@Benjamin-Rau we've used the Adafruit Powerboost 500 with the Omega at the office with success.
To answer some of your questions:
- The power to the load is not interrupted when a microUSB power source is connected to the Powerboost PCB
- As far as I know, the output power is always being provided by the battery, even when the battery is being charged (I could be wrong though)
- No, the serial interface will not work, there is no USB data propagation on the Powerboost PCB
Just a reminder: the Onion Power Dock will be available soon, so there will be no need to use the Powerboost PCB in the future :)
@Lazar-Demin Thanks for your reply also. I know about the Onion Battery pack, i backed it ;) Unfortunately it is pretty delayed and my 3 month road trip starts in 3 weeks, which my Onion is going to track and create a timelapse from it... sorry that was OT.
The Adafruit Power Board has the USB Vin extracted on the board so you can use it as GPIO i think and when its low i know that the power supply has gone and can shutdown the onion safely.
Also there is a Low Power Pin that can be used for the same reason but you can run the Onion as long as possible on battery.
I will give it a try and switch to the Onion Battery Pack later... hopefully it has such Low Battery and "is power source connected" pins also.
@Lazar-Demin On which pins could i connect the 5V and Ground for input power when i dont want to use microusb cable. I tried the 5V pin on the expansion board but it doesnt work. Maybe i have to connect ground to one specific pin?
@Benjamin-Rau I am assuming you are using an expansion dock.
I have successfully powered my Omega connected to an expansion dock from a 5v power source with the 5v connected to the expansion dock pin marked 5v near the RST pin and the ground of the power source to the GND pin at the end (next to the RST and 3.3v pins)
@Benjamin-Rau Either of the 5V pins and any of the three GND pins on the Expansion Dock will work (they're all connected on the PCB).
If it still doesn't work, please post a photo of your setup.
I created a small python script that i start on boot and which monitors low battery and input power status powers the onion off before an empty battery would kill the onion hard:
I made use of the gpio wrapper one of the onioneers contributed:
@Benjamin-Rau Awesome! I like the Python script that halts the Omega when the battery gets low.
Side note: there's also an Onion GPIO Python module: https://wiki.onion.io/Documentation/Libraries/GPIO-Library
Maybe coming up with a dumb question but "How to power on the Omega after powering it off from within the os with halt command?"
My problem now is that i power the Omega off with my script mentioned above but i dont know how to power it on again when power source recovered. The problem is that the from the Omegas perspective the power source never disconnected so i would need to "send some power on signal with HIGH..."
@Benjamin-Rau I think you have yourself a kind of logical conundrum :-) Once you have halted your Omega (because power is getting low) using your script, it is now no longer running and thus will not be able to respond to any input signal you may devise.
I'm not a Python expert, but I gather that your script keeps going and does not halt unless the power low condition remains for a given period (1 minute ?). I assume that the intention is that you need to do some cleanup or tidy shut down action prior to power actually failing totally.
My best suggestion would be to not do the halt operation (but continue to do cleanup operations as required) while power is low. Then,if power is restored fully before it finally fails you will continue processing OK. If power does fail completely then (a) your system should still be in a clean state; and (b) your system should restart normally when power is restored
If this is not sufficient for your requirements, you may have to consider some external circuitry that (a) you can control to fully turn off your system when power is low for too long; and (b) which re-applies power to your system when power re-attains acceptable levels. I'm sure that something using latching relays or similar could be contrived to do this.
As an addendum to the above, as a final comment to this, in your original post you said: When i stop the car... the power is off. And mama told me that this isnt the way to shutdown a computer :-)
The only real reason that powering off is not a good way to shut down a computer is because there may be data in memory that hasn't been physically written (flushed) to open files. Thus, so long as when you know power is getting low and may fail, you ensure that all pending output is done, you should be OK when/if power does fail.
Hej @Kit-Bishop, thanks for your reply.
YOu are right that was kind of a logical conundrum combined with bad english and misunderstadings ;)
I cleared the situation now out for me and i am one step ahead.
As usual another blocker:
When connecting the LowBattery (LBO) output of the Adafruid PowerBoost to any GPIO on my Omega the LB Led on the module (also if it was off before) starts shining and the GPIO is logical HIGH, even when the LED was off before.
When i remove the cable from GPIO to LBO the LED is off again.
Tonight i will test the LBO with an Arduino (others in the internet report that the LBO is worked very well for them) but maybe in the meantime one has an idea why the LBO is high always when the cable is connected.
@Benjamin-Rau From looking at the schematics for the Adafruit PowerBost (https://learn.adafruit.com/downloads/pdf/adafruit-powerboost.pdf), its LB LED would be turned on if the LBO line is driven/held low.
- Are you sure that your Omega GPIO pin is configured as an INPUT?
Additionally, the Application Schematic for the TPS61090 chip used in the PowerBoost indicates that a pull-up resistor should be used on the LBO line (see http://www.ti.com/lit/ds/symlink/tps61090.pdf). There is no such pull-up in the PowerBoost schematics
- I would suggest a pull-up resistor on the GPIO pin used for the LBO - I guess around 10K Ohm should do.