---
title: "Profibus-DP Communication Between Arduino and PLC"
url: "https://maker.wiznet.io/gonmei/projects/profibus-dp-communication-between-arduino-and-plc/"
markdown_url: "https://maker.wiznet.io/gonmei/projects/profibus-dp-communication-between-arduino-and-plc/md"
type: "UCC: User Created Content"
author: "tuenhidiy"
author_url: "https://www.instructables.com/Profibus-DP-Communication-Between-Arduino-and-PLC/"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "tuenhidiy"
original_url: "https://www.instructables.com/Profibus-DP-Communication-Between-Arduino-and-PLC/"
published: "2022-11-29"
language: "en"
hardware: ["Arduino Mega 2560", "Arduino Ethernet Shield", "M5Stack RS485 to TTL Unit"]
likes: 2
views: 632
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Profibus-DP Communication Between Arduino and PLC

> Profibus-DP Communication Between Arduino and PLC

Original author: tuenhidiy (source: https://www.instructables.com/Profibus-DP-Communication-Between-Arduino-and-PLC/)

## Components

- **Arduino Mega 2560** x 1 ([docs](https://www.farnell.com/datasheets/1674878.pdf?_ga=2.12759806.871556650.1519619484-654667508.1508905608&_gac=1.209399078.1518779130.EAIaIQobChMI97my66Sq2QIV77ftCh01kgA_EAMYASAAEgKPyvD_BwE))
- **Arduino Ethernet Shield** x 1 ([docs](https://docs.arduino.cc/retired/shields/arduino-ethernet-shield-without-poe-module))
- **M5Stack RS485 to TTL Unit** x 1 ([docs](https://docs.m5stack.com/en/unit/rs485))
- Software: **Arduino IDE** ([docs](https://www.arduino.cc/en/software))
- Software: **Blynk** ([docs](https://blynk.io/))

## Documents and links

- [SCHEMATICS](https://maker.wiznet.io/_lib/download.asp?path=project/7453&downfile=sc%2Ejpg) (schematics)

## Article

how an Arduino communicates with PLC via Profibus-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 Profibus protocol.

[Embedded media](https://www.youtube.com/embed/iVDJNI1NFIQ?enablejsapi=1&origin=https://www.instructables.com)

- Turn sensors such as PIR Motion Sensor, SRF05 Ultrasonic Distance Sensor, MPU6050 Accelerometer and Gyroscope Sensors.... into Profibus devices that can be connected to industrial automation system. Video below shows that PLC can read value of ultrasonic distance sensor to switch on/off 24V relays.

[Embedded media](https://www.youtube.com/embed/ldc0fT3E-TY?enablejsapi=1&origin=https://www.instructables.com)

- 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 Profibus and control 4 x 24V relays as well as display temperature value collected from PLC.

[Embedded media](https://www.youtube.com/embed/mXwYgITPQlM?enablejsapi=1&origin=https://www.instructables.com)

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 Profibus - DP interface. It means that Arduino can works similar to Siemens DP/DP Coupler Module to connect two Profibus - DP networks together. And this DP/DP Coupler’s price is also very expensive. We can refer to their prices as follows:

- [Communication Module CP343-1 Lean.](https://www.ebay.com/itm/Siemens-CP343-1-Lean-ERTEC-6GK7343-1CX10-0xe0-New-factory-sealed/174031252627?epid=141092418&hash=item2885122c93:g:n0QAAOSwKVJdfeA7)

- [HMI Siemens TOUCH PANEL TP177B.](https://www.ebay.com/itm/1PCS-Siemens-HMI-6AV6-642-0DC01-1AX1-6AV6642-0DC01-1AX1-New-In-Box/283246221197?_trkparms=aid%3D555018%26algo%3DPL.SIM%26ao%3D1%26asc%3D60710%26meid%3D153feeb872c84c89827dea5ed72c4e9e%26pid%3D100005%26rk%3D3%26rkt%3D12%26mehot%3Dpf%26sd%3D233364300343%26itm%3D283246221197%26pmt%3D1%26noa%3D0%26pg%3D2047675&_trksid=p2047675.c100005.m1851)

- [Siemens DP/DP Coupler Module.](https://www.ebay.com/itm/1PC-New-Siemens-DP-DP-Coupler-Coupler-Module-6ES7-158-0AD01-0XA0-Fast-Ship/312566084808?epid=166810609&hash=item48c663f4c8:g:zwMAAOSwCN5crHuN)

Main parts for this project:

- [Siemens CPU314C-2DP](https://www.ebay.com/itm/Siemens-6ES7314-6CG03-0AB0-6ES7-314-6CG03-0AB0-CPU314C-2DP-E-St-02-NEUWERTIG/202782385901?hash=item2f36c5a6ed:g:atcAAOSwd-5dg4eY) or other Siemens CPU with Profibus port.

- [Arduino Mega 2560.](https://www.banggood.com/Geekcreit-MEGA-2560-R3-ATmega2560-MEGA2560-Development-Board-With-USB-Cable-Geekcreit-for-Arduino-products-that-work-with-official-Arduino-boards-p-73020.html?cur_warehouse=CN&rmmds=search&p=N9060056344195202101&custlinkid=1412828)

- [Arduino Ethernet Shield.](https://sea.banggood.com/Ethernet-Shield-Module-W5100-Micro-SD-Card-Slot-For-UNO-MEGA-2560-Geekcreit-for-Arduino-products-that-work-with-official-Arduino-boards-p-908461.html?p=N9060056344195202101&custlinkid=1419895)

- [Module RS-485](https://sea.banggood.com/10Pcs-5V-MAX485-TTL-To-RS485-Converter-Module-Board-p-1152561.html?p=N9060056344195202101&custlinkid=1419943).

- [TFT LCD TouchScreen 3.2".](https://sea.banggood.com/Multifunctional-Durable-Multifunction-Handle-Tool-Wire-Stripper-Stripping-Pliers-p-983170.html?p=N9060056344195202101&custlinkid=1419967)

- [Shield LCD 3.2" Arduino Mega 2560.](https://sea.banggood.com/3_3V-TFT-LCD-Adjustable-Shield-Expansion-Board-Mega-2560-R3-3_2-p-1306876.html?p=N9060056344195202101&custlinkid=1419977)

- Some [24V relays](https://www.ebay.com/itm/20-X-Schneider-24v-Switching-Relays-RXM2AB1BD-With-8-Pin-Relay-Socket-RXZE2S108M/133155032602?hash=item1f00a88e1a:g:eOcAAOSwRABdaC1w), [profibus cable](https://www.ebay.com/itm/Cable-6XV1-830-0EH10-SIMATIC-NET-Profibus-31m-S-6498/183851603188?hash=item2ace68d4f4:g:Qb8AAOSwbX9dAPqd), [profibus connectors](https://www.ebay.com/itm/Siemens-Profibus-Bus-Connector-6ES7972-0BB12-0XA0-6ES7972-OBB12-OXAO-Brand-New/323452624101?epid=1802769416&hash=item4b4f475ce5:g:hvsAAOSw5cNYWjON)...

## **Step 2: PREPARATION BEFORE STARTING THIS PROJECTI. SOFTWARES:**

- [SIMATIC STEP 7 V5.6/ SIMATIC STEP 7 V5.6 PROFESSIONAL.](https://support.industry.siemens.com/cs/document/109761679/step-7-v5-6-sp1-step-7-professional-2017-sr1-trial-download?dti=0&lc=en-WW)

- [Arduino IDE.](https://www.arduino.cc/en/main/software)

- [Blynk on smartphone.](https://blynk.io/)

- Arduino library for TFT LCD includes: [UTFT](http://www.rinkydinkelectronics.com/library.php?id=51), [URTouch](http://www.rinkydinkelectronics.com/library.php?id=92), [UTFT_Buttons](http://www.rinkydinkelectronics.com/library.php?id=61)

**II. REFERENCE MANUALS:**

- Arduino's UART, Timer.

- [PLC Siemens S7-300.](https://support.industry.siemens.com/cs/search?search=CPU%2031xC&type=ProductSupport%2CExampleOfUse%2CCatalog%2CCertificate%2CCharacteristic%2CDownload%2CFaq%2CManual%2CProductNote%2CDownloadSoftwareArchive%2CSlk%2CForum&lc=en-AO)

- Profibus manuals:

**§.**<https://www.felser.ch/profibus-manual/index.html>

**§.**<https://www.profibus.com/>

## **Step 3: PROFIBUS–DPI. PROFIBUS-DP:**

Profibus was created in 1989 by the German government in cooperation with several manufacturers of automation equipment. It is a messaging format specifically designed for high-speed serial I/O in factory and building automation applications. It is an open standard and is recognized as the fastest Fieldbus in operation today.

The PROFIBUS DP network is based on an RS485 physical layer and the European standard EN-50170. The DP suffix refers to “**Decentralized Periphery**”, which is used to describe distributed I/O devices connected via a fast serial data link with a central controller.

For more details about Profibus, you need to read the [this documentation](https://www.felser.ch/profibus-manual/index.html) from Max Felser.

**II. GSD FILE:**

The GSD file is an electronic device datasheet or device database file that identifies the Profibus device. All Profibus devices (class 1 masters and slaves) have their own GSD files. GSD stands for "**General Station Description**". It is an ASCII text file that contains device-specific data, such as, vendor identification information, supported baud rates, supported message length, number of input/output data, meaning of diagnostic messages, timing information, plus options and features supported, data formats, and available I/O signals.

In order to commercialize Profibus devices, the manufacturers of automation devices have to registry the Ident Numbers for each device and it is also contained in this *.GSD file. You can check at: <https://www.profibus.com/products/ident-numbers/>

And refer to the *.GSD file of Siemens DP / DP coupler module at [this address](https://support.industry.siemens.com/cs/document/113602/profibus-gsd-files-%3A-link?dti=0&lc=en-WW).

---

Source: https://maker.wiznet.io/gonmei/projects/profibus-dp-communication-between-arduino-and-plc/
