read CID of SD card with SD.h library
The method is visible from within your sketch. You just need to first create a cid_t struct like this in your sketch:

cid_t cid;  // at the top with the other globals


Then call readCID() anywhere in setup() after the card has been initialized.

card.readCID(&amp;cid);
Serial.print("Serial number: "); Serial.println(cid.psn); // psn is the serial number field of the struct


Check out SdInfo.h for the other struct members.