How to prevent destroying sd card by low voltage.

Hi guys!
Few days ago I started to use sd card in my arduino UNO. I wanted build temperature logger to collect many values every one minute. How to use ds card I found out in Jeremy Blum lessons. I think you may know this guy. :slight_smile: So, I assembled this device it worked perfectly, recording necessary data. When I tested this device, I used USB power supply. After that I moved the device to an object to measure. At this time I must used battery power supply attached to my device. It was 6 batteries of AA type. I turn on the device and it takes reading of temperature about 24 hours. On another day I wanted continue this measurement, but after 24 hours I saw that with previous measurement added only couple of values. I thought happens some trouble which led to this result. I cleared all data from sd card and started the process again. After 24 hours I tried to look what I got, but that card doesn't open. I use another sd card and result was the same. I took multimeter to measure battery voltage and saw that every battery was discharged. The voltage of every battery was 1 volt instead 1,5. And at this point I thought that reason for which the card was destroyed is low voltage. May be anyone had the same situation?

At the risk of stating the obvious, isn't the question "how do I avoid low voltage?" ?

To which the answer is, "use an appropriate power supply"

I thought arduino have built-in protection.

You can't destroy an SD with low voltage. Files may be corrupted if power fails and files are not closed or writing file structures is interrupted.

You may need to reformat the card or run a filesystem repair utility on a PC if the File Allocation Table is corrupted.

SD cards accept the voltage range 2.7 V to 3.6 V for reading and writing flash memory. The SD card will not be damaged by lower voltage. The SD flash controller functions at voltages as low as 2.0 V but won't access flash data.

Hmmm... I would not ask, If I do not have two defective sd-card after that. One card 1Gb, second 8Gb. Both card did not wanted formatting. I found on this forum as one man suggested to use test-disk 7.0 and it was good idea, thanks him for that. The card of 1Gb was repaired and formating, but second card did not wanted become to live.
After that I begin to think how I could prebent it. I have not much experiance with arduino but I wanna ask it from the proffessionals. Firstly, I think to use maybe interrupts to check every time supply voltage and if voltage is not good- turn it off. But I see another problem. What if the card will be under using and ta this time the voltage comes to low. At this time trigget interrupts and disconnect sd-card, but half of data in this case will be corrupted.
Fat16lib, if you see another way, why card was damaged, I will happy to hear it.

Only high voltage can damage an SD. The Card's controller prevents low voltage from damaging the card.

What brand/model SD cards are you using? What SD shield/module are you using? Are you using level shifters to avoid 5V SPI signals on the cards input pins?

A card can be formatted so it is not accessible by Arduino SD libraries.

Try formatting the card with SD formatter. This is the only PC/Mac program certified to produce the standard format for SD cards.

If you use Linux, try the SdFat SdFormatter example.

I using SD cards on 1 and 8 Gb of SanDisk. And Catalex modul, you can see it below.

I tryed to use this formatter, but it said that this card not supported.

I tryed to use this formatter, but it said that this card not supported.

All genuine SanDisk card are supported by the SD Association Formatter. SanDisk is a key member of the Association and sets/follows all Association standards.

You may have a fake SanDisk card. There are more counterfeit SanDisk cards than any other brand.

Even Amazon has had counterfeit SanDisk cards from their suppliers.

Edit: See this.

Thanks for article, it helped understand that both card that I have is fake :slight_smile: But I don't care about it, because very difficult to buy original.
Maybe I'm not correctly explained my problem. The purpose of my questions is how to prevent, not how to repair not. One of card was destroyed and I don't mind how to repai it. Lets forget it.
I wanted to know how in Arduino devices organised safety of SD Card? I have idea to check voltage before moment when the card will used, for writing or reading. If voltage will lower that 3.3 volt- the code must forbid using the card. But I wonder what will be if in that moment when card will be under using, the voltage comes lower 3.3 volt. The code or maybe some hardware will forbid using this card. In this case we could get corrupted data, or maybe corrupted card.
What do you think?

But I don't care about it, because very difficult to buy original.

It is likely your cards will never work correctly if they are Fake. Fake cards often only have a small amount of flash. They either work for a small amount of data or remap the flash several times so data is overwritten.

The SD Formatter probably detected that your card is defective and won't format it.

I have idea to check voltage before moment when the card will used, for writing or reading. If voltage will lower that 3.3 volt- the code must forbid using the card. But I wonder what will be if in that moment when card will be under using, the voltage comes lower 3.3 volt.

You can't protect the card with software. Cards write flash on their own schedule. Data is cached in buffers in RAM in the card. Flash is written later.

SD cards are designed to be used in situations where power fails and have builtin hardware protection.

Your ideas about low voltage and protecting the card with software are wrong and won't work.

Ok, I understand you. But what is the reason that the card has been corrupted. For me this is enigma.

Would it not be far easier to simply solve the battery voltage problem by using better batteries, ie bigger ones, and arranging some kind of charging system, like a small Solar panel.

Ok, I understand you. But what is the reason that the card has been corrupted. For me this is enigma.

Give it up, it's most likely a low quality fake card.

Modern SD cards made by major companies are extremely reliable and rarely fail. Fake cards are another matter.

The SD controller in a card has a 32-bit CPU that is far more powerful than an AVR. The controller uses an ADC to monitor voltages. It won't self destruct.

If you want extreme reliability, do what pros do, spend money and buy an industrial grade card.

Panasonic Industrial SD

These cards are really power fail safe.

Protects saved data and device

Unique Panasonic algorithms minimise data damage in the event of a power interruption. Even in the event that an error is generated, the controller recovers the data, restoring it to the condition prior to the error, and prevents errors from reaching the entire SD memory area.

If you want a reliable battery powered data logger take time to truly read and understand articles on this website.

Cave Logger

Thanks guys for this explanation. It looks like the SD-card corrupted itself. The reason why I not believed in it, is that this card worked perfectly few years in my phone. Industrial cards is a good idea to use it, but they costs a little expensive for me. As I'm not professional in arduino, I worry that I could corrupt them during the experiments.