Page 1 of 12

OSD Battery Monitoring for Helder's AIO Boards

Posted: Sat May 06, 2017 12:23 pm
by HoolyHoo
I've been working on an on screen battery solution for builds using Helder's AIO boards. As some may know, his board uses the Atmega32u4 chip which has analog pins that can be used for an assortment of things such as analog joysticks and stuff. On his latest board he broke out four of the unused analog pins which I was able to use to read battery voltage. My solution is pretty simple and only requires on the hardware side a DPDT switch, a resistor and a simple wire connection to one of the extra analog pins. Then after that its just a matter of following the instructions for software setup on my github page and flashing Helder's board with the new hex. I have tested this with an PowerBoost 1000C and Helder has with a Banggood power supply. I have included two schematics on the github page.

The scripts I wrote will monitor the battery voltage and give you on screen feedback with an icon. Also will give you a low battery warning video and then will show a different video when it reaches critical level to let you know it will automatically gracefully shutdown. As a bonus in the script, I have included the option to add a shutdown button (location is up to you but the hole where original power outlet connects is ideal) that will graceful shutdown the gbz without having to go through the menu. Much easier, just push the button, hold for two seconds, and it will shutdown. Then just flip the on/off switch to off.

Also, remember that the boards will need to be reflashed with the new hex. I have included one for analog joystick users and one for non users. The hex also fixes the responsiveness and double button presses. Analog joystick is also much better. Also was able to fix and add the ability to scroll through and select in the DOS style menus. These hex can be used to fix these things even if you opt not to use the battery monitoring solution. The hex will monitor ADC 0 on Helder's latest board but if you do not use the analog joystick it can be modified to use one of those analog pins on his older boards that do not have pins broken out. If anyone needs this let me know.

I have tested these in my latest build but I welcome all testers for feedback. :D

Here is a photo of the battery monitor in my build.
StillBat.jpg
StillBat.jpg (368.81 KiB) Viewed 9168 times
And a photo of the video in the process of shutting down after reaching battery critical level.
videoSD.jpeg
videoSD.jpeg (570.81 KiB) Viewed 9168 times
You can go to my github page for the files needed.

HoolyHoo's Github

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sat May 06, 2017 3:48 pm
by AAMinistry
Awesome work. I am still waiting on a few parts for my first GBZ build but I will be able to put this to use with Helder's 2.2a board straight away :)

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sat May 06, 2017 10:09 pm
by dadi4168
outstanding....you know, if you good people keep coming up with these fantastic features, I'll never finish my project! :lol:

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 12:12 pm
by umbynos95
Wow! Great work! I have a question for you, I'm using Camble Safe Shutdown v1.0 for powerboost.. It is possible to have your script running only fot the battery icon and not for the shutdown part? In my case the dpdt swich is required?

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 12:51 pm
by HoolyHoo
umbynos95 wrote:
Sun May 07, 2017 12:12 pm
Wow! Great work! I have a question for you, I'm using Camble Safe Shutdown v1.0 for powerboost.. It is possible to have your script running only fot the battery icon and not for the shutdown part? In my case the dpdt swich is required?
The shutdown button is independent from the the battery monitoring so the shutdown button is not required. The battery monitoring script incorporates the battery icons along with shutdown when going battery level critically low but can be disabled to never initiate the shutdown within the script if you wanted it to. The DPDT switch is required to keep the battery from powering the Atmega chip while the unit is turned off. The good news is Cambles circuit includes a DPDT switch. The bad news, as far as I can tell the ON rails are occupied, at least on the bang good edition. You'll have to check with him about the PB edition. Maybe if you find out you can get back to us. ;)

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 1:14 pm
by umbynos95
Ok thank you! If I have news I'll post here :D

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 6:32 pm
by Lphillimore
This is awesome. Cant wait to set this up on the two builds i have that utilise the AIO 2.2!

One question and apologies if obvious.... I'm assuming most people are already using DPDT switches as per Wermys parts guide? I certainly am.

I have spare wire and resistors so i think im set :mrgreen:

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 6:46 pm
by HoolyHoo
Lphillimore wrote:
Sun May 07, 2017 6:32 pm
This is awesome. Cant wait to set this up on the two builds i have that utilise the AIO 2.2!

One question and apologies if obvious.... I'm assuming most people are already using DPDT switches as per Wermys parts guide? I certainly am.

I have spare wire and resistors so i think im set :mrgreen:
I think they are common in builds now but not 100% used so it's the reason it's mentioned. Let me know how it works out or you. :D

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Sun May 07, 2017 7:11 pm
by Lphillimore
@HoolyHoo Yeah good call. Thanks for confirming. Was hoping I didn't nees more parts for my ever growing collection :D Will let you know once ive hooked this up and tested.

Thanks for your efforts on this!

Re: OSD Battery Monitoring for Helder's AIO Boards

Posted: Tue May 09, 2017 8:46 am
by 144TECH
@HoolyHoo
So when i use a camble ssd switch, i assume you can hook this up by using a piece of wire with the resistor connected to ''bat'' on the powerboost 1000c and from there to the aio adc0 to make it working right?(offcourse reprogrammed first with usbasp) i have used the ''vs'' pin of the powerboost for camble's ssd. and having the pin ''bat'' unused so from there the idea. (could it make a conflict with camble's battery mp4's ? kinda showing up the same time? so maybe need to remove one set of mp4's?)
Oh and man, thanks for that stormtrooper theme it's really what i wanted :D