X-board继电器

产品简介

网络操做变得如此简单。拥有Xboard继电器,你不仅能通过网络监测数据,也能控制数据。Xboard继电器把Atmega32U4微型处理器和wiz5100芯片结合在一起。wiz5100同Arduino Lendardo和以太网数据库完全兼容,它拥有内嵌Xbee模块和两个继电器,因此能够通过网络感应和控制,操作简易。

不同于之前的X-board,X-board继电器不需要编程适配器,只需一条micro USB线,就能上传程序。

技术规格

继电器规格

wiz5100应用实例

使用材料:

标准POE协议以太网交换机(路由器) X1

X-Board继电器模块 X1

Micro USB线 X1

网线 X1

**PS**: 以下图片盗用W5500模块,但是实际连接都是一样的。

第一步:将X-Board继电器模块接上网线插到路由器任意LAN端口,也可使用普通交换机、路由设备或直接连接到PC端网口(当使用普通交换机、路由设备或直连PC端网口时需要为模块提供电源)。

第二步:将Micro USB线插在X-Board继电器模块上,另一端接电脑USB口。

第三步:烧录以下代码

    /*
    DFRobot X-board V2 Sample Code

     A simple web server with DHPC capbabilty.
     1)Get IP address from router automatically
     2)Show the value of the analog input pins

     created 28 Sep 2012
     by Ricky
     */

    #include <SPI.h>
    #include <Ethernet.h>
    EthernetServer server(80);
    // Enter a MAC address and IP address for your controller below.
    // The IP address will be dependent on your local network:
    byte mac[] = {
      0xDE, 0xCD, 0xAE, 0x0F, 0xFE, 0xED };

    // Initialize the Ethernet server library
    // with the IP address and port you want to use
    // (port 80 is default for HTTP):


    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:
      if (Ethernet.begin(mac) == 0) {
        Serial.println("Failed to configure Ethernet using DHCP");
        // no point in carrying on, so do nothing forevermore:
        for(;;)
          ;
      }
      // print your local IP address:
      Serial.print("My IP address: ");
      for (byte thisByte = 0; thisByte < 4; thisByte++) {
        // print the value of each byte of the IP address:
        Serial.print(Ethernet.localIP()[thisByte], DEC);
        Serial.print(".");
      }
      Serial.println();

      // start the Ethernet connection and the server:

      server.begin();
      Serial.print("server is at ");
      Serial.println(Ethernet.localIP());
    }


    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("Connnection: close");
              client.println();
              client.println("<!DOCTYPE HTML>");
              client.println("<html>");
              // add a meta refresh tag, so the browser pulls again every 5 seconds:
              client.println("<meta http-equiv=\"refresh\" content=\"5\">");
              client.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.dfrobot.com/ihome/stylesheet/stylesheet.css\" />");

              client.println("<center> <a href=\"http://www.dfrobot.com\"><img src=\"http://alturl.com/qf6vz\"></a> </center> ");
              client.println("<br />");

              client.println("<div>");
              // output the value of each analog input pin
              for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
                int sensorReading = analogRead(analogChannel);
                client.print("analog input ");
                client.print(analogChannel);
                client.print(" is ");
                client.print(sensorReading);
                client.println("<br />");

              }

              // output the value of each digital input pin
              for (int digitalChannel = 2; digitalChannel < 10; digitalChannel++) {
                int sensorReading = digitalRead(digitalChannel);
                if(digitalChannel!=7&&digitalChannel!=8)
                {
                  client.print("Digital input ");
                  client.print(digitalChannel);
                  client.print(" is ");
                  client.print(sensorReading);
                  client.println("<br />");
                }

                else
                {
                  client.print("Relay ");
                  client.print(digitalChannel);
                  client.print(" is ");
                  client.print(sensorReading);
                  client.println("<br />");

                }


              }

              client.println("</div>");
              client.println("</html>");
              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 disonnected");
      }
    }

<File:nextredirectltr.png>购买 X-board继电器(SKU:DFR0222)

category: Product Manual category: DFR Series category: Module

结果展示

1.烧录完成后,打开串口监视器。窗口会显示你的IP地址。

2.打开浏览器->输入IP地址->回车打开网页。

3.在页面中我们可以看到板子6路模拟口输入值在网页上按5S/次的频率自动刷新显示,此时说明我们创造的一个小型Web Server已经正常工作了。并在串口监视器也有相应的数据反馈

异常情况解决办法:

对于计算机浏览器出现“网页无法加载”问题的小伙伴儿先不要着急,请按照如下步骤配置你的网络适配器:

1、打开控制面板-->网络和 Internet-->网络和共享中心-->更改适配器设置

2、找到你连接模块的网络-->右键-->属性-->在网络选项卡中找到“Internet协议版本4(TCP/IPv4)"并双击进入属性设置

3、输入下图所示参数并点击确定。在此之后再按照上面示例中第六步操作就行了....

W5500TCP.JPG

继电器模块应用实例

参考普通继电器wiki

**注意**:注意实际参数变化。

继电器规格

额定电流:10A(NO)5A(NC)

最大合闸电压:150VAC 24VDC

数字接口

控制信号:数字输出

触点容量(Res.Load):10A 277VAC/24VDC

最大合闸电压:250VAC/30VDC 250VAC/30VDC

最大合闸电流:15A

最大合闸电源:2770VA 240W 2770VA 240W

额定电压: 10A 120VAC /10A 277VAC

操作时间(nomi. Vot.): 10ms

释放时间(nomi. Vot.): 5ms