Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
Arduino Uno R3 Compatible with W5500 Ethernet and microSD Socket

Building a Reliable Arduino Ethernet Logger: W5500, DHCP and Shared SPI

A wired network can be a good fit for a fixed sensor logger, workshop monitor or classroom experiment. The cable removes wireless setup from the project, but reliable Ethernet still needs careful software and resource planning. A board that sends one successful message has passed a useful first test; it has not yet demonstrated that it can recover after the router restarts.

The PMD Way Ethernet-enabled Arduino collection includes an Uno R3-compatible board with W5500 Ethernet and a microSD socket. Its integration reduces wiring, while leaving the same important design questions about shared pins, power, memory and network recovery.

Know what the Ethernet controller handles

The W5500 communicates with the host microcontroller over SPI and implements Ethernet and several network protocols in hardware. WIZnet’s W5500 documentation describes its 10/100 Ethernet interface, IPv4 support and socket resources.

That hardware does not turn a small microcontroller into a general-purpose web server. Your sketch still constructs application messages, parses responses and manages its own memory. Ethernet link speed is not the same as the rate at which a small Arduino application can process data.

Nor does a TCP connection automatically provide encryption or authentication. Decide how your application will protect data and commands before connecting it beyond a controlled local network. An Ethernet controller alone is not a complete secure cloud client.

Make the shared SPI bus explicit

On the linked PMD Way board, the listing identifies D10 as the W5500 select and D4 as the microSD select. These are details of this board, not universal assignments for every Ethernet product. Confirm the revision before wiring additional hardware.

SPI devices can share clock and data signals while using separate chip-select lines. Every inactive device must remain deselected and release the shared return-data line as required. Initialise the select pins deliberately, including the storage device when you are not using it.

Test Ethernet with storage disabled first. Next test storage alone, then combine them. If each works individually but the pair fails, inspect select behaviour, bus settings and library support before replacing the hardware.

Choose a supported library and a small first test

The Arduino Ethernet library supports W5100, W5200 and W5500-based devices. Its practical connection limits also depend on the controller and the host’s available memory; the W5500’s hardware socket count is not a promise that every sketch can use that many connections.

Begin with an example supplied with your installed library. Confirm the select pin where the library permits configuration, then establish a connection to a known local service. Keep serial diagnostics concise: print the important stages and error conditions, rather than every byte indefinitely.

Record the library version and the working configuration. Do not start by combining code fragments written for several unrelated Ethernet libraries; similarly named methods can have different assumptions.

Plan addressing and DHCP renewal

Every device needs an appropriate network identity. Use its assigned MAC address where one is provided; otherwise follow a deliberate locally administered addressing scheme and ensure uniqueness on your network. Copying a demonstration address into several devices can cause intermittent problems.

DHCP simplifies initial configuration, but a long-running client must also maintain its lease. Arduino’s DHCP address-printer example demonstrates initial configuration and ongoing maintenance. Use it to understand the library’s expected lifecycle.

If you choose a static address, coordinate it with the network’s addressing plan. Record the subnet, gateway and DNS requirements. A locally reachable address does not prove that name resolution or access to another subnet works.

Design the logger around bounded work

Consider a temperature logger that samples once a minute and sends one record at a time. Give each record a sequence number and an explicit validity field. Decide what happens if transmission fails: retain a bounded number of records, write to storage or report a gap. Do not allow an unavailable server to consume memory indefinitely.

Set sensible timeouts for communication and close abandoned connections. Keep sample acquisition independent from lengthy retries where practical. After several failures, wait before retrying so that the device does not spend its entire time reconnecting.

A timestamp also needs a defined source. If the clock has not been set after startup, mark records accordingly rather than silently attaching a plausible-looking date. Store enough context to distinguish a missing sample from a failed upload.

Budget memory and storage writes

The linked board’s ATmega328P has limited RAM. Large text responses, display buffers and filesystem buffers compete with the rest of the sketch. Prefer short records and bounded parsing. Check the longest possible field, not merely the typical one.

For illustration, a 60-byte record collected every minute produces 86,400 bytes in a day before filesystem overhead. That arithmetic helps plan storage capacity, but it does not describe write latency or power-loss behaviour. Test both with the actual card and library.

Define when buffered data is committed and what a partially written final record looks like. A reader that can reject an incomplete record is easier to recover than a format that assumes every line is perfect.

Test the failures you expect to encounter

Useful acceptance tests for a local Ethernet logger
Test Expected behaviour to define
Unplug and reconnect the cable Sampling continues and communication eventually resumes.
Restart the DHCP server or router Addressing recovers without a manual reset.
Stop the receiving application Retries remain bounded and failed records are accounted for.
Fill or remove storage The logger reports the condition instead of pretending to save.

Finally, use the intended power supply and enclosure during an extended test. The product listing does not claim Power over Ethernet support, so do not assume the network cable powers this board. A reliable logger results from documented recovery behaviour as much as from a successful first packet.

Previous article Arduino and ESP8266 on One Board: Plan Firmware, Serial Routing and Wi-Fi Recovery
Next article Getting Started with a SAMD21 Zero-Compatible Board: Debugging, USB and Pin Planning