Overview
Storing data is one of the most important parts of every project. There are several ways to store data according to the data type and size. SD and micro SD cards are one of the most practical ones among the storage devices, which are used in devices such as mobile phones, minicomputers and etc.
In this tutorial, you’ll learn how to use SD and micro SD cards with Arduino. In the end, as a simple project, you will measure the environment temperature every hour and store it on the SD card.
What You Will Learn
How to use SD and micro SD card
Writing data on SD card
Reading data from SD card
The SD and micro SD card modules allow you to communicate with the memory card and write or read the information on them. The module interfaces in the SPI protocol.
To use these modules with Arduino you need the SD library. This library is installed on the Arduino application by default.
Note
These modules can not handle high-capacity memory cards. Usually, the maximum identifiable capacity of these modules is 2 GB for SD cards, and 16 GB for micro SD cards.
A brief explanation of practical SD library’s commands is provided in the attached table.
*file is an instance from File class.
You can find more information about the SD library Here.
Tip
The module used in this tutorial is the micro SD module, however, you can use the code and tutorial for SD modules as well.
You can find DS3231 here. In addition to the IC clock and calendar, this module also has a temperature sensor.
To work with the DS3231 module, you must first add the library (Sodaq_DS3231.h) to the Arduino application.
After storing the temperature at different times of the day, you can draw this information into Excel using the chart.