Homebrew (more) accurate DS battery meter

0ddity

Well-Known Member
OP
Member
Joined
Aug 7, 2010
Messages
444
Trophies
0
Age
39
Location
Ontario
Website
Visit site
XP
247
Country
Canada
To start off, I'll let you know I know nothing about programming, I just had an idea for how it might be possible to get a more accurate battery meter as a plugin for SCDS2 (don't think any other cards could support the kind of multitasking I was thinking about.)

So you would need a few different elements, first, a battery benchmark. You'd run the program, leaving the DS on with a full charge, and the benchmark would count how long it takes to completely drain the battery. 2nd, you'd need a charging benchmark, to see how long it would take to charge 100% from a total dead battery. Using these two data points as references, a 3rd program could keep track of how long the DS is on, and comparing against the drain benchmark, could tell you with much greater accuracy how much time is left of the battery, and maybe draw this information as a battery icon. The charge benchmark would be used to calculate how much time is added to the battery if it's plugged in without a full discharge, and unplugged without a full charge.

Anyways, like I said I know nothing about programming, or about the multitasking ability of cards like the DS2, but I was thinking about how to get a more accurate reading of the battery status and this was the only way I could think of.
 

CannonFoddr

Regular GBATemp Lurker
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
Well I know nothing about programming either (well actually that's a lie - I know a VERY little bit) but I can see one or two small problems

Firstly, I don't think the DS2 has 'multitasking capabilities' it either uses the CPU/Memory of the card OR it uses the DS CPU/Memory

Next - IF you start a program up on a fully charged battery & the battery dies HOW would the program know when to stop ??

The only way a program can determine how long something 'runs' is with a timer of some sort - you could start the timer up, but if the battery dies then you would lose the timer value
- the best you could do is MONITOR the battery level & set a minimum limit

IF the battery level goes below this level (which has to be higher than the DS(i) normal cut-off level) THEN stop the timer & record (somehow) the time. This would be the 'Battery life from fully charged'

Another problem - with the 'charging benchmark' - If you had a fully flat battery, you won't have any power to start the program, which in turn won't be able to start a timer up

Even if you COULD start the program up automatically when you had enough charge to run it - you would still need to monitor the battery level to determine when the battery is fully charged - which will never happen since you are using the battery to run a program which will always cause a drain
(although you MIGHT get a blip into 100% at times)

& Without the first 2 benchmarks times - you won't be able to do the 3rd program to 'monitor'

--------------------
The best anyone could do (IMHO) is a program that monitors the battery voltage on program startup, record when battery has reduced by 10%,20%,30% etc until voltage reaches a 'Minimum level' - & record the time @ each value
THEN have the same program compare the original values with further tests to see how much they differ to give you an indication on how well your battery is or whether it's failing
 

0ddity

Well-Known Member
OP
Member
Joined
Aug 7, 2010
Messages
444
Trophies
0
Age
39
Location
Ontario
Website
Visit site
XP
247
Country
Canada
CannonFoddr said:
Well I know nothing about programming either (well actually that's a lie - I know a VERY little bit) but I can see one or two small problems

Firstly, I don't think the DS2 has 'multitasking capabilities' it either uses the CPU/Memory of the card OR it uses the DS CPU/Memory

Well I know it has an in-game menu, so I thought something similar could be run in the background, a small footprint timer for instance.

QUOTE said:
Next - IF you start a program up on a fully charged battery & the battery dies HOW would the program know when to stop ??
Same way moonshell 2 does I supposed. If you're watching a movie, and the battery dies, it remembers where you were in the movie and resumes it next time you start it up.

QUOTE said:
The only way a program can determine how long something 'runs' is with a timer of some sort - you could start the timer up, but if the battery dies then you would lose the timer value
- the best you could do is MONITOR the battery level & set a minimum limit
See my idea from above, the timer would stop when the battery dies, and that information would be saved, similar to how MS2 keeps your place in a video.
Another problem - with the 'charging benchmark' - If you had a fully flat battery, you won't have any power to start the program, which in turn won't be able to start a timer up

QUOTEEven if you COULD start the program up automatically when you had enough charge to run it - you would still need to monitor the battery level to determine when the battery is fully charged - which will never happen since you are using the battery to run a program which will always cause a drain
You could start the charging benchmark manually as soon as you plug in the DS from a dead battery. I know the DS knows when the battery is full charged, because on the DSL at least, the orange charging light turns off.
QUOTE
& Without the first 2 benchmarks times - you won't be able to do the 3rd program to 'monitor'
I think I explained how you could theoretically get the first 2 benchmarks to run.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,485
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,914
Country
United States
I believe Moonshell2 is resuming based on increments of the audio/movie (maybe 5 second increments), meaning it is constantly saving a new resume point every 5 seconds (or maybe increasing a number by one every 5 seconds and then that number gets multiplied by 5 and made as the resume point).

Supposing someone used this method, and attempt trying to get more accurate results by decreasing the length of each increment...I'm pretty sure it would require some memory accessing (which spikes the energy a bit and would definitely ruin the use of benchmarking the battery) to actually save the information somewhere. Not only that, but supposing you attempt getting a good benchmark and drain your battery, it supposedly isn't the best thing to do for prolonging your battery's lifespan.

Quite frankly, I don't see the point in seeing the level of change still in the battery beyond "Need to charge" and "Don't need to charge"...I'm guessing Nintendo thought the same thing since the DS can only differentiate between three levels of charge apparently.
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
If I'm not mistaken, the DS itself can get a capacity reading based on the battery charge, much like the 'self test' AA/AAA batteries that were popular a few years back, which actually is the most accurate way since it's based on the actual power levels and not just a set time since the battery capacity degrades over time, as it's used and as it's charged.

Also the DS has, I believe, 4 levels of battery charge: Full (>75%), "2/3rds" (>50%) "1/3rd" (>25%) and Empty (
 

trumpet-205

Embrace the darkness within
Member
Joined
Jan 14, 2009
Messages
4,363
Trophies
0
Website
Visit site
XP
693
Country
United States
In order to measure how much charge is left, you must, in a way, find out the current voltage of the battery. Using voltage and mAh you can make an estimate of how much charge is left.
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
trumpet-205 said:
In order to measure how much charge is left, you must, in a way, find out the current voltage of the battery. Using voltage and mAh you can make an estimate of how much charge is left.Which is how it is done internally on the DS' menu.


QUOTE(tombot @ Oct 3 2010, 10:32 PM) Don't forget you need to take brightness and volume into consideration, so it can't simply be a timer.
And WiFi usage as well.
I've been on a low charge and had my DS turn red when updating the DQIX shop and back to green when WiFi disconnected.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: so true