Pretending SD card by arduino/fake SD card or sharing one SD cards by 2 devices

Hey,

First of all I want to say Hi! I read a lot this forum but I've never posted topic/post before!

I'm looking for a hint to get started with my project.

I have one device which is reading data from SD card. I can't change this reading device, I can't install anything there, I can't update software. It's blackbox device which is only reading data from SD card. I'm unable to control it remotelly in any way - I can "control" this device only by saving new data on this SD card. I need to do it manually - so if I want to change some data on 10 devices, I need to take out 10 sd card, send new data, and put it back to devices.

1) I wonder if I can pretend SD card using arduino . Instead of reading data from SD card, this device would read data directly from arduino. Arduino I can control easly.

2) Second solution is to share one SD card by two devices. Arduino will be sending data to SD card and the other device will be reading data.

But I want to change data in each 10-15 seconds so It can be problematic for sharing one SD card.

Do you have any ideas how to solve this problem? Is it even possible?

Hi and welcome,

I guess it will be hard to do.

The arduino itself has very little room to store data, about 256KB max. Next thing, arduino runs with a speed of 16MHz and although capable of working with SD cards, it will take ages to copy 1 SD. Whatever type of SD-cards you'll be using the speed of data transfer will probably lower then 150KB/s. By both reading and writing the effective speed will be 75KB/s most, requiring you to wait about 4 hours before a 1GB-copy is made.

I would think one could access an SD-card with 2 or more different devices. If you would use analog de-/multiplexers like the cd4051 or 4067 you can simply choose which system gets access. In that case all systems need to communicate with each other though, to be sure the SD card is available when a system starts reading/writing.

If it's simply your goal to copy a load of SD-cards, buying a number of USBhubs, cardreaders and writing a script/batchfile for your PC may be a lot easier.

You probably can achieve higher speeds using the Arduino Due by the way, which runs much faster. With the storage capacity of 512KB it's still to small to fake an sd. To be able to read/write really fast, it should also address the SD-card in 4-bit mode, something the standard SD-library isn't capable of.

I don't know whether someone already successfully experimented with 4-bit mode and the Due, since it hasn't been on the market very long yet.

It sounds as if it might be possible to have an Arduino emulate an SD card, but I don't know how difficult it would be. As far as I can tell, the SD interface can use either SD (parallel) signaling or SPI signaling. Which is used will depend on your SD host. Both protocols are simple enough to be implemented on an Arduino, but you would need to implement the whole command structure used to access the file system and that would be a substantial bit of work. You may be able to exploit the SD/FAT libraries for part of this.

The main issue I would anticipate is performance. Since the interface is clocked, the Arduino would need to be able to keep up with the host. I don't know how easy it would be to achieve that in software on a microcontroller. Even if the Arduino is capable of keeping up with the data rate in bursts (e.g. providing data already held in RAM) you would be very limited in the amount of data that could be held in RAM - if you need more than that then you would also need to be able to retrieve the data from wherever it is stored at the same time as servicing the SD/SPI interface. How hard that is would depend on the quantity of data you need, but it could be very difficult.