Tags: Card, Module, Slot, Socket, Reader, Arduino, Compatible, SD, Mp3, player, Board

SD Card Module Slot Socket Reader For Arduino (Data Logger and read write projects)

  • 19.00 AED
    • Ex Tax:19.00 AED
    • Brands techmaze
    • Product Code: Digital
    • Availability: In Stock
    SD Card module can make your SD application more easier and simple. It is easily interfaced as a peripheral for Arduino sensor shield module. Through programming, you can read and write to the SD card using for Arduino. Also can be used SD Card for more easily to develop, such as for MP3 Player, MCU..

    SD Card module can make your SD application more easier and simple. It is easily interfaced as a peripheral for Arduino sensor shield module. Through programming, you can read and write to the SD card using for Arduino. Also can be used SD Card for more easily to develop, such as for MP3 Player, MCU/ARM system control.

    Specifications 

    • Communication : SD SPI ( MOSI, SCK, MISO and CS )
    • DC Input : 5V/3.3V
    • Size : 5.1cm x 3.1cm - 2.01inch x 1.22inch. 

    The LC Studio SD Card module allows you to add data storage capability to your Arduino for about three bucks.   Its been around a while so there are plenty of internet resources.


    LC Studio SD Card Pin Outs

    LC Studio SD Card Pin OutsArduino LC Studio SD Card Tutorial

    This particular tutorial will involve a single hook up. You will upload different sketches that demonstrate some of the different things you can do with the SD Card.

    Format Your SD Card

    You will need an SD Card.  Mine is 8 GB.   Format that SD Card using Windows.  I formatted mine as a FAT32 volume.

    Connect the Arduino SD Card Module to your Arduino

    The good news here is that you’re only going to require one set up to play with the various functions.

    Arduino LC Studio SD Card Tutorial Hook Up

    Initializing your SD Card

    Before you can do any cool stuff with your SD Card you will need to:

    • Have an SD Card in your module.
    • Establish an instance of the card in your code.
    • And tell it begin

    Copy, Paste, and Upload the Initializing Code

    //Henry's Bench
    // LC Studio SD Card Initializing Tutorial
    //Connections:  MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 10
    
     
    #include <SD.h>
    #include <SPI.h>
     
    int cs = 10; // Set Chip Select to pin ten
     
    void setup()
    {
      // Open serial communications and wait for port to open:
      Serial.begin(9600);
      while (!Serial) {
        
      }
      Serial.println("Initializing SD card...");
      Serial.println();
      
      pinMode(cs, OUTPUT);
      
      // Documentation says you're supposed to do this
      // even if you don't use it:
      pinMode(SS, OUTPUT);
       
      // see if the card is present and can be initialized:
      if (!SD.begin(cs)) {
        Serial.println("SD did not initiliaze");   
        while (1) ;
      }
      Serial.println("SD initialized.");
    }
     
    
    void loop()
    {
    
    }
    
    

    Test the Initializing Sample Sketch

    Open your serial monitor.  If the SD card is inserted, it should initialize.

    If it does initialize, try removing your removing your SD card and notice that it will fail to initialize.

    Creating an SD Card File and Writing to It

    In this next sample sketch,  you’re going to create a file if it doesn’t already exists and write your first line of text to it.

    If it does exist,  you will open it and add another line.

    Notice the flush() command.  It saves your file.

    Copy, Paste and Upload the Creating and Writing Sketch

    //Henry's Bench
    // LC Studio SD Card Create and Write to File Tutorial
    //Connections:  MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 10
    
     
    #include <SD.h>
    #include <SPI.h>
     
    int cs = 10; // Set Chip Select to pin ten
    
    File myFile;  // a File Object
     
    void setup()
    {
      //
      char myFileName[] = "MyFile.txt";  // The name of the file we will create
      
      
      // Open serial communications and wait for port to open:
      Serial.begin(9600);
      while (!Serial) {
        
      }
      Serial.println("Initializing SD card...");
      Serial.println();
      
      pinMode(cs, OUTPUT);
      
      // Documentation says you're supposed to do this
      // even if you don't use it:
      pinMode(SS, OUTPUT);
       
      // see if the card is present and can be initialized:
      if (!SD.begin(cs)) {
        Serial.println("SD did not initiliaze");   
        while (1) ;
      }
      Serial.println("SD initialized.");
     
     
     // Lets check to make sure that the SD card doesn't already have our file
      if (! SD.exists(myFileName)){
         // This next statement will open a file for writing if it exists
         // If it does not exist, it will create that file. That's what we're doing here.
         myFile = SD.open(myFileName, FILE_WRITE); 
         // This next statement checks to see if the file
         myFile.println("My 1st Line of Data");  // Send Your First Line to that file
         myFile.flush();  // Save it.
      }
      else{
        // We got here because the file already exists.
        // Therefore we're simple opening the file and writing to it. We will add another line at the end.   
        myFile = SD.open(myFileName, FILE_WRITE); 
        myFile.println("Another Line of Data");  // Send Your First Line to that file
        myFile.flush();
        
      }
      
      Serial.println("Done Writing");
      
    }
    
    void loop()
    {
    
    }
    
    


    This is a review/ tutorial of the SD card reader for arduino, in this video, you will learn how to create a file in an SD card using the Arduino, how to read a file from an SD card using an Arduino, and general usage of SD card with Arduino: