24mm (L) x 32mm (W) x 2.1mm (H)
24mm (L) x 32mm (W) x 2.1mm (H)
2g
-25C to 85C
-40C to 100C
5% to 95% RH
Applications
The Micro SD Card Adapter is suitable for a wide range of applications, including |
Expanding the storage capacity of devices such as cameras, smartphones, and laptops
Transferring data between devices that use different types of SD cards
Upgrading the storage capabilities of older devices that do not have a Micro SD card slot
Enabling the use of Micro SD cards in industrial control systems, medical devices, and other specialized applications.
Packaging and Accessories
The Micro SD Card Adapter is typically packaged in a small plastic bag or blister pack, and may include additional accessories such as |
A storage case or protective sleeve
A set of instructions or user manual
A Micro SD card reader or writer (optional)
Micro SD Card Adapter Documentation
Overview
The Micro SD Card Adapter is a small printed circuit board (PCB) designed to facilitate the connection of a micro SD card to a microcontroller or a single-board computer. It provides a convenient and compact way to add external storage to IoT projects, enabling the storage and retrieval of data, firmware updates, and more.
Pinout
The Micro SD Card Adapter typically features the following pinout:
| Pin | Function |
| --- | --- |
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
| CLK | Clock signal |
| CMD | Command signal |
| DAT0 | Data line 0 |
| DAT1 | Data line 1 |
| DAT2 | Data line 2 |
| DAT3 | Data line 3 |
Code Examples
### Example 1: Using the Micro SD Card Adapter with Arduino
This example demonstrates how to use the Micro SD Card Adapter with an Arduino board to read and write data to a micro SD card.
Hardware Requirements
Arduino Board (e.g., Arduino Uno or Arduino Mega)
Micro SD Card Adapter
Micro SD card (up to 32GB)
Software Requirements
Arduino IDE (version 1.8 or later)
Code
```c++
#include <SD.h>
// Pin definitions
const int CS_PIN = 5; // Chip Select pin for the SD card
void setup() {
Serial.begin(9600);
pinMode(CS_PIN, OUTPUT);
// Initialize the SD card
if (!SD.begin(CS_PIN)) {
Serial.println("Initialization failed!");
while (1);
}
Serial.println("SD card initialized successfully!");
}
void loop() {
// Write data to the SD card
File dataFile = SD.open("data.txt", FILE_WRITE);
if (dataFile) {
dataFile.println("Hello, world!");
dataFile.close();
Serial.println("Data written to SD card.");
} else {
Serial.println("Error writing to SD card.");
}
// Read data from the SD card
File readFile = SD.open("data.txt", FILE_READ);
if (readFile) {
while (readFile.available()) {
Serial.write(readFile.read());
}
readFile.close();
Serial.println("Data read from SD card.");
} else {
Serial.println("Error reading from SD card.");
}
delay(1000);
}
```
### Example 2: Using the Micro SD Card Adapter with Raspberry Pi (Python)
This example demonstrates how to use the Micro SD Card Adapter with a Raspberry Pi single-board computer to read and write data to a micro SD card using Python.
Hardware Requirements
Raspberry Pi single-board computer (e.g., Raspberry Pi 3 or Raspberry Pi 4)
Micro SD Card Adapter
Micro SD card (up to 32GB)
Software Requirements
Raspbian OS (version 10 or later)
Python 3.x
Code
```python
import os
# Mount the SD card
os.system("sudo mount /dev/mmcblk0p1 /mnt")
# Write data to the SD card
with open("/mnt/data.txt", "w") as f:
f.write("Hello, world!
")
print("Data written to SD card.")
# Read data from the SD card
with open("/mnt/data.txt", "r") as f:
print(f.read())
print("Data read from SD card.")
# Unmount the SD card
os.system("sudo umount /mnt")
```
Note: Make sure to replace `/dev/mmcblk0p1` with the correct device path for your micro SD card.
These examples demonstrate the basic usage of the Micro SD Card Adapter in different contexts. You can adapt and modify the code to suit your specific IoT project requirements.