Micro SD breakout board

Hi,
I'm trying to use this Adafruit micro sd breakout board (MicroSD card breakout board+ : ID 254 : $7.50 : Adafruit Industries, Unique & fun DIY electronics and kits) with my project and it "frequently" stops working. So occasionally it works which makes it harder to find the problem.

I have an arduino zero and some sensors, read the data at around 100hz and flush the data into the sd card every 1 second. I tried other parameters but same issue. I was wondering if anybody else has a similar issue and could help me fix it. Thx

1.) have tried to change out the SD card itself? Some are glitchy and faster than others..

2.) Have you tried to slow down the 'dump/flush' time from 1 second to say 3-5 seconds? just to see if it stabilizes then?

If it does.. then its too fast for the card to be 'available' again..

I'm writing to and SD card, a different one, every second, and have 100% reliability, post your code?

I'm opening/writing/closing the file every write (every 1 second).

it simply includes an opening to write command in setup() and writing in the main function. I don't close the file but rather use .flush which is faster but i don't think it should cause any issue.

Flush may be quicker but it doesn't update the FAT.

Not just a simple breakout board, this microSD adapter goes the extra mile - designed for ease of use. Onboard 5v->3v regulator provides 150mA for...

I hope that you don't power it from the Arduino or if you do that you don't power much else from the Arduino board.

I run SD adapters from Unos rarely (but without trouble once the card is seated well) but that's all I run on the Uno.

Actually i do power it from arduino. I've got a zero, sd card, a few sensors, and a multiplexer. Actually didn't think it would be a problem because sensors normally don't take that much current ... what do you think? i need to package it and the overal size matters.. i'm thinking about using a 9v battery to power the board..

You are in the finding-out phase and this is only a maybe but checking unknowns out is at the heart of all troubleshooting .

For example, I didn't know about the Zero and 3.3V only.

DC Current per I/O Pin 7 mA .... yikes! Careful what you think to drive with that!

3v level shifting means you can use this with ease on either 3v or 5v systems

Without me knowing much else I can recommend trying powering the SD board with two AA or AAA batteries in series. Connect to 3V pin and ground, also connect SD GND to Arduino GND (very important). You only need to do this (or connect a different power source) long enough to see if it fixes the problem. If it doesn't then keep looking.

Also wait a bit and see how my amateur hardware ideas fly with the pros here!

One thing as well. Standard regulators waste all power that goes with the 'extra' volts they trim. A 9V battery regulated down to 3V is waste 2 mA for every 1 mA used. Look for DC-DC Buck Converter (under $3 in some places to convert up to 3A output, and very small) to get > 90% efficient use of your battery, it converts the 'extra' volts to more current instead of directly into heat. The 9V battery will last over twice as long.

Amir_UW:
Actually i do power it from arduino. I've got a zero, sd card, a few sensors, and a multiplexer.

Actually didn't think it would be a problem because sensors normally don't take that much current ... what do you think?

i need to package it and the overal size matters.. i'm thinking about using a 9v battery to power the board..

  1. 5volt or 3.3volt.
    You should power the SD card from 5volt, since this card has it's own onboard 3.3volt regulator.
    I already told you to dump the muxer.

  2. AFAIK an SD card can use peak currents over 150mA.

  3. No way a 9volt smoke alarm battery can keep up with that setup.

GoForSmoke:
Look for DC-DC Buck Converter (under $3 in some places to convert up to 3A output, and very small) to get > 90% efficient use of your battery, ...

Not in this case.
The Zero already has an onboard 5volt DC/DC buck converter.

As always, post a diagram and code (for the whole project).
You will get the wrong advice if you post things all over the place.
Leo..

Wawa:

  1. 5volt or 3.3volt.
    You should power the SD card from 5volt, since this card has it's own onboard 3.3volt regulator.
    I already told you to dump the muxer.

  2. AFAIK an SD card can use peak currents over 150mA.

  3. No way a 9volt smoke alarm battery can keep up with that setup.

Not in this case.
The Zero already has an onboard 5volt DC/DC buck converter.

As always, post a diagram and code (for the whole project).
You will get the wrong advice if you post things all over the place.
Leo..

The SD board is for either 5V or 3V (read the linked page I quoted from) operation. 5V is not required. Guess which one in going through the regulator wastes 1/3 of the current it eats?

It'd be nice if the Arduino site Products docs went into more detail instead of just saying "regulator".
The thing is that the converter/'switching regulator' on the Zero may not be enough.

GoForSmoke:
The SD board is for either 5V or 3V (read the linked page I quoted from) operation. 5V is not required. Guess which one in going through the regulator wastes 1/3 of the current it eats?

It'd be nice if the Arduino site Products docs went into more detail instead of just saying "regulator".
The thing is that the converter/'switching regulator' on the Zero may not be enough.

  1. Your choice if you want to use the 5volt to 3.3volt lineair regulator of the Zero or of the SD card.
    In this case I would pick the one on the SD card.
    If you would supply the SD card from 3.3volt, then the one on the SD card would be sitting there doing nothing, and the one on the Zero would have to work harder.

  2. There are schematic diagrams in pdf format for every type of Arduino on this site. And Eagle board files.
    If you have trouble understanding them, then it is indeed hard. No proper info is given in the text.

The Zero is slightly more complicated than others. There is a 5volt switching buck converter between DC jack and 5volt pin. But the MCU runs on 3.3volt from a lineair 3.3volt 1117 regulator.
Leo..

Wawa:

  1. Your choice if you want to use the 5volt to 3.3volt lineair regulator of the Zero or of the SD card.
    In this case I would pick the one on the SD card.
    If you would supply the SD card from 3.3volt, then the one on the SD card would be sitting there doing nothing, and the one on the Zero would have to work harder.

  2. There are schematic diagrams in pdf format for every type of Arduino on this site. And Eagle board files.
    If you have trouble understanding them, then it is indeed hard. No proper info is given in the text.

The Zero is slightly more complicated than others. There is a 5volt switching buck converter between DC jack and 5volt pin. But the MCU runs on 3.3volt from a lineair 3.3volt 1117 regulator.
Leo..

If I would power the SD with batteries, I would not connect 5V or 3V from the Zero, just ground.

I'm running XP, the new PDFs lock my browser up or I would have looked but from search I was able to confirm the fact of the switching regulator in the Zero, Arduino is pretty proud about it.

When the thing to check is if the SD may be cutting out due to insufficient power while running from the Zero 5V pin, how is running from the Zero 5V pin going to test that? Or did you miss those posts?

GoForSmoke:
I'm running XP, the new PDFs lock my browser up

When the thing to check is if the SD may be cutting out due to insufficient power while running from the Zero 5V pin, how is running from the Zero 5V pin going to test that? Or did you miss those posts?

Try Sumatra pdf viewer.

Yes, I did read these posts, and the other threads from OP.
This project also has an accelerometer/gyro/compass/temp/humidity/mux and maybe more attached.
No idea how the Zero itself is powered, but a 9volt battery was mentioned.
Leo..

As is, running on USB, I give power a 'maybe' as the SD problem. I would test it along with the other suspects by giving the SD external power.

I don't have experience powering projects with 9V battery to say what I can get but maybe this is real:
9V-Alkaline-tests

Here are the discharge curves at 100 mA. I have thrown in a Panasonic Super Heavy Duty carbon-zinc battery, it obviously was never meant to be discharged at 100 mA.
The two Duracell batteries are now almost identical,

In 5 hours all but the Panasonic Super are down to 8V at 100mA draw.
Converted to 5V that might be 140mA at start down to 120mA in 5 hours, my guess.

I'll be checking out Sumatra now, tks for the tip.

I don't have any problem with powering my project using USB.
The fact that SD runs some times and stops in other times tells me it probably is not power.
The project is connected to USB, it works a couple times and it stops working on a, e.g, third upload (say I modify the code a little bit and upload it again)... then it works suddenly...

Now I'm thinking of using SDfat instead of SD library and see how it goes. One thing is that to make it quicker i say myfile.flush() rather than close() which somebody said could cause some issues.

At the end, in practice, after packaging the system every time I turn it on it would be for a couple hours. I can have a lithium ion battery or lithium polymer however I'm not sure if it's worth it to buy and set-up those batteries.

There's a thing called troubleshooting where you reduce unknowns as opposed to guess them away.

If there could be two answers, one involving a lot of time and work and the other less likely but has a quick and easy check, you eliminate which one first?

How many mA can you draw from VIN before the voltage begins to drop?
SD does not pull the same current all the time it runs.
Many projects experience poor edgy power management, a major symptom is hardware acting flaky.

Do what you want, I'll just watch.

resolved...