Go Down

Topic: Detect if MKR 1000 is charging (Read 982 times) previous topic - next topic

testpresta2

Hello,

When i connect both USB and battery, i can see an orange led lighting. What i want to do is to detect in my program if the battery is charging. Why: Because i do not want the program running when charging battery.

Is there a way to monitor battery life level ?

Thanks

ballscrewbob

Not properly.
However a simple divider resistor of the correct value will allow you to check the voltage same way you would read any analog voltage with an Arduino.

You cannot ( AFAIK) fully stop the sketch but you can put the board to sleep.
Then you just have to wake it up occasionally to check the battery level to decide if you need more sleep.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

testpresta2

I can see on MKR1000 shematics that this orange led is connected to PA21_TCC0-W7. But i do not know how i can read PA21 from an arduino sketch ...

ballscrewbob

You cant.

You would have to attach  something to the positive connector on the back of the LIPO connector to read anything.
And a divider network resistor would have to be selected for the max of 4.7 volts (max lipo charge)

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Go Up