Go Down

Topic: Arduino as USB stick? (Read 7010 times) previous topic - next topic



Does anyone know if an Arduino board can act as a USB memory stick? Suppose you connect a SD card to the board, is it possible to use it so you can see/delete/add files on the connected SD card when plugged in the computer? If this is not possible, will it be with the upcoming Leonardo as it has usb host functionality?
I've searched Google but did not find an answer.

Thank you
Check out my Arduino projects website: http://www.arduinopassion.com


usb host functionality

Is not what you need. As USB host, you can rather access other USB devices ( like USB sticks  or other Arduinos ).

First, you'd need to write / get a different Arduino driver for your PC. The existing one makes it behave like a serial COM port, not an external disk.
Then, you'd have to reprogram the Atmega16U2 as well, I fear, and have dedicated code on your Atmega 328 to address an SD card shield .
With that, you can't use the Arduino as an Arduino any more.

So the answer is No, IMO.

It were a rather expensive SD card reader.
And the advantage of SD cards is that you can easily get them in and out and move them around.


You can make an Arduino emulate a user input device, but I don't know whether it can emulate a storage device. Would it not be simpler to use a standard USB/SD card reader? They are far cheaper than an Arduino.
I only provide help via the forum - please do not contact me for private consultancy.


I found it  :)

Atmel and Arduino will be demonstrating several platforms in the Atmel-sponsored Arduino Pavilion including:
Arduino Leonardo. Based on the Atmel ATmega32u4, it is a low-cost Arduino board which includes a simpler circuit as the Arduino UNO board. The software on the board includes a USB driver that can simulate a mouse, keyboard and serial port. In addition, the bootloader includes a serial port and USB mass storage driver.

from http://www.atmel.com/about/news/release.aspx?reference=tcm:26-35030
The upcoming Leonardo will support it.

Thank you for the responses.
Check out my Arduino projects website: http://www.arduinopassion.com


If you have an R3 UNO with the atmega16u2 providing the USB interface then you should be able to use the LUFA library to implement a USB mass storage driver, turning your UNO into a USB storage device.

Udo Klein

Yeah, in theory this is easy. In my experience though USB programming is tricky at least. Most probably way out of the reach of the average Arduino tinkerer. The most severe issue is that USB debugging is a non trivial issue. It also is necessary to have quite a reasonable grasp of how USB actually works.

IMHO it would be much simpler to connect the SD card in such a way that it will be directly connected to the computer and that Arduino can claim the connection when the contraption is not connected to the computer. However this is not trivial either because in order to manipulate files on the card from within the Arduino you need at least something like a filesystem driver which is not trivial either.
Check out my experiments http://blog.blinkenlight.net

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131