[GUIDE] Battery icon indicator guide with MCP3008

Various user-contributed guides for hardware-related things
salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 36 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by salami738 » Tue Nov 14, 2017 2:40 am

@activex: I started a project with a arduino leonardo based solution on measuring battery voltage (analog in) and usage of i2c to transmit it to the raspberry. Also i used averaging of the measured voltages over 10s to make the indicator stable.
pros are: no additional components, if you are already using a leonardo or a clone

Am i allowed to modify your source code for this and post a guide?

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 36 times

Re: Battery icon indicator guide with MCP3008

Post by salami738 » Tue Nov 14, 2017 2:46 am

activex wrote:
Sun Dec 18, 2016 9:24 am
BenOfTheNorth wrote:Very nice, thanks! Is it worth going from the 100/75/50/25 values to more detailed levels, or does the accuracy of the voltages not really make this feasible?
I tried using 10% steps, but that was too unstable with my 2000mAh battery, with a bigger battery and/or another controller it might work better
Hi, you can average the read values over 10s for example to stabilize the values.
In addition you can add a small capacitor between the adc input and ground.
I done both and have now very stable readings.

activex
Posts: 36
Joined: Mon Oct 31, 2016 5:19 am
Has thanked: 10 times
Been thanked: 24 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by activex » Tue Nov 14, 2017 4:02 am

salami738 wrote:
Tue Nov 14, 2017 2:40 am
@activex: I started a project with a arduino leonardo based solution on measuring battery voltage (analog in) and usage of i2c to transmit it to the raspberry. Also i used averaging of the measured voltages over 10s to make the indicator stable.
pros are: no additional components, if you are already using a leonardo or a clone

Am i allowed to modify your source code for this and post a guide?
No problem!

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 36 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by salami738 » Wed Nov 15, 2017 12:09 pm

@activex: Can you give me (https://github.com/salami738) permissions to push changes to your repository or make me a new branch?
Have made some improvements and want go give them back.

Improvements so far:
- Only change icon if state has been changed (lower cpu usage)
- Removed unnecessary sudo for changing icon
- Made a few alternative icons

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 36 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by salami738 » Thu Nov 16, 2017 12:41 pm

Hi, thanks for changing permissions on your repository! Made a pull request: https://github.com/joachimvenaas/gbzbat ... tor/pull/3
You can review it and merge it, if you like it. Greetings!

Post Reply

Who is online

Users browsing this forum: Google Adsense [Bot] and 1 guest