SD_guideMany modern embedded devices depend on NAND flash memory for data storage and operation. NAND (Negated AND) is referred to as the same silicon logic gate technology used in eMMC, SSD, Compact Flash, and form factor variants of SD, such as micro SD flash memory. In this post I cover basics of micro SD cards because they are the most portable, widely available, and used in many embedded devices as well as micro PCs currently on the market. A common misconception is that all flash memory is equally reliable, which often leads to choosing the most cost-effective and highest storage capacity card. I think software engineers, diy’ers, and practitioners in the field need to understand the variable dependability of this technology. Device operation failure can result from compromised software due to corrupt or defective memory.

There are a few things you should know when choosing a micro SD card for your custom device, or buying an off-the-shelf device with a micro SD card inside. NAND flash technology is pretty complicated, and I will not be covering a lot of the details here. I just want to present you with some basic information you should consider when choosing a micro SD card for your project.

What are micro SD cards?

Micro SD cards are basically a NAND-type flash chip and a tiny microcontroller in a small, portable package. NAND-type flash memory can be written and read in blocks/pages, one drawback being that it can only take a certain amount of write cycles per block/page. The flash chip is where the blocks of storage exist and the microcontroller is used to access and perform error corrections, wear leveling and bad-block control. This algorithm in the microcontroller can increase the number of write cycles (aka endurance cycles) and the overall life of the flash, but it is not standard to all flash memory cards. Because of their compact size, micro SD cards use different microcontrollers than SSD or eMMC flash, which tend to be the more reliable but less portable NAND flash option (usually soldered or permanently installed).

One of the main goals of flash manufacturers has been to reduce the cost per bit and increase maximum storage capacity in order to compete against traditional magnetic storage such as HDD. The most common question about micro SD cards is: “How do they become larger in storage capacity, but remain at the same physical size?” Well, the short answer is that manufacturers make the NAND geometry smaller and pack more bits per cell, which also means that there is less space between bits. This is where the reliability factor comes in. Just like with everything else in engineering, you don’t get something for nothing, and there is always a sacrifice.

What are the different types?

Looking up micro SD cards can be tough and some of these technical details are not outlined in the glossy brochure. There are a ton of little symbols on these things and as the technology improves in performance, new standards are issued, usually depicted by a new symbol on the card. You really need to know your application requirements beforehand. There are a lot of micro SD cards out there tailored for specific applications, or even for specific devices. Some will have faster read/write speeds than others, some will withstand a higher range of temperature, shock, water, and other extreme conditions of operation. These are all important, but the main differentiator in reliability is the NAND geometry also referred to as cell size/sector size or trace width. Small NAND geometry means small sector size, small sector size means there is less space between data bits. Less space between bits allows manufacturers to offer higher storage capacity in the same form factor, but it can cause serious issues such as sector cross-talk, read disturb, data corruption, and ultimately unreadable memory. These issues are usually caused by unexpected events such as abrupt power loss while writing to a sector on the card for example. This may not so bad if your micro SD is only used for data storage – you lost historical data, but if you are running your Operating System on the micro SD card, your whole system may be compromised.

There are a few types of NAND. I listed them here in order of most reliable first:
SLC – Single Level Cell, 1-Bit/Cell, large geometry, 2 voltage states to represent 0 and 1, difficult to obtain as a user and very expensive.
pSLC – Pseudo SLC, MLC in 1-Bit/Cell Mode, medium geometry, 2 voltage states to represent 0 and 1, easier to obtain and more affordable than SLC.
MLC – Multi Level Cell, 2-Bit/Cell, small geometry, requires 4 voltage states to represent 00, 01, 10 and 11, easy to obtain and very affordable.
TLC – Tri Level Cell , 3-Bit/Cell, very small geometry, requires 8 voltage states to represent 3-bits 000, 001, 010, 011, 100, 101, 110 and 111, easy to obtain, but please stay away from this type. I personally would not install this type of card even in my camera, my vacation pictures are worth something to me.
QLC – new technology on the horizon, not available yet. 4-bit/Cell…

How should I choose?

  • NAND geometry – as a controls guy this is really the first thing I look at before I go on and look at the rest of the card specs. If you are choosing a micro SD card for an automation/control device, this is the first spec you should be looking at too. This is also the most costly spec. It is really difficult and expensive to obtain SLC NAND in micro SD form factor (SDHC / SDXC), especially as a consumer/enthusiast. SLC is usually available in Compact Flash or SSD form factor. SLC is so expensive in micro SD form factor, that manufacturers will go to eMMC chips before they put one of these cards in a device. MLC NAND should really only be used for consumer devices such as cameras, smart phones, etc. Where the behavior of reads/writes is easily predictable and the Operating System is not running in the micro SD card. TLC is so unreliable that I am not even going to discuss it here, and I recommend staying away. This leaves us with the best and most affordable NAND option in micro SD form factor – the pSLC. Pseudo SLC NAND provides a good middle ground. Even though it is based on MLC geometry, it is set in 1-bit/cell mode which really makes a difference. I created a little graphic for comparison pictured above. You can see that the middle relative sector size rectangle (bright green pSLC) is very similar in size to MLC and TLC, but the bit spacing is significantly different. pSLC is the type of card I chose for my embedded device or micro PC systems.
  • CAPACITY – this is the most basic parameter and it is pretty straight forward. Choose the capacity which will fit your application and leave you some room for operation and future updates. If the device trends data, calculate the maximum space you can use on the card (total card size minus your installed application size) before you have to purge old data, ultimately purging old data should happen automatically in software.
  • SPEED – this parameter is important, but unless you are buying a very inexpensive micro SD card, most modern cards from reputable manufacturers will have pretty good read/write speeds. For good speeds, you should be looking at “Class 10″or or “U3” symbols indicated on the card. This performance metric is also dependent on your host device.
  • ENDURANCE/ WRITE CYCLES – this will vary from different manufacturers, and again the NAND geometry will come into play here. Simply look for cards which state “high endurance” which will usually denote MLC and TLC. These numbers are not scientific, but if I had to give you some rough estimation, an SLC will give you  about 50K+ cycles, a pSLC card will give you 20K+ and MLC or TLC only about 1K.
  • RANGE OF OPERATION – this is difficult to prove, so a lot of times you have to take the manufacturer’s word on the spec and do some testing of your own to “qualify” the card for your application. Most embedded device applications are 0-60°C, but wide temperature operation, water and shock proof cards are also available. If your application is really extreme or mission-critical, you should probably not be using a micro SD card of any type, but eMMC or SSD instead.

The bottom line is that you really want to go for a pSLC micro SD card for your embedded automation device or micro PC. Just the fact that it is pSLC NAND-type flash covers a lot of the other important specs and then all you have to worry about is capacity and maybe range of operation. I always go for pSLC cards from reputable manufacturers. I have personally done extensive tests where I randomly and abruptly power cycle an embedded device literally thousands of times while writing some data to the card periodically. The worst I have seen with pSLC is some recent data loss, but never failure. I currently have a Raspberry Pi3 with a pSLC card which has randomly rebooted over 5,000 times running BASpi-IO software in Raspbian Stretch. It is still working and it is still power cycling!


Please comment if you have any questions. I would love to hear about your experience with micro SD cards or other flash storage.

34 Responses

  • soi keo

    Very good post. I’m experiencing some of these issues as well..

  • Very good article thank you Zach

  • Calvin Slater

    Nice article Zach. SD card choice is an important issue if your controller database will rely on it over long periods. Internal reliability and wear leveling mechanisms in SD cards truly varies greatly. You get what you pay for.

    • znetsovCC

      Thanks Calvin! It really is important to choose a good SD card!

  • Shery

    Thanks, it’s quite informative

  • Marvin

    I spent a lot of time to find something similar to this

  • Dante

    This is truly helpful, thanks.

  • Julissa

    Thank you for the excellent article

  • jama

    Thanks for the great guide

  • cleo

    Wow, that’s what I was looking for, what a material!

  • leo

    whoah this weblog is fantastic i like reading your posts.
    Keep up the great work! You realize, many persons are searching round for this info, you could aid them greatly.

  • AlexOrice

    The Class rating of a MicroSD card refers to its minimum transfer speed. UHS stands for Ultra High Speed.

  • adab

    Awesome article.

  • martin

    micro SD card is a very useful device. thanks for sharing information about using embedded automation device. Its an amazing article and it is so helpful for us.

  • sean

    Very good post. Lots of information mentioned in this blog. Thanks for sharing.

  • ray

    Greate post. Keep posting such kind of information on your blog.
    Im really impressed by it. I’ll definitely recommend to my
    friends. I am sure they’ll be benefited from this web site.

  • van

    you’ve done a fantastic task on this topic!

  • robin

    The online buyers must check for the recommendations or suggestions for selecting the best quality card for their embedded automation devices.

  • James_Abifs

    Love the Rpi! For example, for setting up a home automation system on a budget, I d choose the Raspberry Pi Zero W, because it is a small and very low-cost SBC device (around $10), with ample processing power and memory (1GHz ARM6 processor and 512 MB RAM) for performing data processing and analytics on the device. It supports microSD card flash memory expansion up to 64GB for storing programs and data. And, it is equipped with a full 40-pin GPIO header, just like the Raspberry Pi 3, which allows connecting multiple sensors and supports both SPI and I2C protocols. It has on-board wifi for connecting with a home network, and it can be powered with micro-USB off a portable power pack or wall power supply.

    • znetsovCC

      James! I really like the Pi Zero as well. It is so small and so powerful! Our BASpi IO board can actually work with the Pi Zero as well. The only reason we do not promote the concept is because of the different form factor and limited availability of the Rpi Zero, but you are welcome to use it!

  • Annmarie

    Way cool! Some extremely valid points! I appreciate you penning this post plus the rest of the website is really good.

  • tinnel olie

    This is one awesome post.Really cool. thank you!

  • Alberto

    This is a surely exciting post. Keep them coming.

  • Leo

    Admiring the hard work you put into your blog and detailed information you provide.
    It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Wonderful read!

  • Elinor

    Very informative. I am working with Raspberry Pi and Beaglebone and I love it. Thank you

  • robs

    wow, awesome blog article.Thanks Again. Want more.

  • Very good post! We are linking to this particularly great content on our website.
    Keep up the great writing.

  • This is very interesting, You are a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking more of your magnificent post.
    Also, I’ve shared your web site in my social networks!

    asmr 0mniartist

  • I am really inspired along with your writing talents as neatly as with the format to your blog.

    Is that this a paid subject or did you customize it yourself?

    Either way keep up the excellent quality writing, it’s rare to see a great blog like this one today..

    asmr 0mniartist

  • It’s fantastic that you are getting thoughts from this piece of writing as well as from our discussion made at this time.

    asmr 0mniartist

  • Excellent post. Keep writing such kind of information on your site.
    Im really impressed by it.
    Hello there, You have performed a great job. I’ll certainly digg
    it and in my view suggest to my friends. I’m confident they will be benefited from this website.
    0mniartist asmr

  • Greetings! This is my first visit to your blog!
    We are a group of volunteers and starting a new project in a
    community in the same niche. Your blog provided
    us valuable information to work on. You have done a extraordinary job!

  • Greetings! Very useful advice in this particular post!
    It is the little changes that produce the biggest changes.

    Thanks for sharing!

  • It’s not my first time to go to see this web site, i am visiting this web page
    dailly and obtain fastidious data from here everyday.


Leave a Reply

Your email address will not be published. Required fields are marked *