The Ethernet W5100 Shield with Micro SD Card Slot is an expansion board designed for Arduino boards (such as Arduino Uno, Mega, etc.) to provide Ethernet connectivity and the ability to interface with a micro SD card. It uses the W5100 Ethernet chip to enable communication over a network (wired Ethernet) and the micro SD card slot allows you to store and retrieve data locally.
This shield is commonly used in projects where you need an Arduino to communicate over a local network or the internet (e.g., web servers, IoT applications), as well as store or log data to an SD card.
The Ethernet W5100 shield uses the following pins on the Arduino:
PinDescriptionPin 10CS (Chip Select) for EthernetPin 11MOSI (Master Out Slave In)Pin 12MISO (Master In Slave Out)Pin 13SCK (Serial Clock)Pin 4CS (Chip Select) for SD card
Here’s a basic example to get the shield working with both the Ethernet and SD card functionalities:
#include <SPI.h> #include <Ethernet.h> #include <SD.h> byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // MAC address for Ethernet shield IPAddress ip(192, 168, 1, 177); // Static IP address EthernetServer server(80); // Server port 80 for HTTP void setup() { // Start the Serial Monitor for debugging Serial.begin(9600); // Initialize Ethernet shield Ethernet.begin(mac, ip); server.begin(); // Initialize SD card if (!SD.begin(4)) { // Pin 4 is used for SD card CS Serial.println("SD Card initialization failed!"); return; } Serial.println("SD Card initialized."); // Print the IP address to Serial Monitor Serial.print("Arduino is connected to the network with IP: "); Serial.println(Ethernet.localIP()); } void loop() { EthernetClient client = server.available(); if (client) { // Read HTTP request String request = client.readStringUntil('\r'); client.flush(); // Serve a simple HTTP response if (request.indexOf("GET /") != -1) { // Open a file from the SD card File file = SD.open("data.txt"); if (file) { // Serve the content of the file client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/plain"); client.println("Connection: close"); client.println(); while (file.available()) { client.write(file.read()); } file.close(); } else { // File not found client.println("HTTP/1.1 404 Not Found"); client.println("Content-Type: text/plain"); client.println("Connection: close"); client.println(); client.println("File not found on SD card."); } } delay(1); // Close the connection client.stop(); } }
Brand:- Generic
Origin:- China