Android HMI development- control HMI touch screen using Bluetooth “TFT touch screen”

(Last Updated On: October 19, 2019)

Android HMI development

Description:

Android HMI development– In this Tutorial, you will learn how to control a 5 inch TFT HMI touch screen wirelessly using Hc-05 or Hc-06 Bluetooth module and an android cell phone. This is a dual control system, the relays can be controlled using the HMI touch screen and can also be controlled using your android cell phone.

Android HMI development

Any load which is turned on using the HMI touch screen can be turned off using the cell phone application, and any load which is turned on using the android cell phone application can also be turned off using the HMI TFT touch screen.

Android HMI development

With the help of this project “Android HMI development” you can also monitor the sensor values on the screen and also in the application.



Android HMI development

Android HMI development project is entirely based on my previous three tutorials. In first tutorial I created one button to control an led and display the on time of a controller in seconds. In this tutorial I covered all the basic functions.

In the second tutorial I converted two images and then displayed those images on the LCD. This tutorial is really important and explains how Pictures can be displayed on the HMI TFT touch screen.


While in the third tutorial I combined the techniques used in the first two tutorials, the sensor values as you can see on the screen are actually the images which I converted; in the second tutorial, I explained the image conversion in very detail.

 So I highly recommend before you start working on the Android HMI development project you should watch my previous three tutorials otherwise you won’t be able to make this project. For the detailed discussion and explanation watch video tutorial given at the end. Without any further delay, let’s get started!!!


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Nodemcu esp8266 wifi module: Best price https://amzn.to/2NAvmiB
Bluetooth Module: Hc-05: https://amzn.to/2CMHNiN
ITDB02 Arduino mega shield 2.1: https://amzn.to/2o1uJ2l
5 Inch TFT LCD Touch Screen: https://amzn.to/2MzbAAa
Potentiometer: https://amzn.to/2JSLbfg
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

DISCLAIMER:

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!

 

This Android HMI development Project is the modified version of the project which I explained in third tutorial. As you can see the GUI application is exactly the same, I am using the same relay module and the same variable resistor. In this project I made only three changes.

  1. I added a Bluetooth module with serial port 3.if you don’t know how to use the hc-05 or hc-06 Bluetooth module, then you should watch my getting started tutorial on how to use the Bluetooth module, in which I explained everything in very detail, like for example, how to change the name of the Bluetooth module, how to change the pin code or password etc. You can find this in the related projects section given at the end.
  2. I made a very little change in the controller programming, so that I can communicate with the HMI touch screen using my android cell phone. So in this project I will not explain the entire program, because I have already explained this program in my third tutorial on HMI touch screen. But I will explain the changes which I made.
  3. I fixed all the components on the hard board.


Circuit Diagram of the relay module used in Android HMI development Project:

Android HMI development

This is the circuit diagram of the relay module, if in case you want to make your own Relay module; otherwise you can purchase a readymade relay Module, Rest of the connections are already explained in my previous tutorials. Watch all the three tutorials given above.



Programming of the HMI Touch Screen:

Android HMI development Program Explanation:

Once again I want to tell you, if you didn’t watch my previous three tutorials, then stop over here, first watch those tutorials and then you can resume from here. As you can see it’s a very long program, but trust me it’s really easy, and I am not going explain each and every instruction, because all of the functions used in this program, I have already explained it in my previous three tutorials. Now let me show you the changes which I made. One more thing; make sure you use the higher version of the Arduino IDE, I am using 1.6.5 version.

All the variables, buttons co ordinates and functions are exactly the same I didn’t make any changes. The first change which I made was in the void setup function. I activated the Serial port 3, as my Bluetooth module is connected with serial port 3 and as you can see 9600 is the baud rate. So this is the only change which I made in the void setup function.


In every button function I added serial3.println function to send the devices on and off information to the android cell phone application, as you can see for button1 I am sending device1 on , and device1 off and so On for the remaining buttons. The advantage of adding this instruction is that, when you press the button on the HMI touch screen it also send the information to the android cell phone application. This way you can know if someone turns on or turns off any load.

Then I made another change to send the sensor value to the android application. Now here comes the most important change.

if(Serial3.available()>0)  if the mega has received data on serial port3 then simply read the serial port 3 and store the value in bdata. Bdata is a variable which is already defined above. Then we simply compare the value stored in bdata with the value which is stored in password1. If both are equal then we simply execute these instructions. These instructions are exactly the same which are used in the button functions, so I am using the same exact instructions. Because, I want to change the caption on the buttons. So when I press a button in my cell phone application, this way It can change the button caption on the HMI touch screen.  So this way on the HMI screen you can control the writing on buttons from ON to OFF or from OFF to ON . I am doing the same exact thing for all the buttons.


Download Program and all the needed things:control hmi tft touch screen using android cell phone

Watch Android HMI development Tutorial:

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

Close