Mduino
Mduino
1. Index
2. General Description M-DUINO FAMILY products ....................................................... 3
2.1. Mechanical dimensions ..................................................................................................... 4
3. Precautions.................................................................................................................. 4
3.1. Arduino Board ................................................................................................................... 4
3.2. Intended Audience ............................................................................................................ 4
3.3. General Precautions .......................................................................................................... 4
4. Specifications .............................................................................................................. 5
4.1. General Specifications: ...................................................................................................... 5
4.2. Performance Specification: ............................................................................................... 6
5. Before to connect:....................................................................................................... 7
5.1. Software interface ............................................................................................................. 7
5.2. How to connect PLC arduino to PC ................................................................................... 7
5.3. How to connect PLC to power supply ............................................................................... 8
6. M-duino 38R I/O Pinout: ........................................................................................... 10
6.1. A Zone connection .......................................................................................................... 10
6.2. A Zone top ....................................................................................................................... 11
6.3. B Zone.............................................................................................................................. 11
6.4. B Zone top ....................................................................................................................... 12
6.5. C Zone.............................................................................................................................. 12
6.6. C Zone top ....................................................................................................................... 13
7. I/O Pinout (summary pinout/ Arduino PIN): ............................................................. 14
8. Switch configuration ................................................................................................. 15
8.1 A Zone ................................................................................................................................... 15
8.2 B, C and D Zone ..................................................................................................................... 15
9. I/O technical details .................................................................................................. 16
10. Connector details .................................................................................................. 16
11. Connection type .................................................................................................... 18
11.1 Digital Inputs ................................................................................................................... 18
11.2 Analog (0-10Vdc) / Digital Inputs “configurable” ............................................................ 19
Analog configuration mode:................................................................................................ 19
Digital configuration mode: ................................................................................................ 20
11.3 Digital Outputs ................................................................................................................ 21
11.4 Analog (0-10Vdc) / PWM / Digital Outputs “configurable” ............................................ 22
Analog configuration mode:................................................................................................ 22
Digital configuration mode: ................................................................................................ 23
PWM configuration mode: .................................................................................................. 24
11.5 Relay Outputs .................................................................................................................. 25
12. Communication Pinout.......................................................................................... 26
13. Mechanical Characteristics ................................................................................... 27
14. Software Interface:................................................................................................ 28
2
Page
COMPACT PLC.
11 22 31
TOTAL Output points
Type of signals
* Analog/Digital
Input 10bit 4 8 12
(0-10Vcc)
* Digital Input (24Vcc) 6 12 18
* Interrupt Input HS 2 4 6
(24Vcc)
* Analog Output 3 6 8
(0-10Vcc)
* Digital Output (24Vcc) 4 6 8
1
10k pull-up resistance required (IS.ACI2C-4.7K)
Ref. 15.07.15_M-duino38R_User_Guide
2.1. Mechanical dimensions
3. Precautions
3.1. Arduino Board
All M-duino family products use Arduino MEGA Board.
Before using the product under conditions, which are not described in the manual or applying
Page
the product to nuclear control systems, railroad systems, aviation systems, vehicles,
Ref. 15.07.15_M-duino38R_User_Guide
combustion systems, medical equipment, amusement machines, safety equipment and other
systems, machines, and equipment that may have a serious influence on lives and property if
used improperly, consult your INDUSTRIAL SHIELDS representative.
Make sure that the rating and performance characteristics of the product are sufficient for the
systems, machines, and equipment, and be sure to provide the systems, machines, and
equipment with double safety mechanisms.
This manual provides information for programming and operating the Unit. Be sure to read
this manual before attempting to use the Unit keep this manual close at hand for reference
during operaion.
Warnings:
Unused pins should not be connected. Ignoring the directive may damage the
controller.
Improper use of this product may severely damage the controller.
Refer to the controller’s User Guide regarding wiring considerations.
Before using this product, it is the responsibility of the user to read the product’s User
Guide and all accompanying documentation.
4. Specifications
Power supply
DC power supply 12 - 24Vdc
voltage
Operating
DC power supply 11.4 to 25.4Vdc
voltage range
Power
DC power supply 30VAC max.
consumption
Power supply
24Vdc
External voltage
power supply
Power supply
700Ma
output capacity
Insulation resistance 20MΩ min.at 500Vdc between the AC terminals and the protective earth terminal.
2.300 VAC at 50/60 HZ for one minute with a leakage current of 10mA max. Between all
Dielectric strength
the external AC terminals and the protective earth terminal.
Ref. 15.07.15_M-duino38R_User_Guide
Ambient environment (operating) With no corrosive gas
Ref. 15.07.15_M-duino38R_User_Guide
5. Before to connect:
NOTE:
M-Duino Family use USB-B cable.
Ref. 15.07.15_M-duino38R_User_Guide
- Select correct port.
IMPORTANT:
Verify the USB port is detected:
- MDuino Family PLC are 24Vdc supplied. IMPORTANT: The polarity IS NOT REVERSAL!
- Make sure that the live and GND connector of the power supply match the PLC.
- Make sure that the power supply mains output is not higher than 24Vdc.
8
Page
Ref. 15.07.15_M-duino38R_User_Guide
- Suggested power suppliers
Ref. 15.07.15_M-duino38R_User_Guide
6. M-duino 38R I/O Pinout:
D ZONE
D ZONE
A ZONE
A ZONE
B ZONE
B ZONE
C ZONE
C ZONE
D ZONE
C ZONE
B ZONE
A ZONE
Arduino Pin
Connector
M-Duino
Function
Configuration Switch* (see section 12 for
Communications configuration.
Enabling Communications disable s some SCL 21 SCL
I/Os) SDA 20 SDA
RX0 1 RX0
TX0 0 TX0
RX1 19 RX1
TX1 18 TX1
RX2 17 RX2
Communication Pinout TX2 16 TX2
RX3/RE 15 RX3/RS485
TX3/DE 14 TX3/RS485
A - RS485
B - RS485
PIN3 3 Arduino Pin/
Power supply connectors Select SPI
(24Vdc – Gnd) 50 SO 50 SPI
51 SI 51 SPI
52 SCK 52 SPI
Reset Reset SPI
Vin5 Vin5 SPI
PIN2 2 Arduino Pin/
Select SPI
GND - Gnd
GND - Gnd
24Vdc
Base
(common unit)
A Zone Pin out function
Arduino Pin
Connector
M-Duino
Function
Ref. 15.07.15_M-duino38R_User_Guide
6.2. A Zone top
*NOTE: Autoreset. Arduino mega has auto reset when using serial communication code. Set switch to OFF when
using serial communication. When uploading code to Arduino Mega set switch to ON.
6.3. B Zone
B Zone
Arduino Pin
Connector
Relay Out M-Duino
Function 2
R0.8 37 Relay 0.8 Out
Configuration Switch* R0.7 38 Relay 0.7 Out
(see section 8 to select R0.6 39 Relay 0.6 Out
R0.5 40 Relay 0.5 Out
correct configuration for R0.4 24 Relay 0.4 Out
inputs).
B Zone
Connector
M-Duino
Arduino Pin
Function 2
Relay out
R0.3 25 Relay 0.3 Out
R0.2 22 Relay 0.2 Out
R0.1 23 Relay 0.1 Out
GND - Gnd
Q0.2 D4 Analog/ Digital Out
Q0.1 D5 Analog/ Digital Out
Q0.0 D6 Analog/ Digital Out Input Pinout
GND - Gnd
I0.5 A3 Analog/ Digital In
Output Pinout
I0.4 A2 Analog/ Digital In
I0.3 A1 Analog/ Digital In
I0.2 A0 Analog/ Digital In
I0.13 3 Digital In/ Interrupt 1
(-)I0.1 NC GND I0.1
I0.03 2 Digital In/ Interrupt 0
(-)I0.0 NC GND I0.0
11
Page
2
See section 8 to select suitable switch configuration for (10-24Vdc/An-Dig) configurable I/Os.
3
See section 8 to enable these connections.
Ref. 15.07.15_M-duino38R_User_Guide
6.4. B Zone top
6.5. C Zone
C Zone
Arduino Pin
Connector
M-Duino
Function 4
Relay Out
R1.8 42 Relay 1.8 Out
R1.7 43 Relay 1.7Out
R1.6 44 Relay 1.6 Out
R1.5 45 Relay 1.5 Out
R1.4 29 Relay 1.4 Out
Configuration Switch*
(see section 8 to select
correct configuration for
inputs).
C Zone
Connector
M-Duino
Arduino Pin
Function 2
4
See section 8 to select suitable switch configuration for (10-24Vdc/An-Dig) configurable I/Os.
5
See section 8 to enable these connections.
Ref. 15.07.15_M-duino38R_User_Guide
6.6. C Zone top
Ref. 15.07.15_M-duino38R_User_Guide
7. I/O Pinout (summary pinout/ Arduino PIN):
M-DUINO 57R IOs
Base
M-DUINO 38R IOs
(common unit)
M-DUINO 19R IOs
B Zone C Zone D Zone
A Zone
Arduino Pin
Arduino Pin
Arduino Pin
Connector
Connector
Connector
Arduino Pin
Connector
M-Duino
M-Duino
M-Duino
Function
M-Duino
Function
Function
Function
SCL 21 SCL R0.8 37 Relay 0.8 Out R1.8 42 Relay 1.8 Out R2.8 47 Relay 2.8 Out
SDA 20 SDA R0.7 38 Relay 0.7 Out R1.7 43 Relay 1.7 Out R2.7 48 Relay 2.7 Out
RX0 1 RX0 R0.6 39 Relay 0.6 Out R1.6 44 Relay 1.6 Out R2.6 49 Relay 2.6 Out
TX0 0 TX0 R0.5 40 Relay 0.5 Out R1.5 45 Relay 1.5 Out R2.5 NC NC
RX1 19 RX1 R0.4 24 Relay 0.4 Out R1.4 29 Relay 1.4 Out R2.4 34 Relay 2.4 Out
TX1 18 TX1
RX2 17 RX2
TX2 16 TX2
RX3/RE 15 RX3/RS485
TX3/DE 14 TX3/RS485
A - RS485
B - RS485
PIN3 3 Arduino Pin/
Select SPI
50 SO 50 SPI
51 SI 51 SPI
52 SCK 52 SPI
Reset Reset SPI
Vin5 Vin5 SPI
PIN2 2 Arduino Pin/
Select SPI
GND - Gnd
GND - Gnd
24Vdc
AREF AREF Arduino PIN R0.3 25 Relay 0.3 Out R1.3 30 Relay 11 Out R2.3 35 Relay 2.3 Out
IOREF IOREF Arduino PIN R0.2 22 Relay 0.2 Out R1.2 27 Relay 10 Out R2.2 32 Relay 2.2 Out
IOREF1 IOREF1 Arduino PIN R0.1 23 Relay 0.1 Out R1.1 28 Relay 9 Out R2.1 33 Relay 2.1 Out
7Vdc (out) +7Vdc - GND - Gnd GND - Gnd GND - Gnd
Gnd Gnd GND Q0.2 D4 An/ Dig/ PWM Q1.2 D8 An/ Dig/ PWM Q2.2 D12 An/ Dig/ PWM
3.3Vdc (out) +3.3Vdc Arduino PIN Out Out Out
Gnd Gnd GND Q0.1 D5 An/ Dig/ PWM Q1.1 D9 An/ Dig/ PWM Q2.1 D13 An/ Dig/ PWM
5Vdc (out) 5Vdc - Out Out Out
gnd gnd GND Q0.0 D6 An/ Dig/ PWM Q1.0 D7 An/ Dig/ PWM Q2.0 NC NC
Out Out
GND - Gnd I1.5 A9 Analog/ Digital I2.5 A15 Analog/ Digital
I0.5 A3 Analog/ Digital In In
In I1.4 A8 Analog/ Digital I2.4 A14 Analog/ Digital
I0.4 A2 Analog/ Digital In In
In I1.3 A7 Analog/ Digital I2.3 A13 Analog/ Digital
I0.3 A1 Analog/ Digital In In
In I1.2 A6 Analog/ Digital I2.2 A12 Analog/ Digital
I0.2 A0 Analog/ Digital In In
In I1.1 19 Digital In/ I2.1 21 Digital In/
I0.1 3 Digital In/ Interrupt 4* Interrupt 2*
Interrupt 1* (-)I0.1 NC GND I1.1 (-)I2.1 NC GND I2.1
(-)I0.1 NC GND I0.1 I1.0 18 Digital In/ I2.0 20 Digital In/
I0.0 2 Digital In/ Interrupt 5* Interrupt 3*
Interrupt 0* (-)I1.0 NC GND I1.0 (-)I2.0 NC GND I2.0
(-)I0.0 NC GND I0.0
*NOTE: Digital Inputs I0.0, I0.1, I1.0, I1.1 can be configured on Arduino IDE to be Interrupts.
3 Pin 3 Interrupt 1
2 Pin 2 Interrupt 0
Page
Ref. 15.07.15_M-duino38R_User_Guide
8. Switch configuration
8.1 A Zone
LEFT *IMPORTANT:
SWITCH CONFIG
Arduino LEFT ZONE. To enable communication connections the switchs
Pin OFF* ON
21 SCL - must be set to “OFF”. Set to “ON” position to enable I/Os PLC
20 SDA - connection. Communications and I/Os on the chart can not work
19 Rx1 I1.1 simultaneously. For exemple if Rx1 is enabled (OFF), I1.1 will not
18 Tx1 I1.0 work. OFF position provides direct connection to Arduino Pin (so
3 Pin 3 I0.1
2 Pin 2 I0.0 they can be programmed according to Arduino pin features).
Some I/Os can be configured as Analg/Digital and 10Vdc/24Vdc, the chart above summarizes the
positions for each type of configurable I/O.
LEFT SIDE
B ZONE
SWITCH CONFIG
Input ON OFF
Q0.2
Q0.1 10 24
Q0.0 Vdc Vdc
NC
SWITCH CONFIG
Q0.2
Q0.1
Analog Digital
Q0.0
NC
C ZONE
SWITCH CONFIG
Input ON OFF
Q1.2
Q1.1 10 24
Q1.0 Vdc Vdc
NC
SWITCH CONFIG
Q1.2
Q1.1
Analog Digital
Q1.0
NC
15
Page
Ref. 15.07.15_M-duino38R_User_Guide
9. I/O technical details
Maxim current
Signal Vdc
consumption
Analog 0-10Vdc
60mA
Relay 220V 8A
The connector inside the PLCs that mounts on the PCB is MC 0,5/10-G-2,5 THT – 1963502
from Phoenix contact. MC0,5/10-G-2,5THT
For I/O and power supply there is a FK-MC 0,5/10-ST-2,5 - 1881406 connector from Phoenix
contact. FK-MC 0,5/10-ST-2,5
16
Page
6
You can select 24Vdc or 10Vdc (with correctly switch configuration). Digital output will be 12Vdc If you
connect PLC to 12Vdc power supply
Ref. 15.07.15_M-duino38R_User_Guide
Connection details:
Height 8,1mm
Pitch 2,5mm
Dimension 22,5mm
Ref. 15.07.15_M-duino38R_User_Guide
11. Connection type
NOTE:
Ref. 15.07.15_M-duino38R_User_Guide
11.2 Analog (0-10Vdc) / Digital Inputs “configurable”
Analog configuration mode:
Switch configuration
(Select Analog position)
int I01 = A05; // select the Analog (0-10Vdc) / Digital (24Vdc)IN //**warning"" (if Analog selection connect 10Vdc MAX).
int I02 = A04; // select the Analog (0-10Vdc) / Digital (24Vdc)IN //**warning"" (if Analog selection connect 10Vdc MAX).
void setup() {
pinMode(I01, INPUT);
}
Void loop(){
value = analogRead(A5);
/* Lo que se quiera */ = digitalRead(I01);
}
19
Page
Ref. 15.07.15_M-duino38R_User_Guide
Digital configuration mode:
Switch configuration
(Select digital position)
int I01 = A05; // select the Analog (0-10Vdc) / Digital (24Vdc)IN //**warning"" (if Analog slection connect 10Vdc MAX).
int I02 = A04; // select the Analog (0-10Vdc) / Digital (24Vdc)IN //**warning"" (if Analog slection connect 10Vdc MAX).
void setup() {
pinMode(I01, INPUT);
}
Void loop(){
value = analogRead(A5);
/* Lo que se quiera */ = digitalRead(I01);
}
20
Page
Ref. 15.07.15_M-duino38R_User_Guide
11.3 Digital Outputs
Ref. 15.07.15_M-duino38R_User_Guide
11.4 Analog (0-10Vdc) / PWM / Digital Outputs “configurable”
Analog configuration mode:
Switch configuration
Select 10Vdc position switch
Select Analog position switch
int Q06 = 3;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
int Q05 = 5;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
void setup() {
pinMode(Q06, OUTPUT);
pinMode(Q05, OUTPUT);
}
22
Void loop(){
analogWrite(Q06, /*valor de una variable */);
digitalWrite(Q05, 125);
Page
Ref. 15.07.15_M-duino38R_User_Guide
Digital configuration mode:
Switch configuration
Select 24Vdc position switch
Select Digital position switch
int Q06 = 3;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
int Q05 = 5;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
void setup() {
pinMode(Q06, OUTPUT);
pinMode(Q05, OUTPUT);
}
Void loop(){
analogWrite(Q06, 254);
digitalWrite(Q05, HIGH); // Relay ON
// turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
analogWrite(Q06, 0);
digitalWrite(Q06, LOW); // Relay OFF
// turn the LED off (LOW is the voltage level)
}
23
Page
Ref. 15.07.15_M-duino38R_User_Guide
PWM configuration mode:
Switch configuration
Select 24Vdc position switch
Select Digital position switch
int Q06 = 3;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
int Q05 = 5;
// select the Analog (0-10Vdc) / PWM (10 OR 24Vdc) /Digital //(24Vdc)OUTPUT
void setup() {
pinMode(Q06, OUTPUT);
pinMode(Q05, OUTPUT);
}
Void loop(){
analogWrite(Q06, /*valor de una variable */);
digitalWrite(Q05, 125);
}
24
Page
Ref. 15.07.15_M-duino38R_User_Guide
11.5 Relay Outputs
Ref. 15.07.15_M-duino38R_User_Guide
12. Communication Pinout
In A Zone you can select different types of Arduino communication PINS:
LEFT ZONE. To enable communication connections the switchs must be set to “OFF”. Set to
“ON” position to enable I/Os PLC connection. Communications and I/Os on the chart can not
work simultaneously. For exemple if Rx1 is enabled (OFF), I1.1 will not work. OFF position
provides direct connection to Arduino Pin (so they be programmed according to Arduino pin
features).
For RS485 communication protocol the defined Arduino Mega pins are showed in the chart
below.
RS485 pinout
Function Arduino Pin
DI 10
RO 11
RE 15
DE 14
You have different options and accessories. M-Duino family products have direct Ethernet port
with RJ45 connector.
For I2C/RS232 communication, M-Duino family products are directly connected to Arduino
Mega Board. In order to implement this communication an accessory is required.
http://www.industrialshields.com/accesories
26
Page
Ref. 15.07.15_M-duino38R_User_Guide
13. Mechanical Characteristics
- Dimension M-duino Family:
- DIN rail mounting:
27
Page
Ref. 15.07.15_M-duino38R_User_Guide
14. Software Interface:
Arduino IDE is compatible for program these PLCs. You must to download a start code in
www.industrialshields.com at product page in “document files” section and then it’s necessary
open it with Arduino IDE.
All Ardbox PLCs use an Arduino Leonardo and you need to choose these opcion in Arduino IDE.
Ref. 15.07.15_M-duino38R_User_Guide