Projects / Ethernet

Wired Ethernet Sensor Server

Temperature, humidity and light over a network cable — for server rooms and offices.

Intermediate⏱ 1.5 hours4 ElectroTrical boards

Overview

Wi-Fi isn't always welcome — server rooms, shops and industrial panels often want a wired device with a fixed address. The ET-C11 adds 10/100 Ethernet to the ET-M02 using the WIZnet W5500.

The board serves a status page for people and a /json endpoint for monitoring tools (Home Assistant, Node-RED, Grafana or a simple script). It measures temperature and humidity with the ET-S70 SHTC3 and light level with the ET-S69 OPT3001 — useful to check that the AC is working and the lights are off.

  • 10/100 wired Ethernet with DHCP
  • HTML status page and /json endpoint
  • Temperature, humidity and lux
  • No Wi-Fi needed

What you need

ElectroTrical boards

ET-M02ESP32-S3 Dev BoardController
Coming soon
ET-C11W5500 Ethernet BoardWired Ethernet with RJ45 jack
Coming soon
ET-S70SHTC3 Temperature + Humidity SensorTemperature and humidity
Coming soon
ET-S69OPT3001 Lux SensorLight level
Coming soon

You'll also need

  • Ethernet cable to your router or switch
  • 2 Qwiic cables
  • USB-C 5 V supply
  • Jumper wires

Wiring

Addresses: SHTC3 0x70, OPT3001 0x44.

ET-C11 → ET-M02 (SPI)

FromToNote
VBUSVIN5 V; the board has its own 3.3 V regulator
GNDGND
IO12SCK
IO13MISO
IO11MOSI
IO10CS
IO5INT
IO4RST

Qwiic chain

FromToNote
ET-M02 QwiicET-S70 Qwiic
ET-S70 QwiicET-S69 Qwiic

Build it

  1. 01

    Wire the Ethernet board

    Connect the ET-C11 to the ET-M02 header as in the table, and chain the sensors with Qwiic cables.

  2. 02

    Set up the Arduino IDE

    Install the Espressif ESP32 package version 3.0 or newer (the sketch uses its built-in W5500 driver). Select “ESP32S3 Dev Module” and set USB CDC On Boot to Enabled.

  3. 03

    Connect the network

    Plug in the Ethernet cable. The link LED on the jack lights when the cable is good.

  4. 04

    Find the address

    Serial Monitor prints the IP address the router gave it. Open it in a browser, or http://<ip>/json for machine-readable data.

  5. 05

    Give it a fixed address

    In your router, reserve that IP for the board's MAC address (also printed) so monitoring tools always find it.

Arduino code

Written for the ET-M02 ESP32-S3 Dev Board. Install these libraries from the Arduino Library Manager:

  • Adafruit SHTC3 Library
ethernet_sensor_server.ino
#include <SPI.h>
#include <Wire.h>
#include <ETH.h>
#include <WebServer.h>
#include <Adafruit_SHTC3.h>

const int ETH_CS = 10, ETH_INT = 5, ETH_RST = 4;
const uint8_t OPT = 0x44;

Adafruit_SHTC3 shtc3;
WebServer server(80);
float tC, rh, lux;

uint16_t optRead(uint8_t reg) {
  Wire.beginTransmission(OPT); Wire.write(reg); Wire.endTransmission(false);
  Wire.requestFrom(OPT, (uint8_t)2);
  return (Wire.read() << 8) | Wire.read();
}

void readSensors() {
  sensors_event_t h, t;
  shtc3.getEvent(&h, &t);
  tC = t.temperature; rh = h.relative_humidity;
  uint16_t r = optRead(0x00);                       // result register
  lux = 0.01 * (1 << (r >> 12)) * (r & 0x0FFF);
}

void handleJson() {
  readSensors();
  char buf[128];
  snprintf(buf, sizeof buf, "{\"temperature_c\":%.2f,\"humidity\":%.1f,\"lux\":%.1f,\"uptime_s\":%lu}",
           tC, rh, lux, millis() / 1000);
  server.send(200, "application/json", buf);
}

void handleRoot() {
  readSensors();
  String html = "<!doctype html><meta name=viewport content='width=device-width'><meta http-equiv=refresh content=10>"
                "<body style='font:18px sans-serif;max-width:420px;margin:30px auto'><h2>Room status</h2><p>";
  html += String(tC, 1) + " &deg;C<br>" + String(rh, 0) + " %RH<br>" + String(lux, 0) + " lux</p>";
  html += "<p style='color:#888'>JSON: /json</p>";
  server.send(200, "text/html", html);
}

void onEvent(arduino_event_id_t event) {
  if (event == ARDUINO_EVENT_ETH_GOT_IP) {
    Serial.print("Ethernet up: http://"); Serial.println(ETH.localIP());
    Serial.print("MAC: "); Serial.println(ETH.macAddress());
  }
  if (event == ARDUINO_EVENT_ETH_DISCONNECTED) Serial.println("Cable unplugged");
}

void setup() {
  Serial.begin(115200);
  Wire.begin(8, 9);
  if (!shtc3.begin()) Serial.println("SHTC3 not found (0x70)");
  Wire.beginTransmission(OPT);                       // OPT3001: auto-range, 800 ms, continuous
  Wire.write(0x01); Wire.write(0xCE); Wire.write(0x10);
  Wire.endTransmission();

  Network.onEvent(onEvent);
  SPI.begin(12, 13, 11);                             // SCK, MISO, MOSI
  ETH.begin(ETH_PHY_W5500, 1, ETH_CS, ETH_INT, ETH_RST, SPI);

  server.on("/", handleRoot);
  server.on("/json", handleJson);
  server.begin();
}

void loop() {
  server.handleClient();
}

Troubleshooting

Compile error about ETH_PHY_W5500 or Network

Update the Espressif ESP32 package to version 3.0 or newer in Boards Manager.

No IP address

Check the link LED on the jack. If it's off, try another cable or switch port. If it's on, check the INT and RST wires.

Lux stays at 0

The OPT3001 needs its configuration write at start-up. Check its Qwiic cable and that address 0x44 shows in an I²C scan.

Take it further

  • Power it over the network cable with a PoE splitter feeding 5 V to the ET-M02
  • Send an email alert when the room gets too hot
  • Add the ET-C08 opto inputs to monitor door contacts or alarm outputs

Turning this into a product?

We design custom boards that combine these sensors on one PCB, with firmware and production.