Interface with USB Micro SD Card Reader

Hi, all!

I'm trying to create a very small temperature datalogger with an ATTiny, and it seems that most SD Card reader modules have a pretty big footprint. I have a small, exposed, half-usb thing like this that takes a microsd card in the back. It's super tiny and works very well. I found a blog where a guy rigged up a regular-sized SD card reader into pinouts and interfaced with it. I was wondering if I could do the same with one of these and if there are any special rules I might have to follow (Obviously, USB out is different from SD).

Thanks! - Runningman

Restate your question.

Are you asking about the pinout differences between a MicroSD and SDcard?

Are you asking if you can solder to a MicroSD card to SDcard adapter?

Are you asking if you can connect a USB to MicroSD adapter to a ATtiny?

Are you asking if a ATTiny can emulate a USB Host so that you can use a USB to MicroSD Adapter?

Are you asking if you can wire a MicroSD to an ATtiny?

Chuck.

How small do you want to go? This is pretty close to the limit for a breakout board:

|500x500 https://www.sparkfun.com/products/544

You could buy the raw card holder and try to solder wires to the pins but it probably isn't worth the trouble.

I'm asking essentially if there might be a way I can wire up the connector and use SPI to interface with the ATTINY

Yes, you can. Just about all the ATtiny chips have built in SPI. As long as Vcc is 2.7-3.6V you can wire the ATtiny directly to the card slot.

Did you ever figure out how to use PetitFat?

Did you ever figure out how to use PetitFat?

You can't create or extend files. You can rewrite existing files.

It is a bit tricky since you must stream entire 512 byte blocks when you rewrite the file.

Is there a better way, other than the PetitFat approach, to use an SD card with an ATtiny? Would it make more sense to write the data in some non-FAT format?

For that matter, with a coin sized temperature logger you’re presumably going to be using a very small battery. How much data can you write to an SD card per mAh of battery capacity?

Is there a better way, other than the PetitFat approach, to use an SD card with an ATtiny? Would it make more sense to write the data in some non-FAT format?

Using a raw format would be better but SD cards are a poor match for ATtiny. You must write an entire 512 byte block with an SD so you can't read a block, update it, and write it back.

I would use something like a Pro Mini. Edward Mallon developed a very small Cave Logger that can log data for about a year using three AA batteries.

Here is a link to a forum post that has measurements and tips to extend the battery life to one year for three AA batteries.

The system mostly sleeps. Here is my measurement of current during sleep:

The total current into the 3.3 V regulator for the Pro Mini, SD card and DS3231 was about 68 micro-amps during the 10 second sleep periods.

I wonder if an FRAM and a simple means for streaming the data for download would make sense. You don't really need gigabytes for slow temperature logging. In between measurements you could power down the FRAM and an RTC and put the processor into it's lowest setting with just a watchdog timer running. The whole thing would probably draw less than 10uA while sleeping. A coin cell battery would then be enough to power it for a long time.

I wonder if an FRAM and a simple means for streaming the data for download would make sense.

FRAM would work fine. I used these 2 Mbit chips in this project.

The chips are very easy to use and a driver can be very small. The chips sleeps at 10 µA so you don't need to power them down.

262,144 bytes could be a lot of temperature measurements.

I don't know about streaming the data from the ATtiny. I would just use a DIP8 FRAM in a socket or a SOIC8 on a DIP adapter. You could then use an Arduino to write the data to an SD.

I bought a bunch of DIP parts but they are hard to find now.

So, if I wanted to pull simple sensor data and write it onto an SD card using ATTiny and petit-Fat I would need to have an already-created file on the SD card and then rewrite the file for every reading? I guess that's not quite viable, considering the fact that I would not to store more than one reading.