ARDUINO ETHERNET

Introduction

Using Arduino with Ethernet is a great option for connecting the Arduino board to the Internet in a few minutes. It provides the fastest and reliable connectivity to the IoT devices. There are Ethernet shields that can extend Arduino features, like the Arduino Ethernet Shield for standard Arduinos, or the Arduino MKR ETH Shield for MKR devices. There are also external modules that can be plugged into any microcontroller, like the ENC28J60 module.

In this documentation, we cover how to connect devices over Ethernet by using both approaches, the default Arduino Ethernet Shields, and the external ENC28J60 module.

Arduino Portenta H7 Ethernet

Portenta H7 simultaneously runs high-level code along with real-time tasks. The design includes two processors that can run tasks in parallel. For example, it is possible to execute Arduino compiled code along with MicroPython code, and have both cores communicate with one another. The Portenta functionality is two-fold, it can either be running like any other embedded microcontroller board or as the main processor of an embedded computer.

H7's main processor is the dual-core STM32H747, including a Cortex® M7 running at 480 MHz and a Cortex® M4 running at 240 MHz. The two cores communicate via a Remote Procedure Call mechanism that allows calling functions on the other processor seamlessly.

Arduino Portenta H7

Arduino Opta Ethernet

The Arduino Opta is designed for industrial automation, offering robust performance and reliability. It features a dual-core STM32H747 microcontroller, which includes a Cortex® M7 running at 480 MHz and a Cortex® M4 running at 240 MHz. This configuration enables Opta to handle complex real-time tasks and high-level code execution concurrently.

With its versatile architecture, the Opta supports running Arduino sketches alongside MicroPython, allowing developers to leverage the strengths of both programming environments. The dual-core setup facilitates inter-core communication via Remote Procedure Call, ensuring smooth and efficient coordination between the two processors. This capability makes the Arduino Opta ideal for advanced automation systems, where precise control and rapid response are crucial.

Additionally, the Arduino Opta is equipped with industrial-grade features, such as enhanced I/O capabilities and robust connectivity options. It can be seamlessly integrated into existing industrial networks, providing a reliable solution for monitoring and control applications. Whether used as a standalone microcontroller or as part of a larger embedded system, the Opta's performance and versatility make it a valuable asset in any industrial setting.

Arduino Opta Wifi

Arduino with Ethernet Shield

Arduino Ethernet Shield

This example will allow connecting the Arduino device with the Ethernet Shield to the cloud platform in a few lines. The arduino_secrets.h file just needs to be modified with the relevant information.

Arduino with ENC28J60

The ENC28J60 is a very cheap Ethernet controller that can be used with our Arduinos to extend their connectivity. The main advantage of this controller is that it is inexpensive, as this module costs a few dollars. The bad news is that all the TCP/IP stack, DNS features, and so on, must run in the microcontroller itself, so there is not enough space in stock Arduinos for building our program. This way, for integrating the thinger.io libraries in the sketch, it would be necessary to disable the DHCP protocol (which uses UDP under the hood) and assign a manual IP address. If this is suitable for a project, or if a compatible microcontroller with more resources (such as ESP8266, Teensy, STM32F, etc.) is available, then this module can be a great option.

ENC28J60 Ethernet Module

There are some libraries for managing these boards, but we will use UIPEthernet, as it provides a standard interface that is compatible with the stock Thinger libraries.

This example will allow connecting a device using the ENC28J60 interface to the cloud platform in a few lines using the WiFi interface. The arduino_secrets.h file just needs to be modified with the relevant information.

Last updated

Was this helpful?