Professional Documents
Culture Documents
Profibus DP Communication Between Arduino and PLC
Profibus DP Communication Between Arduino and PLC
by tuenhidiy
Today, I would like to share how an Arduino communicates with PLC via Pro bus-DP connection. With this result, we
can carry out some projects with the combination of PLC and Arduino plus its extension shields at low cost, for
examples:
Control and data acquisition to / from PLC with BLYNK on smart phone via Arduino Mega + Ethernet
Shield + RS485 module. Normally, in order to connect Industrial Ethernet, the Siemens PLC must
have built-in communication module, such as 6ES7315-2EH14-0AB0 ..., or be equipped with a
separated communication module, like CP343, CP443.... With video below, Arduino will take over the
roles of Ethernet connection and exchange data with PLC through Pro bus protocol.
//www.yout ube.com/embed/iVDJNI1NFIQ
Turn sensors such as PIR Motion Sensor, SRF05 Ultrasonic Distance Sensor, MPU6050 Accelerometer
and Gyroscope Sensors.... into Pro bus devices that can be connected to industrial automation
system. Video below shows that PLC can read value of ultrasonic distance sensor to switch on/o 24V
relays.
//www.yout ube.com/embed/ldc0fT3E-TY
D.I.Y a HMI touchscreen to control /monitor PLC system through Touch Screen TFT LCD Module. As
video below, 3.2 inches touchscreen LCD can communicate with PLC via Pro bus and control 4 x 24V
relays as well as display temperature value collected from PLC.
//www.yout ube.com/embed/mXwYgITPQlM
In terms of cost, with some testings above, we will save a lot of money because the price of industrial
communication module or industrial touchscreen HMI are very expensive. In addition, we can extend Input and
Output of PLC through Pro bus - DP interface. It means that Arduino can works similar to Siemens DP/DP Coupler
I hope this project will inspire you, especially the students who don't have much money, to come up with ideas for
combining electronic and automation elds together, with low price.
Module RS-485.
I. S O FT WARES:
Arduino IDE.
§ . https://www.felser.ch/pro bus-manual/index.html
§ . https://www.pro bus.com/
Learn about * .GSD le to con gure Arduino into Siemens PLC hardware system.
Step 3: PROFIBUS–DP
Arduino Mega 2560 can communicate with PLC S7-300 by RS-485 (M AX4 8 5 ) module through Pro bus protocol as
schematic below:
Here below are some schematics that I have tried for this project:
This assembly work is for schematic 2 in previous step - Smartphone Blynk PLC via Arduino Mega 2560 + Ethernet
Shield + RS485 Module.
Soldering adapter shield for Arduino Mega 2560 includes Ethernet Shield and RS-485 Module.
Installation Ethernet Shield and RS-485 Module on Adapter Shield. Plugging this Adapter Shield on
top of Arduino Mega 2560.
In Simatic Step 7 program (HW CONFIG), we have to install *.GSD le and update your Hardware
Catalog using the menu command "O pt io ns - - > Upda t e ca t a lo g ".
void myTimerEvent()
{
Blynk.virtualWrite(V8, temperature);
}
BLYNK_WRITE(0)
{
if (param.asInt())
{
Control_State[0]=1;
}
else
{
Control_State[0]=0;
}
}
BLYNK_WRITE(1)
{
if (param.asInt())
{
Control_State[1]=1;
}
else
BLYNK_WRITE(2)
{
if (param.asInt())
{
Control_State[2]=1;
}
else
{
Control_State[2]=0;
}
}
BLYNK_WRITE(3)
{
if (param.asInt())
{
Control_State[3]=1;
}
else
{
Control_State[3]=0;
}
}
BLYNK_WRITE(4)
{
if (param.asInt())
{
Control_State[4]=1;
}
else
{
Control_State[4]=0;
}
}
BLYNK_WRITE(5)
{
if (param.asInt())
{
Control_State[5]=1;
}
else
{
Control_State[5]=0;
}
}
BLYNK_WRITE(6)
{
if (param.asInt())
{
Control_State[6]=1;
}
else
{
Control_State[6]=0;
}
}
BLYNK_WRITE(7)
{
if (param.asInt())
{
Control_State[7]=1;
}
else
{
Control_State[7]=0;
}
}
Profibus-DP Communication Between Arduino and PLC: Page 16
}
§ . When push buttons are touched, the button statuses (ON / OFF) will be written to the Arduino Mega 2560 via
Ethernet Shield and be stored in transmitted bu er.
§ . Arduino Mega 2560 will transmit these button statuses to PLC S7-300 via Pro bus communication (RS-485
module). At PLC side, as hardware con guration in previous step, button statuses will be received at PLC's input I0.0
~ I0.7.
§ . PLC's output Q124.0 ~ Q124.7 will switch ON or switch OFF 24V relays according to the status of I0.0 ~ I0.7.
CO LLEC T AND DIS PL AY T EM PERAT URE DATA RECEIVED FRO M PLC US ING BLYNK
Since I do not have temperature sensors like Thermocouples, PT-100..., I have simulated the temperature data
acquisition from the PLC by sending back status values of push buttons received from Blynk. Temperature value is
sent at PLC's output PQB0 (Q0.0 ~ Q0.7) via Pro bus protocol.
Step 8: PICTURES
The images above are results of 3 experiments that I have done for this project, including:
PLC read Ultrasonic Distance Sensor SRF05 via Arduino Mega 2560 + RS485 Module.
D.I.Y a HMI touchscreen to control /monitor PLC system via Arduino Mega 2560 + 3.2" Touch Screen
TFT LCD + RS485 module.
Control and data acquisition to / from PLC with BLYNK on smart phone via Arduino Mega + Ethernet
Shield + RS485 module.
As information from PROFIBUS & PROFINET Industrial Internet of Things (IIoT) eld by an Arduino.
International (PI) - a large automation community, it And once the Arduino can communicate with the PLC/
has about 1,700 manufacturer members and over 60 industrial automation system via Pro bus - DP, we can
million PROFIBUS nodes installed worldwide. do lots of cool things.
This is just an initial primitive experiment, but it’s THANK FOR YOUR WATCHING !!!
great if we can implement a PROFIBUS network in an
the code is not clear ,can you attach it ?