Skip to Content

ARDBOX Relay ARDUINO based PLC

Compact Arduino Leonardo based PLC for DIN rail with 10 inputs and 10 outputs, 8 of them relays, RS-485, RS-232, I2C and SPI, programmed with the Arduino IDE.

Original Arduino Leonardo inside, 45 mm wide.

I/O
10 inputs (6 analog 0-10 V), 10 outputs (8 relays, 2 analog/PWM)
Comms
RS-485, RS-232, TTL serial, I2C, SPI
Programming
Arduino IDE over micro USB
Power
12 to 24 Vdc, DIN rail, IP20
139.00 € 139.00 €

  • # CPU Type #
  • #CPU Type#
  • # Device #
  • # Inputs #
  • # Outputs #
  • NO_CPU
  • # LoRa #
  • # GPRS #
  • # Wifi & Bluetooth LE #
  • Communication board 1
  • Communication board 2
  • Communication board 3
  • Price
  • RS485
  • RS232
  • Serial TTL
  • µSD Card Socket
  • Additional Communications
  • Choose your predefined Switch Configuration
# CPU Type #: Arduino
#CPU Type#: Arduino Leonardo
# Device #: PLC
# Inputs #: 1-10
# Outputs #: 1-10
NO_CPU: Arduino Leonardo
# LoRa #: Yes
# GPRS #: Yes
# Wifi & Bluetooth LE #: Yes
Communication board 1: No Additional Com. Board 1
Communication board 2: No Additional Com. Board 2
Communication board 3: No Additional Com. Board 3
Price: 100-200€
RS485: Yes
RS232: Yes
Serial TTL: Yes
µSD Card Socket: No
Additional Communications: No Additional Communications


Ardbox Relay: compact Arduino PLC with 20 I/O and 8 relays

The Ardbox Relay is a compact industrial PLC from Industrial Shields built around an original Arduino Leonardo. It has 10 inputs (6 analog 0-10 V) and 10 outputs (8 relays, 2 analog/PWM) in a 45 mm DIN-rail housing, with RS-485, RS-232, I2C and SPI. It is programmed with the Arduino IDE, with no licence fees, and suits small projects that switch pumps, motors, lighting or HVAC loads directly.

Not sure this is the right model? Our engineers help you choose the controller and the options for your project.

Talk to an engineer

Technical specifications

MicrocontrollerArduino Leonardo (ATmega32u4, 16 MHz, 32 KB flash, 2.5 KB SRAM)
Inputs10: 6 analog/digital (0-10 V, 10-bit) and 4 digital optoisolated, 5 to 24 Vdc, 1 with interrupt
Outputs10: 2 analog/digital/PWM (0-10 V, 8-bit), 8 relays (230 Vac 4 A / 24 Vdc 2 A, resistive)
Serial and busesRS-485 (half or full duplex), RS-232, TTL serial, I2C, SPI
ProgrammingArduino IDE with the Industrial Shields boards package, micro USB
Power supply12 to 24 Vdc, fuse (2.5 A) and polarity protection
Dimensions and weight100 x 45 x 115 mm, 350 g max.
Environment0 to 60 °C operating, 10 to 90 % humidity without condensation
Mounting and protectionDIN rail TS35, IP20, inside a cabinet
ExpansionI2C expansion up to 127 elements. Wi-Fi & BLE, GPRS/GSM, LoRa and DALI versions in the family datasheets

Before you choose the Ardbox Relay

How do I program the Ardbox Relay?

With the Arduino IDE (1.8.0 or later). Install the Industrial Shields boards package from the Boards Manager, select the Ardbox board and upload through micro USB.

What can the relay outputs switch?

Each relay switches up to 4 A at 230 Vac or 2 A at 24 Vdc with a resistive load. For inductive loads, add an RC snubber sized for the load.

Ardbox Relay or Ardbox Analog?

Choose the Relay version to switch loads directly. Choose the Ardbox Analog if you need 0-10 V analog outputs or PWM to drive valves, drives or dimmers.

Does it have Ethernet?

No. The Ardbox communicates over RS-485 and RS-232. If you need Ethernet, look at the M-Duino or ESP32 PLC families.

Can it talk Modbus RTU?

Yes. Use the RS-485 port with the Industrial Shields Arduino libraries to work as Modbus RTU master or slave.

More product information

Arduino PLC Ardbox Relay: 20 I/Os with digital, analog and relay outputs

The Ardbox Relay is a compact industrial PLC based on the Arduino Leonardo. It offers 20 I/O points: 6 convertible analog/digital inputs (0 to 10 Vdc), 4 digital isolated inputs, one of them interrupt capable, 2 configurable digital/analog outputs and 8 relay outputs. It communicates over RS-485, RS-232, I2C and SPI, with no onboard Ethernet. It is built for small and medium automation projects where space is limited but reliability still matters.

Technical Specifications

SpecificationValue
Part NumberIS.AB20REL.HF+
Total I/Os20
Architecture1 layer (ArdboxRLayer)
MicrocontrollerArduino Leonardo
Inputs10
Convertible Analog/Digital Inputs (0 to 10 Vdc)6
Digital Isolated Inputs (5 to 24 Vdc)4
Interrupt Capable Inputs1
Outputs10
Digital/Analog Outputs (0 to 10 Vdc)2
Relay Outputs8 (220 Vac, 5 A)
PWM OutputNot available (Ardbox Analog only)
EthernetNo
RS-485 Ports2
RS-232 Ports1
SPIYes
I2CYes
RTCNo
MicroSD SlotNo
Power Supply12 to 24 Vdc
Max Power Consumption3.57 W
MountingDIN rail
CertificationsCE, RoHS

Applications: pump control, lighting and small automation

The Ardbox Relay is suited to projects that need to switch pumps, motors, lighting or other loads directly, without adding external relay modules. Typical uses include water pumping stations, small HVAC installations, lighting control and general purpose industrial automation.

Protocols: RS-485, RS-232, I2C and SPI

Communication runs over RS-485 (2 ports) and RS-232 (1 port), with I2C and SPI available for local peripherals. The board has no onboard Ethernet.

Programming: Arduino IDE with Industrial Shields libraries

Programmed via Arduino IDE with the industrialshields boards package. All I/Os are referenced by name (I0_x, Q0_x, A0_x, R1 to R8).

Initial installation

Arduino IDE

Arduino IDE is the Original platform to program Arduino boards. This cross-platform application is available on Windows, macOS and Linux and under the GNU General Public License. Arduino IDE supports C and C++ code structuring. Industrial Shields recommend using Arduino IDE to program Arduino Based PLC's, but any Arduino compatible software are compatible with Industrial Shields Controllers.

Apart from that, Industrial Shields bring the possibility to select your Arduino based PLC into your Arduino IDE and compile your sketches for the different PLC's.

Download the Arduino IDE:

Official Arduino IDE page

Install Industrial Shields units to Arduino IDE:

How to install Industrial Shields Boards

Power supply


All Arduino based PLC's can be powered between 12-24V. Ardbox family, have a consumption between 700mA and 1500mA.


So, the recommended power supply is 2A or higher. Any Industrial power supply will be a good choice to power supply them.

REMEMBER:
Out units are designed to be powered between 12-24V. Just powering them with the USB, the unit will not be able to perform their features. USB is just to program the PLC's not to power them.

If, for some reason, you would like to use a power supply lower than 1.5A, contact Industrial Shields technical support to ensure that your system will complete your functionalities without any power issue.


Next is shown a simple diagram to see how to power supply any Industrial Shields unit.

Ardbox Power Supply Diagram

Switch ARDBOX RELAY

Ardbox Relay has two different switch areas:

TOP Zone:

SWITCH

ON

OFF

1 - RS (RS485)

RS (RS485)

R8

2 - R8

R8

RS (RS485)

3 - RS (RS485)

RS (RS485)

R7

4 - R7

R7

RS (RS485)

RIGHT Zone:

SWITCH

ON

OFF

1 - NC

-

-

2 - HD-FD

HALF DUPLEX

FULL DUPLEX

3 - R5/SCL

R5

SCL

4 - I0.0/SDA

I0.0

SDA

1 - RE-RS485

RE-RS485

I0.4

2 - I0.4

I0.4

RE-RS485

3 - DE-RS485

DE-RS485

I0.5

4 - I0.5

I0.5

DE-RS485

Power consumption

Ardbox relay:


Current (mA)

Power (W)

Idle

31,83

0,76

Full workload

149

3,57

Inputs & Outputs

Analog inputs 

The analog inputs have a tolerance of 0 to 10 Vdc with 10 bits of resolution, they are also isolated and sharing the internal GND. In Digital and Analog I/O there's self insulation, so its posible to connect them in a different power supply than 24 Vdc. 

Ardbox Relay - Inputs: 6 Analog (0-10Vdc) configurable by Software.

  int IO2 = analogRead(I0_2);
  int IO3 = analogRead(I0_3);
  int IO4 = analogRead(I0_4);
  int IO5 = analogRead(I0_5);
  int IO6 = analogRead(I0_6);
  int IO7 = analogRead(I0_7);

Digital inputs

Voltage variation  from  –Vcc (or GND)  to  +Vcc, with no intermediate values. Two states: 0 (-Vcc or GND) and 1 (+Vcc).  In Digital and Analog I/O there's self insulation, so its posible to connect them in a different power supply than 24 V.  

Ardbox Relay - Inputs:  4 Digital Isolated (5-24Vdc).

  int IOO = digitalRead(I0_0);
  int IO1 = digitalRead(I0_1);
  int IO4 = digitalRead(I0_4);
  int IO5 = digitalRead(I0_5);

Interrupt inputs

Interrupt Service Rutine.  A mechanism that allows a function to be associated with the occurance of a particular event. When the event occurs the processor exits immediately from the normal flow of the program and runs the associated ISR function ignoring any other task. 

Ardbox Relay - Inputs:  (1x) Interrupt Inputs (5-24Vdc). “Can work like Digital Input (24Vdc)”.

Ardbox PinArduino Leornardo PinSwitch
I0.0 (INT1)2SDA/I0.0 at ON Position


In this example we activate INT0 using pin I0_0.

  #define INTERRUPT I0_0 // other pins: I0_3, I0_2, I0_1

  volatile bool state = false;

  void setup() {
    pinMode(INTERRUPT, INPUT_PULLUP);
    attachInterrupt(digitalPinToInterrupt(INTERRUPT), function_call_back, CHANGE);
  }

  void loop() {
    if (state == true){
      Serial.println("Interrupt activated");
      state = false;
    }
  }

  void function_call_back(){ //Change led state
    state = true;
  }

Analog outputs

Voltage variation  between  –Vcc (or GND)  and  +Vcc, can take any value. An analog input provides a coded measurement in the form of a digital value with an N-bit number.  In Digital and Analog I/O there's self insulation, so its posible to connect them in a different power supply than 24 V.  

Ardbox Relay - Outputs: 2 Analog 0-10V output, configurable by switch.

  analogWrite(A0_0, 255);
  analogWrite(A0_1, 10);

  // CONFIGURE THE RIGHT SWITCH WITH ALL OUTPUT AS ANALOG(OFF)
  analogWrite(Q0_0, 182);
  analogWrite(Q0_1, 30);

Digital outputs

Voltage variation  from  –Vcc (or GND)  to  +Vcc, with no intermediate values. Two states: 0 (-Vcc or GND) and 1 (+Vcc).  In Digital and Analog I/O there's self insulation, so its posible to connect them in a different power supply than 24 V. 

Ardbox Relay - Outputs:  2 Digitals (5 to 24Vdc). The Ardbox Relay does not provide PWM output; this feature is only available on the Ardbox Analog model.

  // CONFIGURE THE RIGHT SWITCH WITH ALL OUTPUT AS DIGITAL(ON)
  digitalWrite(Q0_0, HIGH);
  digitalWrite(Q0_1, LOW);

Relays

A relay is an electromagnetic switch controlled by an electric signal. In Industrial Shields units these devices are already integrated in their boards and can be accessible directly with the function digitalWrite(RX, HIGH). Industrial Shields relays are normally open and can handle a max current of 4A for max voltage 230Vac and 2A for a max DC voltage of 24Vdc.

Ardbox Relay

Ardbox Relay - Outputs:  8 Relay outputs (220Vac – 5A). (R1, .. , R8)

  // Opens the relay switch
  digitalWrite(R1, HIGH);
  digitalWrite(R2, HIGH);
  digitalWrite(R3, HIGH);
  digitalWrite(R4, HIGH);
  digitalWrite(R5, HIGH);
  digitalWrite(R6, HIGH);
  digitalWrite(R7, HIGH);
  digitalWrite(R8, HIGH);

  delay(500);

  // Close the relay switch
  
  digitalWrite(R1, LOW);
  digitalWrite(R2, LOW);
  digitalWrite(R3, LOW);
  digitalWrite(R4, LOW);
  digitalWrite(R5, LOW);
  digitalWrite(R6, LOW);
  digitalWrite(R7, LOW);
  digitalWrite(R8, LOW);

Communications

RS-485

 RS-485, also known as TIA-485(-A), EIA-485, is a standard defining the electrical characteristics of drivers and receivers for use in serial communications systems. The electrical signaling is balanced, and multi-point systems are supported.

Make sure you have your switches and jumpers configured properly before using this serial communication.

Example of use

Basic RS-485 write example (send):


// Include Industrial Shields libraries
#include 

//// IMPORTANT: check switches configuration

////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
  // Begin serial port
  Serial.begin(9600);

  // Begin RS485 port
  RS485.begin(38400);
}

////////////////////////////////////////////////////////////////////////////////////////////////////
void loop() {
  // Wait bytes in the serial port
  if (Serial.available()) {
    byte tx = Serial.read();

    // Echo the byte to the serial port again
    Serial.write(tx);

    // And send it to the RS-485 port
    RS485.write(tx);
  }
}

Basic RS-485 read example (receive):

// Include Industrial Shields libraries
#include 

//// IMPORTANT: check switches configuration

////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
  // Begin serial port
  Serial.begin(9600);

  // Begin RS485 port
  RS485.begin(38400);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void loop() {
  // Print received byte when available
  if (RS485.available()) {
    byte rx = RS485.read();

    // Hexadecimal representation
    Serial.print("HEX: ");
    Serial.print(rx, HEX);

    // Decimal representation
    Serial.print(", DEC: ");
    Serial.println(rx, DEC);
  }
}

Basic RS-485 full-duplex example:

// Include Industrial Shields libraries
#include 
//// IMPORTANT: check switches configuration
//// IMPORTANT: Full duplex mode is only available when device supports it
////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
  // Begin serial port
  Serial.begin(9600);
  // Begin RS485 port
  RS485.begin(38400, FULLDUPLEX);
}

////////////////////////////////////////////////////////////////////////////////////////////////////
void loop() {
  // Wait bytes from the RS-485
  if (RS485.available()) {
    byte tx = RS485.read();
    // In full-duplex mode it is possible to send and receive data
    // at the same time in a secure way
    RS485.write(tx);
    // Echo the byte to the serial port
    Serial.write(tx);
  }
}

* Remember that to test the full duplex with your Ethernet PLC you must connect the A, B (receivers) to the Y, X(transmitters).

RS-232

RS-232, also known as TIA-232-F, EIA-232-F, or V.24, is a standard for serial communication transmission of data. It specifies the voltage levels, signal timing, and data protocol for communication between devices.

 

Make sure you have your switches and jumpers configured properly before using this serial communication.

Example of use

Basic RS-232 write example

// Include Industrial Shields libraries
#include 
//// IMPORTANT: check switches configuration
//////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
  // Begin serial port
  Serial.begin(9600);
  // Begin RS232 port
  RS232.begin(38400);
}

///////////////////////////////////////////////////////////////////////////////////////////////
void loop() {
  // Wait bytes in the serial port
  if (Serial.available()) {
    byte tx = Serial.read();
    // Echo the byte to the serial port again
    Serial.write(tx);
    // And send it to the RS-232 port
    RS232.write(tx);
  }   
}

 Basic RS-232 read example

// Include Industrial Shields libraries
#include 

//// IMPORTANT: check switches configuration

//////////////////////////////////////////////////////////////////////////////////////////////

void setup() {

  // Begin serial port
  Serial.begin(9600);

  // Begin RS232 port
  RS232.begin(38400);

}

//////////////////////////////////////////////////////////////////////////////////////////////

void loop() {
  // Print received byte when available
  if (RS232.available()) {
    byte rx = RS232.read();

    // Hexadecimal representation
    Serial.print("HEX: ");
    Serial.print(rx, HEX);

    // Decimal representation
    Serial.print(", DEC: ");
    Serial.println(rx, DEC);
  }
}

I2C

I2C is a synchronous protocol that only uses 3 cables, one for the clock (SCL) and one for the data (SDA) and ground (GND). This means that the master and the slave send data through the same cable, which is controlled by the master, who creates the clock signal. I2C uses addressing to select slaves.

I2C is a serial communications bus. The speed is 100 kbit/s in standard mode, but also allows speeds of 3.4 Mbit/s. It is a very used bus in the industry, mainly to communicate microcontrollers and their peripherals in integrated systems, or to communicate integrated circuits that reside in a same PCB.

Make sure you have your switches and jumpers configured properly before using this serial communication.

Example of use

IMPORTANT:  Make sure to download the  Arduino based PLC boards  for Arduino IDE.

Simple example of scanning I2C:

#include 

void setup() {
  Wire.begin();
  Serial.begin(9600);
  while (!Serial); // Leonardo: wait for Serial Monitor
  Serial.println("\nI2C Scanner");
}

void loop() {
  int nDevices = 0;
  Serial.println("Scanning...");

  for (byte address = 1; address < 127; ++address) {
    Wire.beginTransmission(address);
    byte error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.print(address, HEX);
      Serial.println("  !");
      ++nDevices;
    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address, HEX);
    }
  }

  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  } else {
    Serial.println("done\n");
  }
  
  delay(5000); // Wait 5 seconds for next scan
}

SPI

SPI is a synchronous communication protocol bus that has a master-slave architecture. Slave devices cannot initiate communication, nor exchange data with each other directly. Only the master can&nbsp;select&nbsp;to which slave will communicate with through the&nbsp;SS (slave select) pin.

Example of use

// include the SPI library:
#include 

// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;

void setup() {
  // set the slaveSelectPin as an output:
  pinMode(slaveSelectPin, OUTPUT);
  // initialize SPI:
  SPI.begin();
}

void loop() {
  // go through the six channels of the digital pot:
  for (int channel = 0; channel < 6; channel++) {
    // change the resistance on this channel from min to max:
    for (int level = 0; level < 255; level++) {
      digitalPotWrite(channel, level);
      delay(10);
    }
    // wait a second at the top:
    delay(100);
    // change the resistance on this channel from max to min:
    for (int level = 0; level < 255; level++) {
      digitalPotWrite(channel, 255 - level);
      delay(10);
    }
  }
}

void digitalPotWrite(int address, int value) {
  // take the SS pin low to select the chip:
  digitalWrite(slaveSelectPin, LOW);
  // send in the address and value via SPI:
  SPI.transfer(address);
  SPI.transfer(value);
  // take the SS pin high to de-select the chip:
  digitalWrite(slaveSelectPin, HIGH);
}

Extra features

Direct Arduino Pins

If we want to use another Serial Port using your equipment, we can make use of some digital pins to create a Serial. The SoftwareSerial library has been developed to allow serial communication on other digital pins of the Arduino, using software to replicate the functionality. &nbsp;It is possible to have multiple software serial ports with speeds up to 115200 bps. A parameter enables inverted signaling for devices which require that protocol.

Only I/O 5V from Ardbox or M-Duino &nbsp;boards can be used.&nbsp;

M-Duino PinsLeonardo Pins
MISO14
MOSI16
SCK15


5VDC&nbsp;Signals

&nbsp;These pins can be programmed according to Arduino features such as I/Os operating at 5V or any additional features present in the pins.&nbsp;


&nbsp;&nbsp;&nbsp;&nbsp;I2C Pins – SDA/SCL:

The I2C protocol is meant to work in a pull-up configuration. In this case it reads 5V when nothing is connected.

&nbsp;&nbsp;&nbsp;&nbsp;SPI – MISO/MOSI/SCK:

These pins can only work as a 5V pins if the Ethernet protocol is not going to be used. As the Ethernet protocol uses the SPI to communicate with the Arduino board, both behaviours cannot happen at the same time as the Ethernet would not work.

&nbsp;&nbsp;&nbsp;&nbsp;Pin2/Pin3:

These pins are only referred to the inputs I0.5/I0.6. If the switch configuration is in OFF position the pins Pin 2/Pin 3 will be available.