Arduino SD Card Testing on Ethernet Shield
Created on: 27 December 2012
This article shows how to test that the SD card (micro SD card) and SD card socket / connections are working properly on the Arduino Ethernet shield.
A video at the end of this article shows all the steps explained in this article.
Hardware, Software and Setup
The Arduino Uno board and official Arduino Ethernet shield are used in this article. The Ethernet shield contains the WIZnet W5100 Ethernet chip.
Arduino software (IDE) version 1.0.3 was used in this article.
To set up the hardware, first plug the Arduino Ethernet shield into the Arduino board and then plug a micro SD card into the SD card socket of the Ethernet shield. Power the Arduino from a USB cable plugged into the host PC computer.
Reading the SD Card Information
The first test loads one of the SD card sketches from the built-in Arduino IDE examples to read the SD card information. This will test that the SD card can be accessed.
Find the example in the Arduino IDE under File → Examples → SD → CardInfo and load it to the Arduino.
Open the serial monitor window from the Arduino IDE – if the SD card and shield are both working, card information will be displayed in the serial monitor window.
Writing To and Reading From the SD Card
To test that a file can be written to the SD card and that the file can be opened and read, load the ReadWrite example sketch found under File → Examples → SD → ReadWrite in the Arduino IDE.
Load the ReadWrite sketch to the Arduino and then open the Arduino Serial Monitor Window. The sketch will first initialize the SD card, then create a file and write some text to it. It will then open the file and read the text from the file and display it in the serial monitor window.
The SD card can then be removed and plugged into a PC using a card reader. The file that the Arduino created and wrote to can then be opened and read.
SD Card Testing Video
The hardware setup and both of the above tests are shown in this video:
Can't see the video? View on YouTube →