Low Power Showdown: uSD Card Sleep and Write Current Draw
Environmental sensors and animal-borne “bio-loggers” are usually constrained by power (Gaidica & Dantzer, 2020). For example, recording neural activity requires roughly 7 milliamps (mA) of current which will consume a 200 mAh LiPo battery in about a day. It turns out writing to SD cards (micro-SD, or “uSD” cards, in this case) is a major power hog in addition to active sensors. The topic has been wonderfully exhausted over at The Cave Pearl Project and on forums, but we wanted to do our own bench testing to make sure we were choosing the right card for our application.
We used the hardware and software configuration shown in Figure 1. At the core were an Adafruit Adalogger (3.3v logic) and the Ardunio SdFat library, which has some notable optimizations over the standard Ardunio SD library. Tagging alongside the Adalogger was a custom circuit that allowed us to measure the current of the uSD card as an isolated component communicating over the SPI bus with a dedicated chip select (CS) line. We identified 3 uSD modes:
-
Initialization: when the uSD card is first inserted (i.e. power-up)
-
Sleep: after initializing, but not writing to the uSD card
-
Write: writing a single ascii character “X” to a file, looped for 10 seconds
Following (1) sd.begin()
is called and the uSD card enters (2) sleep mode, after which we cue the (3) write cycle using a button press (see Bhargavi’s code on GitHub). We tested the following uSD cards you can find on Amazon:
We aimed to select a range of cards of the same capacity that were accessible and economical. These cards could be counterfeit, as some people claim, but the datasheets from a vendor like Digi-Key made us no less certain about performance expectations.
Results
Our results show that Kootion card has superior performance in both initialization and sleep modes, while the Samsung wins without question for writing. We highlight sleep mode performance below because it is likely the most important (see also, “Alternative Strategies”). We are not sure how important the initialization mode is in practice, because it appears that it can be quickly subverted by sd.begin()
. Altogether, it was surprising that a well-known brand performed the worst, and a relatively unknown brand performed the best. In the future, we may want to expand this research to obtaining cards from other vendors to rule out counterfeiting or to point out differences in production runs (i.e. changes over time).
Alternative Strategies
If your application doesn’t use more than ~4GB you can get away with something like NAND flash that doesn’t necessarily draw less current draw during writes but does have a lower sleep current. A strategy we are currently deploying is writing ~1Mb chunks to FRAM (which draws ~1mA during writes) and then dumping that to the uSD card intermittently. Using this strategy, we compress about 5-minutes of recording to FRAM into a 7-second write to the uSD. A strategy often talked about is powering down the uSD card during non-writing periods using a high-side FET, and despite some claims that this is dangerous, our overall takeaway is that it’s a strategy worth pursuing if you have a device that requires incredibly long sleep periods (months-to-years).
The application-specific question in choosing the right uSD card might come down to the ratio of time spent in sleep vs. write mode. A heavy sleep would benefit from the Kootion, whereas a heavy writer would benefit from the Samsung.
Other Considerations
We didn’t characterize power transients or “spikes” that occur transitioning between modes which might impact power consumption and should be considered in the context of brown-out protection (these currents can exceed 100 mA).
The power curve for a standard LiPo battery is non-linear and might depend on the C-rating of the battery as well as factors like ambient temperature. Given that failing to complete a write cycle can brick a card (i.e. corrupt all data), it’s highly recommended to turn off data logging before it is susceptible to dipping below the circuit-wide operating voltage (~3.6 volts) in the presence of a current transient.
by Matt Gaidica and Bhargavi Ravishankar — Dantzer Lab, University of Michigan
3 Comments
Recent Comments
Archives
- April 2023
- January 2023
- November 2022
- May 2022
- March 2022
- January 2022
- December 2021
- April 2021
- December 2020
- October 2020
- August 2020
- July 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- January 2019
- December 2018
- November 2018
- August 2018
- July 2018
- April 2018
- March 2018
- November 2017
- October 2017
- February 2017
- October 2016
- August 2016
- July 2016
- November 2015
- October 2013
- February 2013
- January 2013
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- February 2012
- December 2011
spec
April 23, 2020 at 11:34 am
This is gold! Thank you!
Bill
January 25, 2021 at 11:45 pm
This is great, thank you! The high endurance SD cards are supposed to be the lowest current draw if you want to test those cards next.
Matt Gaidica
January 25, 2021 at 11:57 pm
Oh, that’s interesting! I’ve since switched to SPI NAND—it still has enough storage, but a smaller footprint and lower sleep/write power. The uSD route always had me worried that a brownout would corrupt the data if it were mid-write, or in some transient state.