On-Screen Battery Monitor Options

General GBZ-related chat goes here. Share ideas, tips and tricks, or ask questions that don't fit into the hardware/software help forums.
Post Reply
User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

On-Screen Battery Monitor Options

Post by VeteranGamer » Fri Nov 10, 2017 2:45 am

rodocop has recently finished his 7th build (double digits just around the corner) :)

http://sudomod.com/forum/viewtopic.php?f=43&t=4577

and he used one of the battery monitor add-ons for the mintyPi in his build, which give him a battery status on screen while only having a simple common ground pcb (enabled by HoolyHoo script)

Image

Image


this got me thinking :? .....
that there must be an option out there for others that would like to do something similar, bearing in mind that Helder battery monitor add-on is not available to buy....


i had a brief look online, and with my basic knowledge on these things came across some items that might or might not be a viable option
(i need some experienced/expertise feedback on this)


Adafruit do a current sensor (Adafruit INA219)
https://learn.adafruit.com/adafruit-ina ... e?view=all

Image


Aliexpress have the same item for a fraction of the cost
https://www.aliexpress.com/item/-/32676 ... 278.i5KQVy


there is also this that i saw another member mention before (not sure again if its a viable option)
available from Sparkfun
https://www.sparkfun.com/products/12918

Image


Aliexpress have the same item for a fraction of the cost
https://www.aliexpress.com/item/MCP4725 ... 285.i5KQVy


now i could be barking up the wrong tree here......
but if i am, i would appriciate it if some input can be given on this (especially from HoolyHoo)


if these are viable options....

1) will they work with HoolyHoo current script or any script (for the mintyPi)
2) if they do work with the script, how will that impact the build if you plan to have one of Cambles Safe Shutdown (as a shutdown function is already written into the script)


if these are not a viable option what would be, or can there be a board made available to the community for Game Boy builds or other similar builds.....


Thank you

.

User avatar
HoolyHoo
Posts: 766
Joined: Sat Jul 09, 2016 9:34 pm
Has thanked: 206 times
Been thanked: 741 times

Re: On-Screen Battery Monitor Options

Post by HoolyHoo » Fri Nov 10, 2017 4:55 am

Ok, let me try to take your questions in order.

Respective to the two boards you linked, the first, as far as I know, doesn’t have a python library to interface with. My script is pure python based, as it makes it easier to communicate with the pi. That being said, perhaps builds with atmega32u4 chips could benefit from this board but a total rewrite of the python interface script would need to be written as well as the Arduino code for your micro controller.

Board number two is not an option. That board is a DAC. What you want is an ADC board to read the battery voltage.

The breakout board you seek is more in line with this one.
https://rover.ebay.com/rover/0/0/0?mpre ... 1983738594

Keep in mind that that the script I wrote for the latest MintyPi image was specifically coded for it since the combos are integrated with the battery monitoring. The Mintypi uses Retrogame for the controls, so if your build uses GPIO’s for button control, then it’s possible as Rodocop did. Otherwise a rewrite of the code is needed with Arduino builds.

As far as using with Camble’s Safe shutdown, I have not dived deep enough into his code to see if conflicts would occur but my guess that it would be possible but merging or rewrites of code would also be necessary.

The short of it is, if using a plain button control setup as rodocop did and using the linked board, you should be able to get it going.

Hope this helps 😉

User avatar
dryja123
Posts: 1076
Joined: Tue May 09, 2017 5:34 pm
Location: Central NJ
Has thanked: 239 times
Been thanked: 553 times

Re: On-Screen Battery Monitor Options

Post by dryja123 » Fri Nov 10, 2017 5:00 am

Hey, I linked the sparkfun board in another thread and found that it will not work. You need to find an i2c ADC, not DAC, with SDA and SCL channel pinouts. I did some searching and was not able to find a viable option.

Maybe if we make the pitch to Helder he could stock a few of his battery monitor boards for those who would like to use them for other projects. I know I'm working on a few custom gaming projects right now and would like to have 1 or 2.

Abunchahicks
Posts: 52
Joined: Thu Jul 20, 2017 4:08 pm
Has thanked: 3 times
Been thanked: 11 times

Re: On-Screen Battery Monitor Options

Post by Abunchahicks » Fri Nov 10, 2017 5:13 am

I'm very interested in this as well.

codeman0624
Posts: 109
Joined: Wed Nov 23, 2016 10:19 am
Has thanked: 3 times
Been thanked: 74 times

Re: On-Screen Battery Monitor Options

Post by codeman0624 » Fri Nov 10, 2017 5:39 am

You could use this:
https://www.sparkfun.com/products/10617

It has a very similar IC to what I've been using on my SP AIO boards. It has an I2C interface, so in theory all you would need to do is change the I2C address, and change the register read in the script and it should work.

It measures the voltage for you, but it also has a cool option of providing an actual percentage value, rather than just the battery voltage. I've found this to be more accurate than just reading the battery voltage since LiPo voltage curves can be complicated

User avatar
Thump52
Posts: 111
Joined: Fri Feb 03, 2017 7:34 am
Has thanked: 7 times
Been thanked: 27 times

Re: On-Screen Battery Monitor Options

Post by Thump52 » Fri Nov 10, 2017 7:14 am

Lets ask Helder to bring back the battery monitor, I would really like to use it in my next GBZ Build, I PM'd helder yesterday to ask if the battery monitor is still available, he said no but with enough interest he might bring it back, so lets show him that we are very interested, I know if he brings them back I will buy 4 to start with, HOW MANY WOULD YOU BUY?
Gus 8-)

joeygbsn
Posts: 50
Joined: Sun Nov 06, 2016 11:07 pm
Has thanked: 6 times
Been thanked: 15 times

Re: On-Screen Battery Monitor Options

Post by joeygbsn » Fri Nov 10, 2017 7:53 am

The battery fuel gauge linked by codeman seems ideal. Im using this coulomb counter in another project that could be made to work although you need to use interrupts so might not be as easy to use as the fuel gauge. https://www.sparkfun.com/products/12052

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

Re: On-Screen Battery Monitor Options

Post by VeteranGamer » Fri Nov 10, 2017 8:10 am

HoolyHoo wrote:
Fri Nov 10, 2017 4:55 am
Ok, let me try to take your questions in order.

The breakout board you seek is more in line with this one.
https://rover.ebay.com/rover/0/0/0?mpre ... 1983738594

Keep in mind that that the script I wrote for the latest MintyPi image was specifically coded for it since the combos are integrated with the battery monitoring.

As far as using with Camble’s Safe shutdown, I have not dived deep enough into his code to see if conflicts would occur but my guess that it would be possible but merging or rewrites of code would also be necessary.

The short of it is, if using a plain button control setup as rodocop did and using the linked board, you should be able to get it going.

Hope this helps 😉
Really appreciate the reply....

providing that my controls are via GPIO (using retrogame)
and for now i dont have one of cambles safe shutdown installed

firstly
the breakout board you suggested....
could that work out of the box with your script (even if its with an older version of the script)...
or is it just an example of the type of board that could be made to work with your script....

secondly
if it does work out of the box, is there a way to edit or mute (turn off) the safe shutdown part of the script or just not have that part of the script installed.....


or something like this
(maybe slightly modified to work, if it doesnt already work out of the box)

Image

https://www.aliexpress.com/item/ADS1015 ... 9f227b67f4


.

User avatar
HoolyHoo
Posts: 766
Joined: Sat Jul 09, 2016 9:34 pm
Has thanked: 206 times
Been thanked: 741 times

Re: On-Screen Battery Monitor Options

Post by HoolyHoo » Fri Nov 10, 2017 8:18 am

Really appreciate the reply....

providing that my controls are via GPIO (using retrogame)
and for now i dont have one of cambles safe shutdown installed

firstly
the breakout board you suggested....
could that work out of the box with your script (even if its with an older version of the script)...
or is it just an example of the type of board that could be made to work with your script....

secondly
if it does work out of the box, is there a way to edit or mute (turn off) the safe shutdown part of the script or just not have that part of the script installed.....
Yes, it would work out of the box, just need to make sure you wire it correctly, obviously.

On the second question, if you are referring to my script, then yes, that is totally possible and easy enough to do with a few minor edits to the script.

User avatar
rodocop
Posts: 1723
Joined: Mon Aug 22, 2016 3:14 pm
Location: Saskatchewan
Has thanked: 606 times
Been thanked: 608 times

Re: On-Screen Battery Monitor Options

Post by rodocop » Sat Nov 11, 2017 6:12 pm

Glad my project sparked this thread. I'd be interested to implement battery monitors in upcoming builds as well.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest