I stopped by my local Radio Shack the other day to pick up a USB to Micro USB Cable for my RaspberryPi when I noticed the large Arduino section. As I perused the products, I came across the Arduino Micro, as some of you know I prefer to work with small Arduino’s (Pro Mini), so, out of curiosity I purchased an Arduino Micro with headers and headed home. As soon as I got home, I read up on the spec’s for the Micro and decided to take it for a test run. The first test I always run when acquiring new Arduino boards is the simple Blink sketch test. I connected the Arduino Micro to my MAC’s USB port, opened up the Arduino IDE, set the Board and Serial Port and uploaded the Blink sketch and BOOM all worked out as expected. Since the first test passed with flying colors, I wanted to hook it up to something other than an LED, so I opened up my toolbox of components and found an Adafruit MicroSD card breakout board that needed some testing. I gathered all the necessary components, MicroSD card, jumper wires and breadboard and began the build process.
I started out by formatting(FAT16) my SD card using disk utility on my MAC. Next, I placed the components, the Arduino Micro and the Adafruit MicroSD card breakout board onto the breadboard and began to wire them up. The first thing I noticed was that the SPI on the Arduino Micro is on the ICSP header, historically older Arduinos such as the Duemilanove/Diecimila supported SPI communication via pins 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). So, I had to do some adjusting to get it wired up correctly.
My diagram (above) displays the jumper wires being connected from the MicroSD card pins to the Arduino Micro pins. You’ll notice that there’s one pin on the MicroSD card breakout board, “CD” that I did not wire up. The CD pin, is the Card Detect pin. You can connect a pull up resistor(10K) and wire it to another pin if you want to detect when a card is inserted, I didn’t need this added functionality for my testing purposes.
After the components were all wired up, I navigated to Examples > SD > CardInfo in the Arduino IDE. Once the sketch was in the view port, I read the code to understand it. Thanks to informative comments, I had to revise the sketch by changing the “chipSelect” variable from pin 4 to digital pin 10.
I inserted the MicroSD card into the breakout board, uploaded the sketch and opened up the Serial Monitor which printed the following:
SUCCESS, The card has been recognized! The initial test validated that the MicroSD card was formatted correctly and that the wiring from the Arduino Micro to the MicroSD card was correct. I know this is just the tip of the iceberg, there is so much more I can do with these components, but for now, its just good enough to get me started. I really like the size of the Arduino Micro, including its 20 digital I/O pins and micro USB support. The labeling on the board can be hard to read, so I advise bookmarking the reference page to help define the pins, that being said, if you have experience with any of the other Arduino hardware available today, be sure to check for pin-compatiblity when wiring up your projects. Happy Hacking!