# Pidig v2 with pi5 sd card corruption

**URL:** <https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599>\
**Category:** General\
**Created:** [April 29, 2026, 4:51pm UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599 "2026-04-29T16:51:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puneeth](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@Puneeth](https://forum.sunfounder.com/u/Puneeth)\
**Post date:** [April 29, 2026, 4:51pm UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/1 "2026-04-29T16:51:06Z")

</div>

Hi,

Whenever my pidog is low on battery and shuts down my sdcard gets corrupted. I have flash the os and install all pidog modules again to get it working.

How do I fix this issue?

Is there a way I can monitor the pidog battery and get an alert at say 10% battery level?

The same sd card os corruption is seen when I power of pi using the switch on hat. If I do a sudo shutdown and then turn it off everything works fine..

Is this expected?

Regards,

Puneeth

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [April 30, 2026, 11:49am UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/2 "2026-04-30T11:49:12Z")

</div>

Directly cutting off power (including battery depletion) does have a chance of corrupting the system on the SD card, but it shouldn’t happen every time.

Battery Management Suggestions

Avoid using the device until the battery is completely drained.

It is recommended to charge the battery when the power level gets low. You can check the power indicator LEDs on the Robot HAT: when both LEDs are off, it means the battery level is insufficient and needs to be charged.

---

<div class="post-metadata">

**Author:** ![Puneeth](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@Puneeth](https://forum.sunfounder.com/u/Puneeth)\
**Post date:** [April 30, 2026, 1:06pm UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/3 "2026-04-30T13:06:56Z")

</div>

Thanks for the reply.

Where is the power indicator on hat? Is there a way I can make pidog say that battery is 10% or battery is low please charge or something like that?

---

<div class="post-metadata">

**Author:** ![Puneeth](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@Puneeth](https://forum.sunfounder.com/u/Puneeth)\
**Post date:** [April 30, 2026, 1:13pm UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/4 "2026-04-30T13:13:04Z")

</div>

Found it!!

 ![17775546890192585442109070864100](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/6/68b4aaf47df649262fe35f753c95fb9517588431.jpeg)

But can I write a program to make pidog announce that the battery is low? Any sample codes for the same would be really helpful.

Or is there any way to safe shutdown when battery is low ?

Thanks

---

<div class="post-metadata">

**Author:** ![Puneeth](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@Puneeth](https://forum.sunfounder.com/u/Puneeth)\
**Post date:** [April 30, 2026, 1:16pm UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/5 "2026-04-30T13:16:01Z")

</div>

But this issue happens every single time. It’s a brand new sd card and pi5 8gb..

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [May 7, 2026, 9:38am UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/6 "2026-05-07T09:38:54Z")

</div>

You can implement that function yourself. In the robot\_hat library, there is a method get\_battery\_voltage() inside utils.py that reads the battery voltage.

You can find the code here:

> <https://github.com/sunfounder/robot-hat/blob/v2.0/robot_hat/utils.py#L158>

---

<div class="post-metadata">

**Author:** ![Puneeth](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@Puneeth](https://forum.sunfounder.com/u/Puneeth)\
**Post date:** [May 8, 2026, 12:40am UTC](https://forum.sunfounder.com/t/pidig-v2-with-pi5-sd-card-corruption/4599/7 "2026-05-08T00:40:27Z")

</div>

Let me give it a try.. Thank you so much!
