Technical Details
M-DUINO PLC Arduino Ethernet & GPRS 57AAR I/Os Analog/Digital/Relay PLUS GPRS
BACK TO THE PRODUCTInitial 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 1.8.6:
Inputs & Outputs
ANALOG INPUTS
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.
Inputs:
(14x) Analog (0-10Vdc) /Digital (5-24Vdc) configurable by software.
Know more about Analog Inputs.
TYPICAL CONNECTION
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.
Digital Inputs provides us PNP input.
Inputs: (10x) Digital Isolated (5-24Vdc), (5x) can work like interrupt INT (7-24Vdc).
Know more about Digital Inputs.
TYPICAL CONNECTION
- Digital Isolated Input
- Digital No Isolated Input
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.
Inputs: (5x) Interrupt Inputs (7-24Vdc). “Can work like Digital Input (24Vdc)”.
Interrupt | Arduino Mega Pin | M-Duino Pin |
INT1 | 3 | I0.6/INT1 |
INT2 | 19 | I1.6/INT2 |
INT3 | 18 | I1.5/INT3 |
INT4 | 21 | I2.1/INT4 |
INT5 | 20 | I2.0/INT5 |
- I0.6 also as Pin3 enables Interrupts turning ON the switch number 4 of down communication switch.
- I1.5 and I1.6 also as Tx1 and Rx1. Enable Interrupts turning ON the switches number 1 and 2 of up communication switches.
- I2.0 and I2.1 also as SCA and SCL. Enable Interrupts turning ON the switches number 3 and 4 of up communication switches. In this case you won’t be able to use I2C.
TYPICAL CONNECTION
In this example we activate INT1 using pin I0_6 from M-duino board. When there’s a change
#define INTERRUPT I0_6 //other pins: I2_6, I2_5, I1_6, I1_5 (M-Duino) I0_0, I0_3, I0_2, I0_1 (Ardbox) 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; }