2

I am working on a project where I need to log data, but I was wondering if it is possible to log that data to a thumb drive? I know that I can log data to an SD card, but I thought a thumb drive would be more accessible to users who wish to obtain the data. And if it is possible to log to a thumb drive, could it be done in CSV format? The data is just sensor data.

1
  • 2
    they make tiny readers that convert sd/microsd into usb drives, in about the same form factor as a thumb drive. not exactly the same thing, but way easier and cheaper to interface with an MCU.
    – dandavis
    Jul 2 at 19:53

2 Answers 2

2

In principle you can log to a thumb drive any data you want, binary and text (thus also CSV).

However, the Arduino Uno does not support connecting a USB stick directly. If you want to connect a USB stick, you need a so called USB Host shield (for Arduino).

More information can be read on the Arduino site at this page:

https://docs.arduino.cc/retired/shields/arduino-usb-host-shield

2

[Updated]

As an alternative to a Uno host shield, changing to a different Arduino MCU may also assist. USB host capabilty is needed for communicating with thumb drives.

Some Arduino models have a native USB port (e.g., Arduino Due, Arduino Leonardo, Arduino Micro, Arduino Nano 33 IOT, Arduino Zero, Arduino MKR Zero, Arduino MKR1000 ... ) which will work as a USB client device role.

A smaller set of MCU can act as either a USB client or host (e.g., Arduino Due, Arduino Portenta, ...). There is a USBHost library for Arduino Due listed in the Arduino Reference. Documentation for Arduino Portenta in USB host mode is here.

Here is a discussion (and reference to an alternative library) regarding using a Due to write files to a thumb drive.

Of course an adapter cable or a thumb drive with a physical connector matching the native USB port on the selected MCU is required. Both are commonly available.

See also Can the Arduino interface with USB devices without the USB host shield?

4
  • For the Micro and Leonardo, the datasheet of the ATmega32U4 says its USB controller “Supports full-speed and low-speed Device role”. I see no mention of support for the host role. Are you sure they can act as a host? Jul 2 at 22:28
  • Hi Edgar, no my experience has been with the Due, and so I relied on the linked discussion for the list of other MCU with native USB. I’ll edit my answer. Thanks. Do you know of a list of MCU with host capable native USB?
    – RowanP
    Jul 3 at 0:24
  • No, sorry. My experience with USB-capable Arduinos is limited to playing with the Keyboard library on a Micro. I just learned that the Due is host-capable, thanks to your answer. Jul 3 at 8:00
  • Thanks for the help!
    – Renier Jr.
    Jul 6 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.