W5500 Ethernet Shield v1.0
El W5500 Ethernet Shield v1.0 puede proporcionar conectividad a internet a tus proyectos. El W5500 permite a los usuarios tener conectividad a Internet en sus aplicaciones utilizando un solo chip, en el cual están integrados la pila TCP/IP, MAC Ethernet 10/100 y PHY. El shield también tiene dos conectores Grove y un socket para tarjeta microSD para soportar proyectos que requieren almacenar grandes cantidades de datos de sensores Grove. El puerto RJ45 (donde se conecta el cable Ethernet) es lo suficientemente bajo para permitirte apilar más shields encima de este si es necesario.
Características
- Soporta Protocolos TCP/IP por Hardware: TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE
- Soporta 8 sockets independientes simultáneamente
- Soporta modo de apagado
- Soporta Wake on LAN sobre UDP
- Soporta Interfaz Periférica Serie de Alta Velocidad (SPI MODO 0, 3)
- Memoria interna de 32Kbytes para Buffers TX/RX
- PHY Ethernet 10BaseT/100BaseTX integrado
- Soporta Auto Negociación (Full y half duplex, 10 y 100* basado)
- No soporta Fragmentación IP
- Operación a 3.3V con tolerancia a señales I/O de 5V
- Salidas LED (Full/Half duplex, Link, Speed, Active)
- Socket para tarjeta Micro-SD
- Conectores Grove para I2C y UART
Descripción General del Hardware
Configuración del Hardware
- RJ45: Puerto Ethernet;
- IC W5500: un Controlador Ethernet TCP/IP por hardware;
- Botón Reset: Reinicia el shield Ethernet;
- Socket para Tarjeta SD: soporta tarjeta Micro SD en FAT16 o FAT32; almacenamiento máximo es 2GB.
- Interfaz I2C
- Interfaz UART
Uso de pines en Arduino
- D4: Selección de chip de tarjeta SD
- D10: Selección de Chip W5200
- D11: SPI MOSI
- D12: SPI MISO
- D13: SPI SCK
Tanto el W5500 como la tarjeta SD se comunican con Arduino a través del bus SPI. Los pines 10 y 4 son pines de selección de chip para W5500 y el slot SD. No pueden ser utilizados como I/O general.
Uso
Te mostraremos un ejemplo. Este ejemplo puede subir datos a una página web y almacenar los datos de tu sensor en una tarjeta SD.
Hardware
Lista de Partes:
Nombre | Función | Cant |
W5500 Ethernet Shield | Proporcionar conectividad Ethernet | 1 |
Seeeduino V4.2 | Controlador | 1 |
Grove-Temp&Humi Sensor | Sensor | 1 |
Base Shield V2 | Shield Base | 1 |
Tarjeta Micro SD | Almacenar datos | 1 |
Procedimiento:
- Monta el W5500 Ethernet Shield v1.0 en tu Arduino, monta el Base Shield V2 en el Ethernet Shield, y conecta el sensor Grove-Temp&Humi al puerto Grove D5 del Base Shield, conecta la tarjeta SD.
- Conecta el shield Ethernet a la red con un cable Ethernet estándar;
- Conecta Arduino a la PC vía cable USB;
Software
- Por favor sigue los procedimientos de cómo instalar una librería de arduino para instalar la librería.
- Haz clic en el botón de abajo para descargar las librerías del W5500 Ethernet Shield.
- Instala la librería en tu Arduino IDE cuando se haya descargado.
- Copia el código de abajo en el sketch y luego súbelo:
//This sketch uses W5500 Ethernet Shield,Seeeduino V4.2,Grove-Temp&Humi,
//Base Shield V2 Sensor and Micro SD Card to design a temperature and humidity collection station.
//attach the temperature and humidity sensor to base shield D5 grove port.
//It publishes the temperature and humidity data to webpage
//and refresh every 5 seconds, store the data into SD card datalog.txt file.
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 5
const int chipSelect = 4;
// Please update IP address according to your local network
#if defined(WIZ550io_WITH_MACADDRESS) // Use assigned MAC address of WIZ550io
;
#else
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
#endif
IPAddress ip(192,168,0,177);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection and the server:
#if defined(WIZ550io_WITH_MACADDRESS)
Ethernet.begin(ip);
#else
Ethernet.begin(mac, ip);
#endif
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
//initializing the SD card
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("card initialized.");
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println("Refresh: 5"); // refresh the page automatically every 5 sec
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
// output the value of input pin on web
int chk;
chk = DHT.read(DHT11_PIN); // READ DATA
client.print("Humidity: ");
client.print(DHT.humidity);
client.println("<br />");
client.print("Temperature: ");
client.print(DHT.temperature);
//write value of input pin into SD card
// make a string for assembling the data to log:
String dataString = "";
// read the humidity and temperature and append to the string:
dataString = String(DHT.humidity) + String(DHT.temperature);
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// if the file is available, write to it:
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
// print to the serial port too:
Serial.println(dataString);
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
}
else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
Serial.println("client disconnected");
}
}
Resultados
Ahora, mostraremos el resultado.
- Inserta tu tarjeta SD en la computadora, verás información de temperatura y humedad.
- Además, podemos ver información desde la web.
¿No es muy fácil? Puedes comenzar tu proyecto.
Visor de Esquemático en Línea
Recursos
- W5500 Ethernet Shield en formato Eagle
- Esquemático del W5500 Ethernet Shield en formato PDF
- PCB del W5500 Ethernet Shield en formato PDF
- Librería del W5500 Ethernet Shield
- Hoja de datos del W5500 Ethernet Shield.pdf
Soporte Técnico y Discusión de Productos
¡Gracias por elegir nuestros productos! Estamos aquí para brindarte diferentes tipos de soporte para asegurar que tu experiencia con nuestros productos sea lo más fluida posible. Ofrecemos varios canales de comunicación para satisfacer diferentes preferencias y necesidades.