Extend an Arduino with a CF Card or IDE Drive

Extend an Arduino with a CF Card or IDE Drive © CC BY

Interface an Arduino Mega with an IDE drive or CF Card! It is easier than you might have thought!

  • 4,537 views
  • 0 comments
  • 8 respects

Components and supplies

Apps and online services

About this project

The built-in 1 or 4 kilobyte EEPROM memory of an Arduino is quickly used up if you want to permanently store large amounts of data. So it makes sense to connect external mass storage devices in some cases. Fortunately there is already a library and various breakout modules available that allow to connect an SD card to the Arduino. But it is also possible (and not even difficult) to connect CompactFlash and even older hard drives, disk drives or CD- Rom drives to an Arduino Mega. This is due to the fact that CF cards are compatible with the parallel ATA (PATA) specification that was common until 2003. PATA compatible drives are also called IDE drives in common parlance. Unlike SD cards, IDE drives operate at 5V TTL level, so they can be directly connected to the Arduino´s IO Pins.

You can find the Arduino library files and examples on Github.

This allows you to do either low-level reads and writes on individual sectors or access files on FAT formatted volumes.

In this video I explain more in detail:

Installation

Download the library and example files from Github and copy the files to your project or Arduino library folder. Wire the Arduino and hard disk as shown above. For CF Cards, PATA adapters are available.

Read and write raw data

Directly read or write sectors of a hard disk or CF Card. See the "raw_io.ino" example in the example folder.

Read and write files

If the SDFat library V2 from Bill Greiman is installed, data carriers formatted with FAT16 / 32 can also be read or written.

  • Set #define SPI_DRIVER_SELECT 3 in SDFat/src/SdFatConfig.h
  • Then uncomment "#define USE_FAT" in CFCard.h Most of the functions provided by the SDFat library should work with CF Cards and PATA drives as well. See the "file-io.ino" example.
  • A downside of the SDFat library is however, that that it can only deal with volumes that have a master boot record (MBR). Compact Flash cards formatted with Windows don´t have an MBR, but Windows users need not despair. There is a free tool, called Rufus available that can format the drive so that it is accepted by the SdFat lib.

Code

Schematics

wiring
Wire Arduino Mega and IDE connector like shown here
Wiring jltcyzhyyq

Comments

Similar projects you might like

Using FreeRTOS Semaphores in Arduino IDE

by Phillip Stevens

  • 30,786 views
  • 9 comments
  • 27 respects

Plugin Blockly@rduino for Arduino IDE

by Team LibrEduc

  • 27,072 views
  • 4 comments
  • 42 respects

Improve Security of Your Hard Drive by Arduino & Fingerprint

Project tutorial by ElectroPeak

  • 5,198 views
  • 2 comments
  • 22 respects

Programming Nextion LCD Without SD Card

by Tamer Savaşcı

  • 34,373 views
  • 6 comments
  • 11 respects
Add projectSign up / Login