Possible to check by a firmware/software whether Electron is powered only by battery?

I would like to implement in my software a capability to check whether the system is powered through the USB (or Vin pin) or by the attached battery alone. Is there a firmware function that can interrogate this? Or would I need to implement this by sensing it trough an input pin?

Have you given the forum search a try first?

Try electron battery powered :wink:

Hi ScruffR, sorry, I did indeed, but apparently I did not chose my keywords wisely. Anyway, will have a look at around with those that you proposed, I think I can find some answers there.
Thx for the usual quick reply, always appreciated.

I’m particularly fond of this answer. As it turns out, it’s harder than you’d think to figure this out, for reasons explained in this thread:

OK, in this case, you’ll find this interesting

Same time posted :wink:

1 Like

@rickkas7 and @ScruffR : thanks to you both!

1 Like