On-Screen Battery Monitor Options
Re: On-Screen Battery Monitor Options
*EDIT: see the revisions below for a better diagram
Thank you to everyone above for the diagrams and discussions. I'm not sure if this should go in it's own post under support, but I am piecing together my first build and am wanting to include an ADS1015 with HoolyHoo's battery monitor script. I think I have figured out how to add this in with my other parts, but was wondering if someone could look at my diagram and let me if it looked like it would work. The post above by hueblo helped me out a lot, but as I'm not using an "all-in-one" board or camble's board, I still have some spots I'm unsure about.
Thanks in advance! I think this configuration of parts may be common, so hopefully this will help other people as well.
Thank you to everyone above for the diagrams and discussions. I'm not sure if this should go in it's own post under support, but I am piecing together my first build and am wanting to include an ADS1015 with HoolyHoo's battery monitor script. I think I have figured out how to add this in with my other parts, but was wondering if someone could look at my diagram and let me if it looked like it would work. The post above by hueblo helped me out a lot, but as I'm not using an "all-in-one" board or camble's board, I still have some spots I'm unsure about.
Thanks in advance! I think this configuration of parts may be common, so hopefully this will help other people as well.
Last edited by Talc on Mon Dec 31, 2018 1:41 pm, edited 1 time in total.
- 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
I notice a few things with you diagram. The ads needs battery voltage to a0 not 5v like seen. Also your dpdt switch, you only need en and ground you do not need to switch bat power to the pi. (Grounding EN turns the powerboost off).
I would wire en and ground as you have, and then wire bat + to the other side of the switch then to a0, that way the battery will be cut off from the ads when the switch is off.
Also, sda and scl on the ads need to go to the pi's gpio's.
I also reccomend a power strip. Run 5v and ground to the power strip, then power all components from that power strip.
I would wire en and ground as you have, and then wire bat + to the other side of the switch then to a0, that way the battery will be cut off from the ads when the switch is off.
Also, sda and scl on the ads need to go to the pi's gpio's.
I also reccomend a power strip. Run 5v and ground to the power strip, then power all components from that power strip.
_____________________________________________________
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
Re: On-Screen Battery Monitor Options
Thanks rodocop! I updated the diagram per your review above and based on doing more research on the adafruit website. Also, I decided to pull the vdd and ground for the ADS1015 from the USB connector pads of the Powerboost (Like how hueblo did it).rodocop wrote: ↑Mon Dec 31, 2018 7:36 amI notice a few things with you diagram. The ads needs battery voltage to a0 not 5v like seen. Also your dpdt switch, you only need en and ground you do not need to switch bat power to the pi. (Grounding EN turns the powerboost off).
I would wire en and ground as you have, and then wire bat + to the other side of the switch then to a0, that way the battery will be cut off from the ads when the switch is off.
Also, sda and scl on the ads need to go to the pi's gpio's.
I also reccomend a power strip. Run 5v and ground to the power strip, then power all components from that power strip.
For the power strip, is there any difference between running 5v and ground to a power strip and running 5v and ground to the common ground board?
Thanks again for the support.
- 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
I guess tinkerboys board has a built in power stip kinda. Just run 5v and gnd to his board. And power components from the various 5v and gnd pads . Or add a standalone power strip. Up to you.
_____________________________________________________
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
Re: On-Screen Battery Monitor Options
So, since my last post I have constructed my Game Boy Zero, except I used a raspberry pi 2B board instead of the zero...
I wanted to report back on the diagram I posted before, and say it works, but I'm having an issue that I would like some help solving.
The script is triggering a safe shut down after <1 min. of playtime currently. I think the culprit is the 10k Ω resistor based on a previous post in this thread and my multi-meter readings, but I wanted to get some advice on this before I remove it. currently the script and pi run perfectly when the system is plugged into the charger (5v 3A) and while plugged in, I get a reading of 4.2~ish volts at the switch and at A0 on the ADS1015. However, while running on battery power this drops to 3.4~ish volts. The 5V pins on the pi are still reading at 5.00 volts while the pi is powered (whether by the battery or by the charger), and once the sctipt triggers and shuts down the pi, the 5V pins still read at 5.1~ish volts. This is what makes me suspect the resistor and not the power boost or the battery (measured the battery and it is putting out 3.7+volts after the script says it is dead).
I intend to remove the resistor this weekend, but would appreciate any advice or suggestions of other things to check as the thing is burred deep in the system and its going to be a pain to remove. Should I replace it with a smaller resistor? Does using a pi2 require changing the settings in the script? Any advice is appreciated.
I wanted to report back on the diagram I posted before, and say it works, but I'm having an issue that I would like some help solving.
The script is triggering a safe shut down after <1 min. of playtime currently. I think the culprit is the 10k Ω resistor based on a previous post in this thread and my multi-meter readings, but I wanted to get some advice on this before I remove it. currently the script and pi run perfectly when the system is plugged into the charger (5v 3A) and while plugged in, I get a reading of 4.2~ish volts at the switch and at A0 on the ADS1015. However, while running on battery power this drops to 3.4~ish volts. The 5V pins on the pi are still reading at 5.00 volts while the pi is powered (whether by the battery or by the charger), and once the sctipt triggers and shuts down the pi, the 5V pins still read at 5.1~ish volts. This is what makes me suspect the resistor and not the power boost or the battery (measured the battery and it is putting out 3.7+volts after the script says it is dead).
I intend to remove the resistor this weekend, but would appreciate any advice or suggestions of other things to check as the thing is burred deep in the system and its going to be a pain to remove. Should I replace it with a smaller resistor? Does using a pi2 require changing the settings in the script? Any advice is appreciated.
- Helder
- Trailblazer
- Posts: 2985
- Joined: Thu May 05, 2016 8:33 am
- Location: Rogers, AR
- Has thanked: 1459 times
- Been thanked: 3114 times
Re: On-Screen Battery Monitor Options
Measure the voltage after the resistor and going into the ADS1015 chip, it's very likely the voltage is hitting the threshold of the script values. Either check the values with the multimeter and make adjustments to the script or use a lower value resistor (but you will still need to get proper values for the script anyways)
Chat with me and other members On Discord
Don't contact me about obtaining my board files (as you will not get them). If my Boards or PCB Kits are sold out, they will be restocked as soon as I can get them and there is demand for them. You can join the mailing list on my Website to be notified when they are available.
Helder's Game Tech Website
We will not support any cloned work so don't come to us with technical issues to resolve, go talk to the cloner for help.
Don't contact me about obtaining my board files (as you will not get them). If my Boards or PCB Kits are sold out, they will be restocked as soon as I can get them and there is demand for them. You can join the mailing list on my Website to be notified when they are available.
Helder's Game Tech Website
We will not support any cloned work so don't come to us with technical issues to resolve, go talk to the cloner for help.
Re: On-Screen Battery Monitor Options
Thanks, everyone for this thread!
I added an ADS1015 to my build (Followed this: https://github.com/Gameboypi/SPW) as well.
I installed HoolyHoo's script (https://github.com/HoolyHoo/Mintybatter ... /README.md) and added the 10k resistor to A0, but for some reason, I can't get it to work.
1) The battery indicator doesn't show
2) The audio from the speaker now blasts very loud and I no longer can control the volume
Any suggestion on how to debug the issues?
I added an ADS1015 to my build (Followed this: https://github.com/Gameboypi/SPW) as well.
I installed HoolyHoo's script (https://github.com/HoolyHoo/Mintybatter ... /README.md) and added the 10k resistor to A0, but for some reason, I can't get it to work.
1) The battery indicator doesn't show
2) The audio from the speaker now blasts very loud and I no longer can control the volume
Any suggestion on how to debug the issues?
- 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
So, you have the SDA and SCL wired to the pi properly, and you have battery voltage to A0, and power and ground as well?Patrizio wrote: ↑Tue May 14, 2019 3:20 pmThanks, everyone for this thread!
I added an ADS1015 to my build (Followed this: https://github.com/Gameboypi/SPW) as well.
I installed HoolyHoo's script (https://github.com/HoolyHoo/Mintybatter ... /README.md) and added the 10k resistor to A0, but for some reason, I can't get it to work.
1) The battery indicator doesn't show
2) The audio from the speaker now blasts very loud and I no longer can control the volume
Any suggestion on how to debug the issues?
Also, in the script, there are gpios used to turn the icon on and off, and shut down, seen in the link below:
https://github.com/HoolyHoo/Mintybatter ... hutdown.py
shutdown_btn = Button(7, hold_time=1)
monitor_btn = Button(19, hold_time=2)
If you are using GPIO 19 for something, such as a button press or possibly audio that would cause an issue, you are using i2s audio? If so GPIO 19 is used (LRCLK is GPIO 19 ). I'd change the values in the script first. The fact that audio is messed up is very strange, but if you are using i2s this may be the reason why, and would also explain the icon not showing up as well.
_____________________________________________________
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
Re: On-Screen Battery Monitor Options
Thanks so much for helping out! I made some progress.rodocop wrote: ↑Tue May 14, 2019 4:05 pmSo, you have the SDA and SCL wired to the pi properly, and you have battery voltage to A0, and power and ground as well?Patrizio wrote: ↑Tue May 14, 2019 3:20 pmThanks, everyone for this thread!
I added an ADS1015 to my build (Followed this: https://github.com/Gameboypi/SPW) as well.
I installed HoolyHoo's script (https://github.com/HoolyHoo/Mintybatter ... /README.md) and added the 10k resistor to A0, but for some reason, I can't get it to work.
1) The battery indicator doesn't show
2) The audio from the speaker now blasts very loud and I no longer can control the volume
Any suggestion on how to debug the issues?
Also, in the script, there are gpios used to turn the icon on and off, and shut down, seen in the link below:
https://github.com/HoolyHoo/Mintybatter ... hutdown.py
shutdown_btn = Button(7, hold_time=1)
monitor_btn = Button(19, hold_time=2)
If you are using GPIO 19 for something, such as a button press or possibly audio that would cause an issue, you are using i2s audio? If so GPIO 19 is used (LRCLK is GPIO 19 ). I'd change the values in the script first. The fact that audio is messed up is very strange, but if you are using i2s this may be the reason why, and would also explain the icon not showing up as well.
You're right, the build is using i2s audio, so I was able to fix the audio issue by changing the buttons to:
shutdown_btn = Button(13, hold_time=1) ---> Mode Button
monitor_btn = Button(5, hold_time=2) ---> Select Button
I had initially inverted SDA and SCL (and I was getting the i2c not found error), but they should be ok now (I followed this image posted by the person that created this build initially: https://imgur.com/gallery/Y3OOpzn).
I can successfully press and hold the mode button, which will trigger the shutdown.
I tried with the Select button to trigger the on/off battery indicator but no luck.
I have tested with both usb only and battery only. During the tests, the system did randomly shut down twice, which makes me think that something is happening behind the scenes.
if I connect to the usb and run i2cdetects -y 1 I get the following, not sure if this means anything:
- 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
Hmm. I would try to bypass the a0 on the pcb. Try wiring a0 on the ads1015 direct to the b+ out on the tp4056 and see if that helps. Is there any other scripts running that might be causing interference?
Also, can you confirm, are you using an ads1015, or 1115, since the 1115 would need modification to the script too.
Also, can you confirm, are you using an ads1015, or 1115, since the 1115 would need modification to the script too.
_____________________________________________________
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
My Minty Pi builds:
http://www.sudomod.com/forum/viewtopic.php?f=32&t=3628
My GBZ builds:
http://www.sudomod.com/forum/viewtopic. ... 813#p50813
My modded DMG-01's:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2696
My NESpi:
http://www.sudomod.com/forum/viewtopic.php?f=13&t=2941
My Gaboze Pocaio's
https://sudomod.com/forum/viewtopic.php?f=13&t=6063
Who is online
Users browsing this forum: No registered users and 1 guest