image1 image2 image3

HELLO I'M LiNuS|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I PRESENT MY WORKS ON VLSI AND EMBEDDED

Serial Data Logging on SD cardStor

Serial Data Logging on SD card
Storing Serial data to SD card

We will be ahead with these:
  1. What is Serial data?
  2. Necessity of storing.
  3. Requirements to build.
  4. Wiring's for the circuit.
  5. Programming.
  6. Working/Implementation video.
1.What is Serial data?
                                                      Serial data is the data receiving one bit at a time sequentially over a bus or communication channel. To have the Serial data the Serial Communication path has to be established. There are many advantages in serial communication when compared to parallel. Though the parallel communication is faster, it requires more number of paths to transmit data bits separately. The serial communication requires very very few dedicated lines for transmission. There are several serial communication standards. They are the RS-232, SPI, USB, PCI express, I2C, Firewire, Ethernet, CoaxPress, Sonet and SDH etc.,

 SPI (Serial Peripheral Interface):
SPI
                                                  Serial Peripheral Interface (SPI) is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. It can also be used for communication between two microcontrollers.
                                                   With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. Typically there are three lines common to all the devices:
ICSP      

  • MISO (Master In Slave Out) - The Slave line for sending data to the master.
  • MOSI (Master Out Slave In) - The Master line for sending data to the peripherals.
  • SCK (Serial Clock) - The clock pulses which synchronize data transmission generated by the master and one line specific for every device.
  • SS (Slave Select) - the pin on each device that the master can use to enable and disable specific devices.
                                                     When a device's Slave Select pin is low, it communicates with the master. When it's high, it ignores the master. This allows you to have multiple SPI devices sharing the same MISO, MOSI, and CLK lines.                                                     

USB(Universal Serial Bus):
                                             Universal Serial Bus (USB) is a specification to establish communication between devices and a host controller (usually personal computer). Nowdays USB has replaced a variety of earlier PC interfaces (such as RS-232 serial or parallel port). Due to the ability to supply power to the preipheral devices USB is often used as a power charger for portable devices.
USB symbol

                                            An USB system architecture consists of a host controller, a USB ports, and multiple connected devices. Additional USB hubs may be included allowing branching into a tree structure with up to five tier levels.  USB can connect computer peripherals such as mice, keyboards, digital cameras, PDA, mobile phones, printers, personal media players, flash drives, GPS, Network Adapters, and external hard drives. For many of those devices, USB has become the standard connection method.
USB standard
                                             Where D+ is Data+ signal line and D- is Data- signal line. + is voltage line and - is ground line. USB interface aimed to remove the need for adding expansion cards into the computer's PCI or PCI-Express bus, and improve plug-and-play capabilities by allowing devices to be hot swapped or added to the system without rebooting the computer. USB 1.0 has 1.5Mbit/s, USB 2.0 has 480Mbit/s and USB 3.0 has 5Gbit/s speed.

2.Necessity of Storing:
  1.  The several Sensing devices monitor the data continuously, in order to handle those data and to process, we need to store this data on to memory.
  2. The data from the Sensing and tracking devices such as IMU (Inertial Measurement Unit), GPS module etc., are serial which needs to be stored and processed periodically.
  3. Secure Storage of Crucial Information- One of the main rewards of keeping your documents digitally is getting your files safe and secure from information thieves and undesirable visitors. There is a choice associated with obtaining only selected files and data files, maintaining them available only to management.
  4. Easy Back-up in Event of Disasters- Obtaining the physical location associated with an workplace damaged can be devastating, but imagine if all of the information that a company is keeping was destroyed at the same time. The actual data a enterprise houses will be the lifeblood of the company, and having a backup of these files can be very valuable.
  5. Information is Very easily Accessed- One of the great issues concerning a electronic filing technique is the ease of which information is restored and used. If you currently operate with a actual filing method, then you definitely comprehend how difficult it could be to locate a lost record. An electronic storage program allows you to search for the record in several other ways, making data files much easier to locate.
3.Requirements to Build:
  1. Arduino Board(of any type), here Mega is used.
  2. SD card module.

  3. Memory card with adapter.(1GB or 2GB)
  4. 6- Female to male connector pins.
4.Wiring's for the circuit:
  1. Format the Memory card with FAT format on PC (FAT & FAT 16 is recommended) and insert into adapter.
  2. SPI serial interface is established between SD card module and Microcontroller.
  3. For Arduino Uno - MISO - Pin 12, MOSI - Pin 11, SCK - Pin 13, CS - Pin 10.    
  4. For Arduino Mega - MISO - Pin 50, MOSI - Pin 51, SCK - Pin 52, CS - Pin 53.
  5. connections are 
  6. After, the connections insert the memory card in to the slot.
5.Programming:
/* Upload this on to your board from Open-source Arduino Platform*/
/*After the Upload GoTo=> Tools=>Serial monitor=> set baud rate 9600=>send(data)*/
/*After enter the data remove the connections and insert memory card to Computer and explore to files*/

#include <SPI.h>
#include <SD.h>

File linu;

void setup() {
Serial.begin(9600);
while(!Serial)
{
}
Serial.println("Initializing the SD card module");
pinMode(53,OUTPUT);
if(!SD.begin(53))
{
Serial.println("initialization failed!");
    return;
}
Serial.println("initialization done.");  
}

void loop() {
linu = SD.open("linu.txt",FILE_WRITE);
if (linu) {
   Serial.print("Writing to linus.txt...");
   while(1)
   {
     if(Serial.available())
     {
       String a = Serial.readString();
    linu.println(a);
     linu.close();
     break;
     }
   }
     Serial.println("done.");
  } else {
    Serial.print("error in writing");
  }
}


6.Working/Implementation video:

Have a Glance over this video to digest the project.

Video 1 : Illustration of Programming and Serial Monitoring

Video 2 : Referring the data on the memory card from computer





Share this:

CONVERSATION

1 comments:

  1. I Like to add one more important thing here, North America is expecting the highest growth for embedded multimedia card market worldwide as tremendous growth of 3G penetration across the region.

    ReplyDelete