Testing the SD Card Slot

Now we want to test the SD card slot, since it can be used in all the subsequent gadgets in this book.


  1. Arduino
  2. Ethernet shield
  3. microSD card


Step 1 Insert the microSD card into the holder.

Step 2 Load the sketch “SD card read/write,” which you can find in the IDE under File | Examples |SD |ReadWrite or on EMWA GitHub repository | chapter-6 | SDCardReadWrite.

Step 3 If the Arduino successfully reads “testing 1, 2, 3” from the SD card and displays it on the serial output, the SD card slot works.

If instead, the serial output displays the words “error opening test.txt,” there is an error somewhere and you’ll need to do some troubleshooting.

Get Environmental Monitoring with Arduino now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.