Using the MicroSD Adapter TinyShield Tutorial

by TinyCircuits Staff February 19, 2016

Using the MicroSD Adapter TinyShield Tutorial

Overview

The TinyShield microSD Adapter board lets you add a huge amount (many GBs) of storage to your projects by using a microSD card. This Adapter works directly with the built in Arduino SD Card libraries that are already installed in the Arduino IDE.


           

Powering the System

A microSD card consumes a large amount of power when it is being accessed(100-200mA), so your TinyDuino system needs to have a power supply or battery that is large enough to power this. The coin cell option on the TinyDuino is not sufficient to power this.

The microSD Adapter TinyShield includes a local voltage regulator and level shifters, so your TinyDuino system can operate from 3-5 Volts safely.


Formatting the microSD Card

The Arduino SD Card Library supports cards formatted with FAT16 and FAT32 filesystems. For best results, we recommend formatting your microSD card before use by using the official SD card formatting utility as supplied by the SD Card Association.

Download it here.


Testing it out

Plug in your TinyDuino to your computer with the USB TinyShield and the microSD Adapter TinyShield attached, and insert the microSD card into the connector. Start up the Arduino IDE, and go to the SD CardInfo sketch.

Before you run the sketch, we need to change the Chip Select to match what is used on the TinyShield, which is pin 10.

Note: Any sketch that uses the microSD card shield will need to have this set to 10 before you run them.

Now click the Upload button on the Arduino IDE to build the sketch and upload it to the TinyDuino. Open up the Serial Monitor, type something in and press "Send". You should receive some data back on the card and a list of files:

If this is having a problem recognizing the card, check that you set the ChipSelect value to 10. Also try to format your card using the official SD Card Utility.


Using the microSD Card

There are a number of examples included in the Arduino IDE that will help you get started using the microSD card. One of the best basic examples to get you started is the Datalogger example (in the Arduino ID under File...Examples...SD...Datalogger). This example will read several ADC values and store them to a file on your microSD card. Just be sure to remember to set the ChipSelect variable at the top of the file to a "10".



TinyCircuits Staff
TinyCircuits Staff

Author



Also in Learn

TinyDuino GPS Tracker + Data Logger Tutorial
TinyDuino GPS Tracker + Data Logger Tutorial

by Lilith Freed February 08, 2017

Follow this simple tutorial to build your own portable GPS device!

View full article →

Wifi TinyShield Tutorial (with Cayenne IoT)
Wifi TinyShield Tutorial (with Cayenne IoT)

by TinyCircuits Staff February 01, 2017

Our newest version of the Wifi TinyShield provides users with the ability to easily connect their TinyDuino stack to the...

View full article →

Flash Memory TinyShield Tutorial
Flash Memory TinyShield Tutorial

by TinyCircuits Staff January 23, 2017

Learn how to utilize storage on the Flash Memory TinyShield with your TinyDuino or TinyScreen+!

View full article →