Physical mounting of micro SD card reader

Started by syrinxtech, July 10, 2016, 06:13:36 AM

syrinxtech

I have a project where I'm adding the Adafruit micro SD card reader to a project for long-term data storage.

Due to the design of the breakout board attached to the unit, there isn't a lot of room for mounting since the slot needs to be extremely close to the edge of the plastic case.  Does anyone have any recommendations or examples of how they have mounted such drives in projects?

TomWS

Quote from: syrinxtech on July 10, 2016, 06:13:36 AM
I have a project where I'm adding the Adafruit micro SD card reader to a project for long-term data storage.

Due to the design of the breakout board attached to the unit, there isn't a lot of room for mounting since the slot needs to be extremely close to the edge of the plastic case.  Does anyone have any recommendations or examples of how they have mounted such drives in projects?
Assuming the breakout board has its own power decoupling caps, lead length could be a couple of inches without an issue.  However, if you're sharing SPI with any other devices, set up your logging code to treat all logging operations as atomic (ie, init SD, open the file, append the new data, close the file without any other SPI operations in between).  In my experience, uSD does not deal well with SPI activity to other devices.

Tom

syrinxtech

Thanks for the tips TomWS. 

In this case I'm not sure I can treat it atomically since it will be connected to a Moteino acting as the gateway for all of the sensors in the house.  As the data comes in from the sensors it will serially write them to a Particle Photon which will send the data to the Internet where I will use freeboard to view the data.  The Moteino will also have a RTC for time/date stamping of all log entries.  The base unit will also write all of the log entries to the micro SD card.  In my environment, given the number of weather sensors I use, the data is coming in pretty much all the time so I'm not sure that atomic operations would be able to keep up.

The reason I went with this solution is that during the last storm we just had we lost power within 5 minutes of the beginning of the storm.  I had all of these wonderful battery operated weather sensors pushing out this data without anything to collect it.  I re-engineered my entire internal system and will move the base station to a UPS with the sd card to be able to capture the weather data in the event of a power outage.  This UPS also keeps my Internet cable modem up so I can log to the Internet (which also allows me to view with my cell phone).

I'm sure this setup has a high chance of conflicting with the RFM69 radio using SPI so it's entirely possible another redesign will happen when I actually implement the sd card (later this week).  I'm using the Mega platform due to the obvious memory improvements.

TomWS

Well, let us know how that works out for you.  If you're not using both serial ports on the Mega, perhaps you could use the MSPIM mode of the USART as a dedicated SPI port to the SD card.  You could also choose soft-SPI which is supported by the SD-Fat library.

Tom


syrinxtech

Thanks for the suggestions, Tom.

I'll take a look at the SD-Fat library.