Arduino Forum
>
Products
>
MKR Boards
>
MKRWAN1300
(Moderators:
AndreaRichetta
,
facchinm
)
>
How to detect if board is running on USB or Battery?
Print
Go Down
Pages:
[1]
Topic: How to detect if board is running on USB or Battery?
(Read 573 times)
previous topic
-
next topic
thisismexx
Newbie
Posts: 4
Karma: 0
[add]
How to detect if board is running on USB or Battery?
Apr 22, 2019, 08:28 pm
Hi,
Is it possible to detect by code in the sketch if the board is actually powered by USB or Battery?
I'd like to let my board running powered via USB but with batteries attached as a back-up and trigger a message in the moment the USB power supply fails and the board switches to battery power.
Thanks in advance!
MITEL
Jr. Member
Posts: 55
Karma: 4
[add]
Re: How to detect if board is running on USB or Battery?
#1
Apr 30, 2019, 10:40 am
I am not sure it is possible as is. However, I would monitor battery voltage (you can find a post on this) and when lower than a threshold, send a message. If threshold is sufficiently high, likely not too much time is passed from USB failure.
Print
Go Up
Pages:
[1]
Loading...