Any way to determine if my battery is being charged?

I am using a Particle Photon with a mini OLED shield and a battery shield. I’m successfully displaying the voltage and state of charge on my OLED, but I’d like to indicate if the battery is being charged. I am planning on attaching a solar panel to the photon as the charge source, and I thought it would be cool to draw a little battery on the OLED if the battery is getting juice.

ideas?

You can use the official Power Shield library, which lets you get the state of charge and voltage of the battery. You could use this info to determine if the battery is charging.

Library on build.particle.io

Library on GitHub

Thanks for the quick response.

Are you suggesting just reading voltage and soc for an upward change, and assume it’s being charged? I thought of this as well but was hoping there was a better solution.

When I plug the photons micro-b usb to my laptop, a red LED on the battery shield lights to indicate a charge source has been connected. I was really looking forward to somehow tap into whatever logic is determining this.

I just read the PowerShield library documentation, and there doesn’t appear to be a method for simply checking if the battery is charging (red charging light on).