Battery monitoring help
Battery monitoring help
Hi sudomoders,
I'm building a Game boy Pi 3A+, and I'm coming in to the power part.
I bought this Bllutech 5000mAh battery: https://bllutech.com/collections/frontp ... po-battery
and this tinkerboy powerswitch: https://www.tinkerboy.xyz/setup-and-wir ... werswitch/
I now ask for battery monitoring help. I wanted a retroPSU but helder told me that he doesnt ship to France anymore...
So my problem is that i saw many solution to monitor the battery level ! And i'm scared about finishing it without, at least, the system shutting down safely the gameboy with alert message if the battery power is too low.
I assume there is 2 important things here, the auto shutdown system and the battery icon on the top of the screen.
I think it's not possible with only the tinkerboy switch (it's not written in the doc..), so what are the options knowing that the best for me is obviously an icon appearing on the screen (the Helder'way https://heldergametech.com/shop/gameboy-zero/retropsu/) and the auto shutdown displaying an alert message.
I found that we can achieve it with a Leonardo Micro (here viewtopic.php?f=44&t=3537&start=20 and here viewtopic.php?f=44&t=7830&p=73108&hilit ... ing#p73108)
but i plugged my controlls with GPIO so is this board overkill if i just use it for battery monitoring ?
I read another example with an ADS1x15 (here: https://github.com/sixteenbit/Mintybatt ... Monitor.py)
I just dont know what to choose for my build and how to do it (what to plug where ?)
If someone can help, i would apreciate
And sorry for my english if i'm not clear, just tell me ! You know, french people...
I'm building a Game boy Pi 3A+, and I'm coming in to the power part.
I bought this Bllutech 5000mAh battery: https://bllutech.com/collections/frontp ... po-battery
and this tinkerboy powerswitch: https://www.tinkerboy.xyz/setup-and-wir ... werswitch/
I now ask for battery monitoring help. I wanted a retroPSU but helder told me that he doesnt ship to France anymore...
So my problem is that i saw many solution to monitor the battery level ! And i'm scared about finishing it without, at least, the system shutting down safely the gameboy with alert message if the battery power is too low.
I assume there is 2 important things here, the auto shutdown system and the battery icon on the top of the screen.
I think it's not possible with only the tinkerboy switch (it's not written in the doc..), so what are the options knowing that the best for me is obviously an icon appearing on the screen (the Helder'way https://heldergametech.com/shop/gameboy-zero/retropsu/) and the auto shutdown displaying an alert message.
I found that we can achieve it with a Leonardo Micro (here viewtopic.php?f=44&t=3537&start=20 and here viewtopic.php?f=44&t=7830&p=73108&hilit ... ing#p73108)
but i plugged my controlls with GPIO so is this board overkill if i just use it for battery monitoring ?
I read another example with an ADS1x15 (here: https://github.com/sixteenbit/Mintybatt ... Monitor.py)
I just dont know what to choose for my build and how to do it (what to plug where ?)
If someone can help, i would apreciate
And sorry for my english if i'm not clear, just tell me ! You know, french people...
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Battery monitoring help
first off - you do not need helder's PSU if you already have Tinkerboy's PSU/switch. you would want one or the other, not both. Tinkerboy's includes a "safe shutdown" (a way to trigger software shutdown before cutting the power), Helder's doesn't. But, you are correct, Tinkerboy's switch does not have the battery monitor built into it (Helder's does).
Or, in other words...
Tinkerboy's => power + recharge + safe shutdown
Helder's RetroPSU => power + recharge + battery monitor + analog controls
Tinkerboy integrated his battery monitor into his v3 board, with his pro micro controller: https://www.tinkerboy.xyz/battery-monit ... roller-v3/
So, if you didn't use that board, you can still get an ADS-1015, and use the Minty script you link to, to do the battery monitoring, in the same way the RetroPSU does. you hook it up by wiring the A0 to the battery positive, the ground to the battery ground, SDA to GPIO 2, SCL to GPIO 3, and the VIN to 5v somewhere.
Typically, I think you'd also want to include an in-line 10k resistor at the battery positive, but tinkerboy's switch might already have that built-in (you should ask)
Or, in other words...
Tinkerboy's => power + recharge + safe shutdown
Helder's RetroPSU => power + recharge + battery monitor + analog controls
Tinkerboy integrated his battery monitor into his v3 board, with his pro micro controller: https://www.tinkerboy.xyz/battery-monit ... roller-v3/
So, if you didn't use that board, you can still get an ADS-1015, and use the Minty script you link to, to do the battery monitoring, in the same way the RetroPSU does. you hook it up by wiring the A0 to the battery positive, the ground to the battery ground, SDA to GPIO 2, SCL to GPIO 3, and the VIN to 5v somewhere.
Typically, I think you'd also want to include an in-line 10k resistor at the battery positive, but tinkerboy's switch might already have that built-in (you should ask)
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Re: Battery monitoring help
First of all, thanks a lot for your answer, it is really clear and it makes me more confident to do as you said.
When you talk about Vin you mean the VDD port on the ads1015, right ?
Last, in terms of schematic, i'm not sure of the order of these boards, do I have to put the tinkerboy board first and then the ADS, or the two in parallel ?
What do you think about this schematic ?
Thanks again for your time !!
When you talk about Vin you mean the VDD port on the ads1015, right ?
Last, in terms of schematic, i'm not sure of the order of these boards, do I have to put the tinkerboy board first and then the ADS, or the two in parallel ?
What do you think about this schematic ?
SpoilerShow
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Battery monitoring help
Yes, on VIN / VDD -- that is your positive voltage input.matt2mi wrote: ↑Wed Sep 25, 2019 1:20 amFirst of all, thanks a lot for your answer, it is really clear and it makes me more confident to do as you said.
When you talk about Vin you mean the VDD port on the ads1015, right ?
Last, in terms of schematic, i'm not sure of the order of these boards, do I have to put the tinkerboy board first and then the ADS, or the two in parallel ?
What do you think about this schematic ?Thanks again for your time !!SpoilerShow
And yes - The battery voltage in parallel, like in your schematic.
The SDA and SCL should go to the BCM 2 and 3 pins, see here: https://pinout.xyz/ (they are labelled on there with SCA and SCL too - the pins just under the 3v3 pin at the top of the picture)
The "S" and "P" pins on the switch are for "Shutdown" and "Power-Off". Those go to GPIO pins that will need to be configured using Tinkerboy's guide to 1) Trigger the software Shutdown and then 2) Keep the power active until that is complete, then Power-Off at the end. Those can go to just about any unused GPIO pin (that isn't a Ground or 3v3 or 5v)... with one caveat - The "P" / Power-Off one should be configured with a GPIO greater than 8. The GPIO pins 0-7 start High, and the rest start Low, so if you pick one that is in the 0-7 range, it might not work when it gets to the point of turning the power off. In his guide, it looks like Tinkerboy uses 10 and 11 for those, which is fine. If you use others, you just need to adjust the pins in the /boot/config.txt file for those dtoverlays.
The others look OK, I think, but you will need to bring the 5v over to the Pi from the switch.
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
Re: Battery monitoring help
Thanks again for these precisions about the High and Low GPIO pins, i didn't know that point !
Thanks again, that cristal clear, let's go !!
Yes, you're right, i forget that point on my schematic !The others look OK, I think, but you will need to bring the 5v over to the Pi from the switch.
Thanks again, that cristal clear, let's go !!
- infinitLoop
- Posts: 536
- Joined: Mon Dec 24, 2018 11:46 am
- Location: Portland, OR
- Has thanked: 222 times
- Been thanked: 199 times
- Contact:
Re: Battery monitoring help
Good luck! (bon chance! - that’s almost all the French I remember from school) and make sure to show us how it turns out!
Some of my builds...
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
BMO GBZ
Star Wars Millenium Falcon Challenge
Game Boy Color Zero
... and another Gameboy Color Zero with custom 3D-printed parts
"Ultimate" 3A+ Build
GlowBoy Zero
Some 3d designs I've done...
Soft Tactile Shoulder Buttons, for screw-hole, well mounting
Snap-in, Soft Tactile Shoulder Button insert, for screw-hole, well mounting
Pac-Man and Space Invaders Themed Rear Fan Holder
- tinkerBOY
- Posts: 710
- Joined: Tue May 30, 2017 4:00 am
- Has thanked: 294 times
- Been thanked: 206 times
Re: Battery monitoring help
The PowerSwitch does not include any battery monitoring circuitry because I already have that on the v3. I might include it in future version.infinitLoop wrote: ↑Tue Sep 24, 2019 11:48 amfirst off - you do not need helder's PSU if you already have Tinkerboy's PSU/switch. you would want one or the other, not both. Tinkerboy's includes a "safe shutdown" (a way to trigger software shutdown before cutting the power), Helder's doesn't. But, you are correct, Tinkerboy's switch does not have the battery monitor built into it (Helder's does).
Or, in other words...
Tinkerboy's => power + recharge + safe shutdown
Helder's RetroPSU => power + recharge + battery monitor + analog controls
Tinkerboy integrated his battery monitor into his v3 board, with his pro micro controller: https://www.tinkerboy.xyz/battery-monit ... roller-v3/
So, if you didn't use that board, you can still get an ADS-1015, and use the Minty script you link to, to do the battery monitoring, in the same way the RetroPSU does. you hook it up by wiring the A0 to the battery positive, the ground to the battery ground, SDA to GPIO 2, SCL to GPIO 3, and the VIN to 5v somewhere.
Typically, I think you'd also want to include an in-line 10k resistor at the battery positive, but tinkerboy's switch might already have that built-in (you should ask)
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter
Re: Battery monitoring help
Merci !! (thank you ) And yes i took pictures during the development to create a post when i finish it.Good luck! (bon chance! - that’s almost all the French I remember from school) and make sure to show us how it turns out!
Yes, i know, sadly tinkerBOY, I had already bought some PCB and stuff before I found your website with all your nice components, that's why I'm in this situation...The PowerSwitch does not include any battery monitoring circuitry because I already have that on the v3. I might include it in future version.
So you agree with infinitLoop to include an in-line 10k resistor at the battery positive ??
- tinkerBOY
- Posts: 710
- Joined: Tue May 30, 2017 4:00 am
- Has thanked: 294 times
- Been thanked: 206 times
Re: Battery monitoring help
Yes for the 10k resistor but im not sure if it's needed with the ADS.matt2mi wrote: ↑Fri Sep 27, 2019 12:31 amMerci !! (thank you ) And yes i took pictures during the development to create a post when i finish it.Good luck! (bon chance! - that’s almost all the French I remember from school) and make sure to show us how it turns out!
Yes, i know, sadly tinkerBOY, I had already bought some PCB and stuff before I found your website with all your nice components, that's why I'm in this situation...The PowerSwitch does not include any battery monitoring circuitry because I already have that on the v3. I might include it in future version.
So you agree with infinitLoop to include an in-line 10k resistor at the battery positive ??
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter
Who is online
Users browsing this forum: No registered users and 1 guest