Failing to write to SD card using SD.h Using a knockoff Arduino Nano (pinout seems to be the same), I would like to record data to an external SD card. I have everything hooked up (correctly I think) but I continue to fail to initialize the card using SD.begin().

Here's a snippet of code that I'm running to do this: 

//Wire and MS5803_I2C libraries for communicating with the pressure sensor. 

#include &lt;Wire.h&gt;               
#include &lt;SparkFun_MS5803_I2C.h&gt;
// For the SD card reader.
#include &lt;SPI.h&gt;               
#include &lt;SD.h&gt;              

const int chipSelect = 4;

void setup(void) {
  Serial.begin(9600); // Set baud rate.
  pinMode(10, OUTPUT); // Set data output pin for the SD card reader.
  digitalWrite(10, HIGH);
 // see if the card is present and can be initialized:
 if (!SD.begin(10)) {
   Serial.println("Card failed, or not present");
   // don't do anything more:
   return;
 }
 Serial.println("card initialized.");
  delay(500);  // Wait half a second before continuing.
}

void loop(void) {
  Serial.println("Hello Library!");
  delay(100000);
}


Here's the Nano pinout:



And a picture of the circuit.
The Sparkfun pressure sensor has a 3.3V chip and a SD memory card is also 3.3V. Your Arduino Nano is probably a 5V board. How did you connect those to the board ?

When your Nano board is 5V, you need a SD module with a level shifter for the signals.

To make it work, test either the SD or the sensor and try to make it work. When testing the SD, don't connect the sensor and don't even include the sensor library.