Skip to main content

Use Arduino based PLC by Industrial Shields

In this article, we will introduce the Arduino based PLC (programable logic controller), (ARDBOX IS.AB20AN.base). If you would like to know more about this company or products, please read here and here.

About ARDBOX IS.AB20AN.base

title
General view of ARDBOX IS.AB20AN.base

This is Arduino Leonardo based PLC and need a supply voltage of 24Vdc. It has 20 ports, half of them are for inputs and the other half are for outputs.

Functuions

title

Surface A of ARDBOX IS.AB20AN.base

(a) Use micro USB and arduino IDE to load programs onto Arduino. 

(b) POWER LED turns on when PLC is connected to the computer or power supply.

(c) When a port is turned on, corresponding LED is also turned on.

title

Surface B of ARDBOX IS.AB20AN.base

(d) You can input the signal from both sensor and communication port. Communication function is enabled by switching "communication switch" to OFF depending on the ports and methods of communication.

(e) You can use SPI,、RS485、RS232、ISC communication.

(f) Port I0.0 only supports digital input (in the picture, we think that the port printed as I0.1(-) is a misprint and actually I0.0(-) ) . Ports I0.1-I0.9 support both analog input (0-10Vdc) and PNP digital input (24Vdc).

 title

Surface C of ARDBOX IS.AB20AN.base

(g) Ports Q0.7-Q0.9 only support PNP digital output, and port Q0.6 supports analog and PWM output. Other ports like Q0.0-Q0.5 support analog output(0-10Vdc), digital output(24Vdc) and PWM(24Vdc).

(h) For ports Q0.0-Q0.5, you can switch the voltage and waveform of output signal. When you use analog output(0-10Vdc), switch voltage and waveform to ON, and when you use digital output(24Vdc) and PWM(24Vdc), switch both to OFF.

You can get pin layouts and user manual from "Document files" of this page, and basic method of input and output is explained at the blog by Industrial Shields.

※ There are 2 types of digital signals, PNP(OFF when No-load) and NPN(ON when No-load). You should be careful which signal your sensor's output is. 

Example

We assembled the demo that stops and restarts the motor by detecting the approaching object. It represents the transportation system and by applying this program, we think that we will be able to control multiple belt conveyers by detecting the place of object (controls the timing of the start of the next conveyer and stopping the previous).

title

Hardwares

We use photo interrupter to detect the object and ARDBOX IS.AB20AN.base to change the motor driving mode. We use attachInterrupt() of port I0.0 (port2 of Arduino Leonardo) to create the program that would change the mode by the sensor voltage decreasing. By taking into account that it needs higher voltage to start the motor, we prepared 3 motor driving mode "Start", "Continuous", "Stop" and change the output voltage.

Watch the following video to learn more.

The program is as follows.

int Q01 = 11;//output
int I00 = 2;//interrupt input

int Vmotor = 2 ;//voltage of motor rotating
int Vinit = 4; //volage of motor starting
int Vs = 24; //supply voltage

int vol_init = map(Vinit, 0, Vs, 0, 255);
int vol = map(Vmotor, 0, Vs, 0, 255);
int mode = 2;//mode 2>Stars 1>Continuous 0>Stop

int waittime = 2000; //wating time for restart

void setup() {
pinMode(Q01, OUTPUT);
pinMode(I00, INPUT);
attachInterrupt(1, motorstop, FALLING);
}
void loop() {
if (mode == 2) {//start & restart
analogWrite(Q01, vol_init);
delay(20);
mode = 1;
} else if (mode == 1) {//continuous
analogWrite(Q01, vol);
delay(15);
} else {//stop
analogWrite(Q01, 0);
delay(waittime);
mode = 2;
}
}

void motorstop() {//mode change when voltage falling HIGH>LOW 
mode = 0;
}

Make sure you use the free online HTML cleanup tool to avoid bad HTML tag practices on your website.

szkm has not written a bio yet…
DesignSpark Electrical Logolinkedin