PLC HMI based on the Arduino Mega & 5 inch TFT touchscreen

(Last Updated On: July 6, 2020)



PLC HMI based on the Arduino Mega & TFT touchscreen- In this project, we are going to control the Fatek PLC 14-FBS using Arduino Mega, and a 5 inch TFT touch screen. We will be designing our own GUI “Graphical User Interface” application for the 5 inch TFT Touch Screen. The control signals to the PLC will be given through this GUI application consisting of 6 buttons. Using this GUI application 6 loads can be controlled connected with the outputs of Fatek PLC.

In this tutorial, you will also learn how to use Arduino Mega and PLC together. The control signals from the Arduino Mega are transferred to the PLC inputs through SPDT type relays. This is not an industrial level project, because this is not the actual PLC HMI system. But, this project can help you to learn how to make a GUI application and then how to use this application to control a PLC. This project will also help you understand, how relays are connected with the PLC inputs and outputs. This is an ideal project for electrical and electronics engineering students. This project can be used as the final year engineering project.

Without any further delay, let’s get started!!!

Amazon Purchase Links:

Fatek PLC, FBs-14MAR2-AC (FBs-14MA)
Fatek PLC programming Cable:
ITDB02 Arduino mega shield 2.1:
5 Inch TFT LCD Touch Screen:
Arduino Uno:
Mega 2560:

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

PLC HMI System:

PLC HMI, PLC and HMI these are two different technologies combined together to make an advanced level industrial monitoring and control system. PLC stands for “Programmable Logic Controller” and HMI stands for “Human Machine Interface”.

PLC HMI system is used to monitor and control different industrial processes on a Touch Screen. An HMI is simply an Interface; HMI is a very broad term that can include industrial computers, office equipment, MP3 players and household appliances. PLC HMI systems are very famous as it provides a visual representation of a monitoring and control system. The HMI system eliminates the need for a computer-based SCADA system. You can use the HMI touch screen to control anything you want.

The terms like Automation, HMI, PLC, and SCADA are not new; a tremendous amount of work has already been done on these different technologies, each one has its own advantages and disadvantages. For example,

If we use a computer-based SCADA monitoring and control system then we will need a computer or laptop. This way the PLC can be controlled from a supervisory control room, it is easy to operate and the PLC SCADA application programming can be easily modified. Computer-based PLC control and monitoring system have only one disadvantage that is it cannot be used with the machine on site.

The PLC HMI systems are a bit expensive and the programming is a bit complex, but its major advantage is that it can be fixed on the machines. This way the entire machine can be monitored and controlled using the PLC HMI touchscreen. It eliminates the use of long cables and wired buttons.

HMI (Human Machine Interface) is exactly what the name implies; a graphical user interface that allows humans and machines to interact. As I said earlier, in this project, I am not going to make an advanced level PLC HMI control system the ones used in industries, but I will be teaching you how to design a very basic GUI application for the TFT touch screen which can be used with the Arduino Mega to control a PLC.

Types of HMI Systems:

There are mainly three basic types of HMIs.

  • The Pushbutton replacer
  • The Data Handler and
  • The Overseer.

Long before the invention of HMI technology, the PLC control system might consist of hundreds of pushbuttons for controlling different processes. The HMI pushbutton replacer streamlined manufacturing processes, centralizing all the functions of each button into one location. In this project, I will be focusing on the pushbutton or permanent button replacer, which makes this control system purely digital. There will be no serial communication between the Arduino Mega and PLC but I will be using relays for the control signals.

SOFTWARES used in this Project:

  • WinProLadder for PLC programming.
  • C programming for touch screen HMI, GUI application designing.
  • Cadsoft eagle for Schematics and PCBs designing.
  • Proteus for simulation.

5 inch TFT touch screen:


The 5 inch TFT Touch Screen 800×480 comes with a mega shield which perfectly sets on the Arduino Mega.


This shield is not provided with the female headers due to which it cannot be connected with other electronic devices.


But we can solder connection wires which can be then connected with other electronic components; in my case, I will connect these wires with the Relays.

I soldered jumper wires with the Mega pins 13, 12, 11, and 10. If you want you can solder more wires as per your requirements.

This 5 inch TFT shield sets perfectly on the Arduino Mega2560 occupying all the pins, so that’s why I soldered these jumper wires with the TFT shield.


Now we are done with the 5 inch TFT touch screen shield and it can be used with the Touch screen. The wires soldered can be used to control the relays.


Now let’s have a look at the complete circuit diagram. For the easy understanding, I have separated the Arduino Mega3560 side from the PLC.

PLC side Circuit Diagram:


12v relays are connected with the PLC outputs Y0, Y1, Y2, Y3, and Y4. As I am going to control electrical loads using 12v relays so that’s why I connected C0 and C1 with 12v. One side of the relay coils are connected with the GND, while the other sides are connected with the PLC outputs Y0…Y4. The PLC inputs X0 to XN will be connected with the Mega2560 relay module.

Mega2560 side Circuit Diagram:


As you can see 6 relays are connected with the Arduino Mega2560. The number of relays can be increased or decreased as per the requirement.

Relays can be controlled through a low voltage signal and can be used to control high power circuit with a lower power circuit. To make a relay Operate, first of all, we will have to energize the relay coil by simply passing the current through the relay coil. Most of the relays which are available in the market are 12v and 24v. I will be using 12v relays. 12v relay cannot be directly controlled by the controller, that’s why electromechanical relays need a driver circuit. A driver circuit simply consists of an NPN or PNP type transistor and a resistor. It depends on the designer whether he/she wants to use the PNP or NPN type transistor. I will be using a NPN transistor. For the Driver circuit to design, first of all we find the relay coil resistance using a digital multimeter. The relay voltage is already known which is12v. Then by using the ohms law

V = IR

V = 12

R= 375 ohms ( we checked the resistance of the relay coil using a digital multimeter)

I =?

I = V / R

I = .032 amps

I = 32 milliamps

After finding the relay coil current then select any general-purpose NPN type transistor who’s collector current is greater than the relay coil current. In my case, I will use a 2n2222 NPN transistor because it is cheap, easily available in the market and moreover it can handle more current than the calculated value which was 32ma.

A 10k resistor is connected with the base of the 2n2222 NPN transistor as it’s a BJT bipolar junction transistor and it’s a current-controlled device so that’s why a 10k resistor must be added to limit the current.

Arduino Mega2560 and PLC together:

The Arduino Mega2560 is connected with the PLC inputs X0 to Xn through the relays discussed above. Follow the following steps.

  • Connect +24v from the PLC with the common pins of all the relays which are connected with the Arduino Mega.
  • Now connect the normally open legs of all the relays with the PLC inputs X0 to Xn.

Now, these relays can be used to give a 24v input signal to the PLC. These relays will be controlled through the 5 inch TFT HMI touch screen.

To make the interfacing simple I designed my own relay modules



Download PCB layout: relay module

Interfacing Arduino Mega HMI touch screen with PLC:


In the picture you can see, the Arduino Mega2560 and 5 inch TFT HMI touch screen is used to control the relays which are connected with the PLC inputs. Other relays are connected at the output side which is used to control the electrical loads.

If you have never used the 5 inch TFT touch screen then I highly recommend read my previous articles, in which I have explained all the basics. You can find links in the related projects section given at the end of this article.

Arduino Mega2560 5 inch TFT HMI touch screen Programming:

Before you start the programming, first of all, download the libraries used in this project. This is the same program that I have used in my previous tutorials; you can find links in the related projects section given at the end.

PLC ladder logic diagram:


As you can see the Ladder Logic programming used in this project is very simple. This program is developed using WinProLadder software. If you don’t know how to use the WinProLadder software then read my previous articles, in which you will learn about the extreme basics, installation, how to use the software, basic gates, timers and counters, etc.



Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply