ESP32 Ethernet: W5500 vs LAN8720 vs PoE Hardware

Choose W5500 SPI Ethernet, LAN8720 RMII or a PoE board. Includes verified ESP32 wiring, an Arduino link and DHCP sketch, and hardware troubleshooting.

If I already have an ESP32-S3 on the bench and need wired Ethernet, I’d start with a W5500 modulePriceAliExpress price. A LAN8720 board makes sense with the original ESP32 and a proven RMII layout. If the device is going on a wall or in a cabinet with one network cablePriceAliExpress price and no local power socket, I’d start with a PoE board. Check its Ethernet driver as well as how it takes power. Those are two separate choices and a product listing can leave one of them out.

This esp32.co.uk/ guide shows how the three paths fit together, gives a W5500PriceAliExpress price pin map for an ESP32-S3 DevKit and walks through RMII on the original ESP32. There’s also a small sketch that prints the difference between Ethernet starting, link coming up and DHCP giving the board an IPv4 address. A link LED on its own can’t tell you which of those steps worked.

W5500 SPI Ethernet and LAN8720 RMII paths with PoE shown as a separate power path

What each part does

A W5500 has an Ethernet MAC and PHY, packet memory and a hardware TCP/IP engine. The ESP32 talks to it over SPI. A module such as the WIZ850io puts the controller, transformer and RJ45 on the same board. That leaves power, ground and the SPI and control signals to wire. On the ESP32 side you need the right driver and available GPIOs. The chip supports a 10 or 100 Mb/s Ethernet link and a maximum SPI clock rating of 80 MHz under the chip’s specified conditions. Those are ratings for two different interfaces. WIZnet W5500 overview, WIZ850io module documentation.

A LAN8720A is a 10/100 Ethernet PHY. In the setup below, the original ESP32’s internal Ethernet MAC sends and receives data over RMII. The PHY turns that into the signals that go to the Ethernet magnetics and cable. The MAC and PHY need a shared 50 MHz reference and use MDC and MDIO for management. The ESP32-S3 doesn’t have the internal Ethernet MAC required for the original ESP32’s RMII wiring. Use SPI Ethernet for that S3 example. Check other chips by target. An ESP32-P4 Ethernet board, for instance, needs its own pin map and clock setup. ESP-IDF Ethernet driver, Microchip LAN8720A, Espressif Ethernet example targets.

PoE tells you how power gets down the cable. The board may still use an internal MAC and external PHY, or it may use a controller such as the W5500. Look for both in the schematic or documentation. A socket with Ethernet magnetics doesn’t establish that the board has a PoE power circuit. A product might also expose a separate header that expects a particular module before PoE works.

What you’re buildingHardware to start withDetails to check
A small sensor or gateway on an existing S3 boardW5500 SPI moduleGPIOs, regulator capacity, interrupt, reset and any other devices on the SPI bus
A new build around the original ESP32A proven RMII board with supported PHYFixed data pins, PHY address, clock direction and reset timing
A node fed by one cable from a PoE switchDocumented PoE-powered board or compatible splitter and Ethernet boardSupported PoE type, usable output power, isolation and Ethernet driver

If your W5500 project uses the Espressif ETH.h path below, the driver uses MACRAW and the ESP32 runs the TCP/IP stack. WIZnet also documents a socket offload path, used by libraries that open sockets on the controller. An example built around those sockets can have a different API and different limits. Pick the library before planning features around the offload engine or assuming how many sockets are available. ESP-IDF v5.5.1 Ethernet configuration.

On an existing project, count the pins you have left after the peripherals you actually use. A display or SD card may already use your preferred SPI pins. An RMII board may have appeared easier until you notice that a sensor is on GPIO21 and the MAC needs it for TX_EN. Also look at the expansion connectors. The chip might expose an otherwise suitable pin internally, while the development board uses it for a built-in LED or has no way to reach it. I’d make a pin list with one row per device before buying an add-on module.

Check Ethernet at the connector too. A bare LAN8720A design needs the analogue termination and magnetics appropriate to the PHY. A complete breakout normally provides those components and the RJ45. With the WIZ850io they are built into the module. If the board only exposes an Ethernet logic interface, an RJ45 socket on jumper wires won’t substitute for that circuit. Use the vendor schematic to see what’s already included.

Wire a W5500 to the ESP32-S3

This example uses an ESP32-S3-DevKitC-1 v1.1 and a WIZ850io. It uses GPIO numbers from the S3 header table, with a dedicated SPI bus for the first check. The WIZ850io has 3.3 V supply pins. On another W5500 breakout, check its regulator and the supply marked on the board. A pin marked 5V on a different breakout may be an input to a regulator. It tells you nothing about what your ESP32 signal pins can tolerate. Use 3.3 V logic and verify the schematic for the board in front of you. S3 DevKitC-1 v1.1 header table, WIZnet WIZ850io pin and power data.

WIZ850io signalESP32-S3 connectionDirection
SCLKGPIO12ESP32 to module
MOSIGPIO11ESP32 to module
MISOGPIO13Module to ESP32
CS, active lowGPIO10ESP32 to module
INTnGPIO14Module to ESP32
RSTnGPIO21ESP32 to module
3V3DRegulated 3.3 VModule supply
GNDCommon groundReturn
ESP32-S3 DevKitC-1 and WIZ850io SPI wiring with signal directions, 3.3 V supply and common ground

Use the module pin table to find each signal rather than the position of an RJ45 jack in a photo. Connect the required power and ground pins. Shut the supply off before moving wires. With power on, measure 3.3 V at the Ethernet module itself. WIZnet’s module data lists about 141 mA typical in its normal-current row. That’s only the module. Check the regulator’s usable current at the board’s input and temperature, and include the ESP32 and other loads. If the board resets during Ethernet and Wi-Fi activity, look at the 3.3 V rail first. Don’t parallel the outputs of separate regulators to solve a current shortage.

Start with short signal leads and a short ground return. The sketch sets SPI to 10 MHz as a starting setting, not a result or a recommended maximum. The W5500 datasheet’s upper figure isn’t what I’d try first on jumpers. If it only fails when the backlight comes on or an SD card is busy, isolate the Ethernet bus and power first. Once the bare setup works, bring the other peripherals back. A shared SPI bus needs independent chip selects and matching driver configuration. If someone’s library assumes it owns the SPI instance, sort that out before calling both.

WIZnet specifies an active-low reset pulse and a delay before the module will accept SPI traffic. The sketch pulses RSTn low for 2 ms and waits 60 ms after release before entering the driver. That satisfies the WIZ850io’s documented minimum 500 µs low and 50 ms after release. For this sketch the application owns that hardware reset and passes -1 for the W5500 reset argument. If you switch to a different Ethernet library or board definition, check who drives reset. An interrupt that was never connected, or wired to a GPIO your display already uses, can make a host-side problem look like lost Ethernet traffic. WIZ850io reset timing, Arduino-ESP32 Ethernet implementation.

When startup fails, check whether RSTn actually goes back high and whether there’s a clock burst with CS low. A logic analyser on the low-voltage SPI pins is handy here. Do the capture with the first Ethernet operation as the trigger, not long after the setup code ran. If the SCLK and chip select lines look right and MISO is stuck, check the header orientation, reset release and supply again. If the module responds with short leads but fails when you extend them, try a lower SPI clock and check signal integrity. That’s a better clue than a module swap where the new module also happens to be connected with shorter wires.

If you intend to use the same bus for a display, try full-screen redraws while receiving data. One long display transfer can keep Ethernet waiting even if the SPI signals are clean. Record what happens with the display enabled and with it idle. A separate SPI bus, smaller display transactions or a different pin plan might be worth the work if the data arrives in bursts.

Wire the LAN8720 on the original ESP32

If you’re choosing a board from scratch, get one with the RMII part already routed. Six of the RMII data and control signals in the original ESP32’s data path go to fixed pins. A loose PHY breakout needs more wiring than the SPI setup and the 50 MHz clock needs care even when the network is only negotiating 10 Mb/s. In the table, MDC and MDIO are management pins selected for this example. The pins in the six fixed rows are wired into the ESP32’s RMII function.

RMII or management signalOriginal ESP32 GPIODirection
TXD0GPIO19ESP32 to PHY
TXD1GPIO22ESP32 to PHY
TX_ENGPIO21ESP32 to PHY
RXD0GPIO25PHY to ESP32
RXD1GPIO26PHY to ESP32
CRS_DVGPIO27PHY to ESP32
REF_CLK, external input configurationGPIO0External 50 MHz to ESP32
MDC, example assignmentGPIO23ESP32 to PHY
MDIO, example assignmentGPIO18Bidirectional
Original ESP32 RMII signals connected to a LAN8720 with a board-specific 50 MHz reference clock

The PHY address comes from the board’s straps. The sketch’s example is address 0. Check the schematic before using it. Other modules use address 1, and some boards need a reset or power-control pin configured. Match the board’s clock mode as well. If you’ve got a stable reference board to compare with, check the population and clock connections. Changing address over and over won’t help a PHY without its clock or the wrong voltage on its I/O rail.

One layout sends a common external 50 MHz clock to the PHY and the ESP32. In another layout the LAN8720A derives 50 MHz from a 25 MHz crystal and sends that out at REFCLKO, if strapped for that mode. With the latter, Microchip documents timing constraints and the shared nINT/REFCLKO function. A breakout marked “CLK” doesn’t tell you whether it supplies the clock. Read the schematic. Don’t tie two enabled clock outputs together. LAN8720A datasheet, clock modes, Espressif RMII pin and clock guidance.

GPIO0 is the only external clock input for the original ESP32’s RMII MAC. It is also a boot strap. If a running clock makes that pin sample low during reset, the ESP32 can enter download mode instead of booting your application. Espressif recommends a design that keeps the clock off the pin during the strap sampling interval. A switched oscillator or a suitable PHY reset scheme can do that, depending on the circuit. Holding the PHY in reset doesn’t guarantee that every PHY output stops. Use the board’s supported scheme and check a cold boot, a reset and the programming sequence. The sketch assumes your external clock and reset arrangement is already handled by the board.

If the ESP32 must also run Wi-Fi, use an appropriate external RMII reference or one generated by the PHY. Espressif advises against using the ESP32’s internal RMII clock generation in that case because it can become unstable. Test cold starts on the actual supply and with both services running. If the flash tool stops talking after you add RMII hardware, remove the extra wiring with power off, confirm the normal boot path and check GPIO0 as you bring it back. ESP-IDF clock configuration, ESP32 boot recovery.

MDC and MDIO let the driver read and configure the PHY. They don’t carry the packet data. If the firmware can identify a PHY on the management bus, you still need to check the RMII data lines and reference clock before assuming the frame path is good. A clock can be present at the oscillator and look bad at the receiving pin. On a custom PCB, keep that route short, use the reference layout’s return path and check both ends if you have the right equipment. On a module with a usable reference design, copy the clock arrangement as a whole. A different breakout with the same PHY can have a different clock strap, PHY address or reset network.

Get link and an address in Arduino

The example below uses Arduino-ESP32 3.3.7. The package has it in ethernet_bring_up/ethernet_bring_up.ino. Leave USE_W5500 at 1 for the S3 and the wires above. For an original ESP32 with the specified RMII circuit, set it to 0 and check PHY address, management pins, the reset argument and clock mode against the board. The LAN8720 configuration uses -1 for a board with no driver-controlled PHY reset input in this example. If your PoE board has an Arduino variant, start with that variant’s documented settings instead of copying this generic RMII bench configuration.

#include <Arduino.h>
#include <ETH.h>

#define USE_W5500 1
#if USE_W5500
#include <SPI.h>
#elif !CONFIG_IDF_TARGET_ESP32
#error Select an original ESP32 target for this RMII pin map.
#endif

static void on_ethernet_event(arduino_event_id_t event)
{
    switch (event) {
    case ARDUINO_EVENT_ETH_START:
        Serial.println("Ethernet started");
        break;
    case ARDUINO_EVENT_ETH_CONNECTED:
        Serial.printf("Link up: %u Mb/s\n", static_cast<unsigned>(ETH.linkSpeed()));
        break;
    case ARDUINO_EVENT_ETH_GOT_IP:
        Serial.printf("IPv4: %s\n", ETH.localIP().toString().c_str());
        break;
    case ARDUINO_EVENT_ETH_LOST_IP:
        Serial.println("IPv4 lost");
        break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
        Serial.println("Link down");
        break;
    default:
        break;
    }
}

void setup()
{
    Serial.begin(115200);
    Network.onEvent(on_ethernet_event);

#if USE_W5500
    constexpr int rst = 21;
    pinMode(rst, OUTPUT);
    digitalWrite(rst, LOW);
    delay(2);
    digitalWrite(rst, HIGH);
    delay(60);

    // SCLK, MISO, MOSI, CS
    if (!SPI.begin(12, 13, 11, 10)) {
        Serial.println("SPI initialisation failed. Check the pin assignments.");
        return;
    }
    const bool started = ETH.begin(ETH_PHY_W5500, 1, 10, 14, -1, SPI, 10);
#else
    const bool started = ETH.begin(ETH_PHY_LAN8720, 0, 23, 18, -1, ETH_CLOCK_GPIO0_IN);
#endif
    if (!started) {
        Serial.println("Ethernet initialisation failed. Check hardware and settings.");
    }
}

void loop()
{
    delay(250);
}

Attach to the serial port that matches your application’s console. Connect the Ethernet cable to an ordinary LAN port with DHCP. A successful ETH.begin() means the driver started, so now wait for the other events. The link event means the physical connection came up. The IPv4 event should follow on a network that offers a lease. Logs from the callback come from the network-event task. If you add application work, keep the callback short and notify your own task. There is no Internet request in the example and no automatic restart if the cable is pulled. Plug it in again and watch the events.

The W5500 address argument follows Espressif’s Arduino W5500 example. It is separate from the strapped RMII management address in the LAN8720 call. Also check the order of the SPI pins. SPI.begin() takes SCLK, MISO, MOSI, then SS in this example. With the GPIO constants next to the wiring diagram it’s easier to spot a swapped pair. Arduino-ESP32 W5500 example, LAN8720 example, Arduino Ethernet declarations.

In ESP-IDF start with the Ethernet basic example for your release. In 5.5.1 its board configuration selects internal EMAC with a PHY or external SPI Ethernet. It attaches the driver to esp_netif so DHCP and IP events work. If the Ethernet driver is running but your application never gets an address, verify that attachment as well as the cabling. Some ESP-IDF versions package external Ethernet drivers differently. Start with the example from the SDK you built the firmware with. ESP-IDF v5.5.1 Ethernet basic example.

What to check on a PoE board

An IEEE PoE switch or injector is the power sourcing equipment, or PSE. The board or splitter taking power is the powered device, or PD. A compliant PSE uses a detection procedure before applying operating power to a compatible PD. The PD side feeds a DC/DC power stage, which supplies the board at the voltages it needs. Data still follows the Ethernet path through the magnetics. Buy the power path and the Ethernet interface as a pair if you want to get a new installation working quickly. IEEE 802.3 working group on PoE detection.

Standards-based PoE from a switch to an ESP32 powered-device board, with Ethernet data and DC power paths shown separately

For IEEE Type 1, the common figures are 15.4 W at the sourcing port and up to 12.95 W at the PD input under the specified cable budget. For Type 2 the corresponding figures are 30 W and 25.5 W. The board’s own converter can deliver considerably less to its accessory rail. Use its rated output, not the switch’s port number, to decide whether you can also power a display, sensor or relay. If you want several nodes on one switch, check the switch’s total PoE budget as well as each port’s rating. Texas Instruments PoE power overview.

A passive injector can place voltage on cable pairs without standard detection. Treat it as a different system. Use one only if the device, voltage, pair assignment and polarity were designed for it. Never feed an Ethernet cable’s PoE voltage straight into a DevKit’s VIN or 3.3 V pin, or into the WIZ850io’s supply. If you have a normal Ethernet board and need to power it remotely, a compatible IEEE PoE splitter can give you a separate low-voltage output. Check that output against the board’s input and load, and confirm the splitter carries the required Ethernet data rate.

Compare isolation before connecting a computer or an external sensor supply. Olimex documents that the ESP32-POE board has no galvanic isolation from the Ethernet supply and says to disconnect powered Ethernet before attaching USB for programming. Its ESP32-POE-ISO is a different design with isolation from Ethernet power. Follow the vendor’s wiring and power rules for the exact board and revision, including whether USB and PoE can be connected together. Don’t use an earth-referenced instrument on an unknown power domain. For a first check, power the board on USB with the powered Ethernet cable disconnected if the vendor requires it, then use the intended PoE setup on its own. Olimex ESP32-POE, Olimex ESP32-POE-ISO.

You can see why product types matter once the hardware is deployed. A PoE-powered Home Assistant radio adapter has a different job from a general-purpose PoE development board. Check that you can run your own application and find a supported firmware path for the board you’re buying. Home Assistant Connect AUX-2, SparkFun ESP32-P4 PoE development boards.

For a splitter setup, picture one cable coming into the box and two connections leaving the splitter. The Ethernet lead goes to the Ethernet module or board. The low-voltage lead goes to the board’s documented input. When the firmware makes a status LED or sensor turn on, it still takes power from that same low-voltage output. For example, a 5 V output rated at 0.7 A has a 3.5 W output budget. That is an arithmetic example, not a rating for either Olimex board. Include peaks at boot, current drawn by the Ethernet hardware and any accessory you’re running. Check the converter’s temperature and use its rating for the enclosure conditions.

Test a PoE node on the intended switch or injector before mounting it. On a managed switch, note whether the port refuses power, accepts it then cuts it, or stays powered while just the Ethernet link changes. A port can supply power to a board that has a broken data path. A board can also boot and get a lease for a few seconds before a power problem resets it. Leave the accessories disconnected on the first run, verify the intended board-only configuration and add each load. If the power event coincides with switching an accessory, follow the power budget and the board’s output limit before looking at DHCP.

Diagnose the first missing step

Diagnostic flow from board power and Ethernet driver startup through link, IPv4 and application traffic
What you observeWhat to check next
Board does not bootInput and load-side voltage, PoE port status if used, and GPIO0 strap behaviour on original ESP32 RMII
Driver will not startW5500 supply, reset, SPI pins and interrupt; or RMII PHY address, MDC/MDIO and clock
Driver starts, no linkKnown cable, enabled switch port, auto-negotiation and PHY or connector status
Link up, no IPv4DHCP service, VLAN or port assignment, and network interface configuration
IPv4 works, application failsLocal endpoint, route, DNS, service and application connection logs

Work in that order. If a W5500 module’s link LED lights on plug-in, it proves something about the PHY and its partner. SPI could still be wired wrong. If you can read the PHY through the driver but the network has no lease, check that the cable lands on a network where a DHCP server is available. A managed port may be assigned to the wrong VLAN for the device. Don’t start with a static address as a guess. If you need static addressing in a test network, use addresses assigned for that test and record them. A duplicate IP can appear to work until the other device sends traffic.

Once you get an IPv4 address, ping the board from another device on the same test LAN. A reply is a basic check. A missing reply can also come from a policy or filter, so confirm with the service you intend to run. Try the service by local IP first if you’re unsure about DNS. When Wi-Fi is enabled on the same ESP32, check that your application sends through the interface you intended. For the first bring-up, leave it off. Add it when Ethernet works on its own and check whether the active route still does what you expect.

Pull and reconnect the cable once, and watch for link loss and recovery along with the next IP event. Then repeat from cold power. It’s common to find that a setup works after a reset but fails when all rails rise from zero. With PoE, record whether the switch reports detection or power, and whether the board cycles when additional loads are enabled. These are different faults. Ethernet reconnect, driver reinitialisation and board reboot should also be different things in your serial log. If your project also uses a wireless path, test that path under the real workload before relying on it as a fallback. ESP32-C6 coexistence measurement guide.

If the cable also supplies all the board’s power, pulling it can turn off the whole board. For that setup record a cold boot and time to the next lease after plugging in. To test link loss while the ESP32 stays up, use a manufacturer-supported external power setup or a data-side interruption that leaves the PD powered. Keep the two tests separate in the log. Otherwise a cold boot and an Ethernet reconnect might look like the same thing on a dashboard.

Compare the traffic your device actually sends

A 100 Mb/s status means the PHY and switch negotiated that line rate. A W5500 on a 10 MHz SPI clock shifts one bit per clock per signal line while a transfer is active, before transactions, headers or gaps. The ESP32 still does protocol and application work in the MACRAW setup. RMII avoids the SPI host link, but task scheduling, DMA buffers, your protocol and the peer still affect what arrives. A networked sensor sending a few bytes once a minute and a camera moving frames all day stress different parts of the path.

For a repeatable comparison use the same local receiver, switch and workload. Count delivered bytes over a measured interval and keep timeouts and reconnects. Record the negotiated speed, SPI clock if applicable, and whether Wi-Fi, a screen or storage was active. Time each direction that matters. To calculate goodput in decimal Mb/s, use delivered payload bytes times eight, divided by elapsed seconds and then by one million. Use payload bytes the receiver actually got, not the amount you queued. Skip the frame-rate or goodput ranking until you have measurements for the boards you’re comparing.

One simple test is to send the same fixed-size binary payload to a local receiver over TCP and check the receiver got it intact. Repeat with the traffic reversed. Start the measurement at the same point each time, for example after establishing the connection. Count connection time separately if it matters for your application. For an MQTT sensor, a stream of large writes might be irrelevant. Replay the expected message size and interval, then add a short burst like the one you’ll see after a reconnect. Keep the number of messages that arrived and how long the slowest few took. That’s the result you need if the device has to report an alarm within a particular time.

Compare CPU and supply conditions alongside the data rate. Starting a camera or running Wi-Fi can change both. For PoE, check whether the quiet board and the loaded board still behave the same on the long cable you intend to install. If you change the network hardware and the power source in the same comparison, record both changes. It’s easy to build an apparent advantage into the setup by giving one board a local supply and sharing another board’s supply with a relay.

I’d use the W5500 for a small build that already has an S3 and a free SPI bus. I’d use a proven RMII board where I specifically want the original ESP32 and its internal MAC. For a permanent single-cable node, I’d choose the powered board and isolation first, then bring up whichever Ethernet interface the board provides. In any of these cases, make a clean boot, a proper lease and a reconnect part of the test before the board goes in its case.

CONTINUE EXPLORING / ESP32 & ELECTRONICS

Read next

Practical guides related to this article.

Explore the topic →
HARDWARE DECISION GUIDEWhich ESP32 board should you use?

Compare practical options before you choose hardware.

Compare options →