[GUIDE] Battery icon indicator guide with MCP3008

Various user-contributed guides for hardware-related things
activex
Posts: 36
Joined: Mon Oct 31, 2016 5:19 am
Has thanked: 10 times
Been thanked: 24 times

[GUIDE] Battery icon indicator guide with MCP3008

Post by activex » Sun Dec 18, 2016 5:03 am

Hi all!

I'we finally found some spare time to do a short rough guide on how to add a battery indicator on your GBZ with a MCP3008.
This guide include the hardware installation of the MCP3008 chip, hardware/software part for using LEDS, software part for using videoclips for warnings and shutdown, and software part for having a onscreen battery icon.

Some skills with hardware, and software is required for getting this to work properly!

https://github.com/joachimvenaas/gbzbatterymonitor

It's very rough, so if you have some problems, let me know!
Also, modify as you like! And if you make it better, make sure everyone to post it here so everyone can take advantage of it!
Attachments
IMG_0308.jpg
IMG_0308.jpg (1.62 MiB) Viewed 7047 times
Last edited by activex on Sun Dec 18, 2016 7:09 pm, edited 1 time in total.

BenOfTheNorth
Posts: 55
Joined: Sat Nov 12, 2016 12:26 pm
Has thanked: 52 times
Been thanked: 9 times

Re: Battery icon indicator guide with MCP3008

Post by BenOfTheNorth » Sun Dec 18, 2016 7:27 am

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?

User avatar
Helder
Trailblazer
Trailblazer
Posts: 2749
Joined: Thu May 05, 2016 8:33 am
Location: Fall River, MA
Has thanked: 1402 times
Been thanked: 3069 times

Re: Battery icon indicator guide with MCP3008

Post by Helder » Sun Dec 18, 2016 8:58 am

Made a simple board for this project so it's a little easier for the novice or to make it tidy:

https://oshpark.com/projects/hd9tu1Lp
My Sale Threads:

Retro PSU, 3.5A output!


Chat with me and other members


Don't contact me about obtaining my board files (as you will not get them). Don't contact me about any of my boards if they are sold out, they will be restocked as soon as I can get them.


Don't support thieves like ckliang who copied my AIO to resell and is now cloning the mintyPi, support the original creators and not the thieves!

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

Re: Battery icon indicator guide with MCP3008

Post by activex » 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
Last edited by activex on Sun Dec 18, 2016 9:26 am, edited 2 times in total.

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

Re: Battery icon indicator guide with MCP3008

Post by activex » Sun Dec 18, 2016 9:25 am

Helder wrote:Made a simple board for this project so it's a little easier for the novice or to make it tidy:

https://oshpark.com/projects/hd9tu1Lp
Excellent :D

User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 182 times
Been thanked: 257 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by Fleder » Tue Dec 20, 2016 11:36 am

Really great work, thank you!
Does this work on every Raspbian based OS?

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 Dec 20, 2016 11:39 am

Fleder wrote:Really great work, thank you!
Does this work on every Raspbian based OS?
I guess so, but you may have to install some extra packages. I have only tested on retropie

User avatar
johweb
Posts: 61
Joined: Sun Aug 21, 2016 10:28 pm
Has thanked: 9 times
Been thanked: 7 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by johweb » Tue Dec 20, 2016 9:54 pm

Thanks for this guide, it's interesting me for a future build !
Just two questions :
1/ in the guide picture, you're wiring the mcp3008 directly to the battery. Is it possible to connect from somewhere else ine the build ? From the powerstrip instead of the battery for example ?
2/ just for my information on how it works : the first time I looked at the picture, it seemed strange to me to connect both anode and cathode from the battery to the same pin of the mcp3008. Doesn't it make a short ? How is it working ?
Thanks a lot for your answers, and for the guide !

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 Dec 20, 2016 10:03 pm

johweb wrote:Thanks for this guide, it's interesting me for a future build !
Just two questions :
1/ in the guide picture, you're wiring the mcp3008 directly to the battery. Is it possible to connect from somewhere else ine the build ? From the powerstrip instead of the battery for example ?
2/ just for my information on how it works : the first time I looked at the picture, it seemed strange to me to connect both anode and cathode from the battery to the same pin of the mcp3008. Doesn't it make a short ? How is it working ?
Thanks a lot for your answers, and for the guide !
1: it will not work while connected to the powerstrip. Thats because the powerstrip is always 5V. The battery is somewhere between 4.2-3.2V, depending on how much juice there is left
2: its not connected directly. Its a resistor on both wires. The reason being we need to get a lower voltage value than 3.3V for monitoring. With the two resistors I used in the example, 4.2V (full battery) will be divided to 3.2V. Read more about voltage divider to learn some more :D

User avatar
johweb
Posts: 61
Joined: Sun Aug 21, 2016 10:28 pm
Has thanked: 9 times
Been thanked: 7 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by johweb » Tue Dec 20, 2016 10:14 pm

Yes, I really need to learn some more ! ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest