RS232 Disk Drive, USB drive, disk storage, mass storage nonUSB, non-USB
MSTOR - Arduino USB Disk Shield
by Versalent
MSTOR Shield - USB Mass Storage Adapter -- an Arduino USB host shield providing access to a 16g USB-thumb drive. Its FAT file system provides all the standard disk file operations -- read/write/append files, navigate and modify the directory structure, list directories and files etc. The battery-backed real time clock maintains accurate file timestamps that are automatically managed. Since the FAT file system is PC compatible data is portable.

The Mstor.cpp driver communicates with Mstor using a serial port -- either SoftwareSerial which can reliably operate at up to 38.4k baud, or using Arduino's HardwareSerial port which can run up to 250k baud. Communications reliability is assured by the 16-bit CRC's included in each data packet.

The disk is protected during unexpected power loss by the battery which maintains USB power long enough to complete any USB transactions-in-progress. And the bright RED LED warns when the disk is active to prevent unsafe disk removal - similar to Windows safety-eject.
RS232 Disk Drive
RS232 Disk Drive    Home
MSTOR Datasheet by Versalent

MSTOR   Arduino Disk Shield

  • Serial interface to standard USB drive, FAT formatted, PC compatible
  • Easy access using standard file operations
  • Onboard battery backed real-time clock
  • Automatic error detection/correction communications


  • Arduinos without USB needing large/removal storage
  • Systems requiring data/file portability with a PC
  • Long term data logging
  • Adds storage to existing systems

       MSTOR is a standard Arduino Shield that brings up to 16 gig of mass storage to systems with no USB ports. The embedded file system allows a user to send simple commands to List Files and Directories, Read/Write/Append or Delete Files, Make/Delete Directories and more using familiar functions. A fully operational Arduino application is provided to exercise all features. Full manual here

See the code here to read a file. Similar code here to write to a file.

Resources Required
  • A Serial Port -- SoftwareSerial operates up to 38.4k baud. HardwareSerial operates to 250k baud (sacrifices Serial Monitor)
  • A Timer -- One interrupt-based timer running at 2-25ms.
  • ~6k code space/150 bytes RAM for Mstor.cpp driver
  • Programming skill needed to operate: LOW to MODERATE.
Software Applications
  • Complete Arduino Uno sample application which provides a simple user interface to exercise all Mstor features. Can be used as a development guide, a cut/paste source for Mstor features, or an as-is application .. download here

  • An Arduino application template to start a new application   download here


After an Mstor object is created:    Mstor myMstor;    you have access to Mstor's methods and data.
  • To send commands you invoke the command method with any needed parameters .. i.e. myMstor.fileOpen('R', filename);
    Every method returns a result which is typically 0 for success, or non-zero indicating an error (codes listed at the end of the manual). And every method is timed so that a result is ALWAYS returned even if Mstor fails to respond

  • When reading (records) from an open file data is returned in the[] array and the number of bytes returned is myMstor.data_count. To minimize Arduino data usage this array has a size of 32 bytes. If the number of bytes returned from a read operation is zero, Mstor has reached the end of data. view/copy simple read-file code here

  • When writing (records) to an open file: you have the option of writing strings or binary data.
    1. To write Strings: myMstor.fileWrite("a file string") presents the string as a parameter of the command so does not use the[] array.

    2. To write binary data: you load up to 32 bytes in[] , set myMstor.data_count, and invoke myMstor.fileWrite() -- no parameters. The binary data is written to the file. view/copy code here

See the manual for a detailed description of configuration options.
Warranty    Home
RS232 Disk Drive, USB drive, disk storage, mass storage nonUSB, non-USB