Skip to main content

Use STONE HMI Make a Smart Home Control System

Project introduction




The following tutorial shows you how to use the STONE STVC050WT-01 touch display module to make a simple home appliance control system.

STONE STVC050WT - 01 the support touch display module is 5 inches, 480 * 272 resolution on the module has been integrated display and touch screen driver needed chips, developers need only on the STONE, the official VGUS design software related UI interface design and generate a programming file downloaded to the STONE display module, and then through a serial port (RS232 / RS485 / TTL) correspond with it, you can perform complex UI design aspects.

The process is as follows:


1.jpg



The following image shows some parameters of the STONE STVC050WT-01 display module:


3.jpg


This display module is just one of many in this line of products. There are many other display modules available in different configurations. www.stoneitech.com

STONE display module development three steps:




  1. Designed the UI with STONE TOOL softwareand downloaded the design file to the display module.
  2. MCU communicates with STONE display module through serial port.
  3. The MCU performs other actions based on the data obtained in step 

2.jpg

Today we made a simple home appliance control. Through Photoshop, I designed the following simple interface:



Function:

when the light button is pressed, the page jumps to 2, showing the switch state of three lights.When the on/off light button is pressed, the serial port of the screen module issues the switch signal protocol.The external MCU can send data directly to the screen module through a serial port. Let the screen display the light switch state directly.


New project with STONE Display



On STONE's website, we can download the latest version of TOOLS 2019 software, through which we can design the UI:




STONE TOOL is a GUI design software that requires no installation. After downloading, it can be directly opened and run by decompression. It should be noted that this software needs to be run in a compatible way on Windows8 and Windows10 systems



Since I'm using STVC050WT-01 with a resolution of 480*272 and the default Flash space size of 128Mbyte (expandable to 1024MByte), I've chosen 128Mbyte.

Set the project name and storage path, and click "OK" to complete.

Right-click the "Picture" directory and delete 0.jpg:

10.jpg



Add UI image in the STONE TOOLS:



Right-click the "picture" directory and add the two UI ICONS we have prepared to the project:


Add the word stock in STONE TOOLS




Right mouse click "Font file", select the appropriate Font to add to the project. Here I chose ASCII 24 by 48.

Add a button:




We need to set a function on the "Light" button in the first UI on the STONE TOOL software:

when we click the "Light" button, we will jump to the second page. How to do it?


Click the "Button" icon to draw the area of the Button:



The yellow area represents the button area that the user has drawn. Button properties are listed in the properties bar on the right of STONE TOOL software:

Just set the "pageswitch" option to 1 to switch to the second page when the button is pressed.



"Generating configuration file" in "Tool" and then "Virtual serial port screen".



Then we go ahead and change the arrow in the top left corner of page 2 to a button:




When the user presses this button, it returns to the first page.



Add text display:




Using the Text variable control, circle the white space after "light1" :




Then click the Text Variable just added, and the property interface will appear on the right of STONE TOOL software, mainly changing the following parameters:




Among them, "Variable memory addree" refers to the memory address where the displayed content is stored. One address can store two bytes. Our default display content is "OFF", which requires three bytes of memory space. This means that we store "OFF" in address 0020 and 0021.


A button with a return value:




The control we used above is "Button". This "Button" control does not return a value, which means that when the user presses the Button, the serial port of the display module does not send data to the MCU.

If the user pressed the button and wants the screen module to return data to the MCU, we can use the "return pressed key-value" control:



The property bar is set as follows:


Download the UI design file to the display module:




  1. Plug the USB flash drive into the computer
  2. Click the Download to u-disk button on the STONE TOOl

  1. Pull out the USB flash disk
  2. Insert the USB disk into the USB interface of the display module and wait for the completion of the upgrade. When the upgrade is completed, there will be a prompt sound
  3. tes

A serial port communication




Key-value return




After downloading the program to the display module, turn it on, connect the computer through the serial port via USB-TTL, press the light button of Light1, and return the serial port data: a55a 06 83 00 26 01 00 A8








Press the button to turn off the light

Serial data return: A5 5A 06 83 00 26 01 00 A9






A5 5A: frame header

06: instruction byte length, 83 00 26 01 00 A9 total 6 bytes (excluding data frame header)

83: read variable memory instruction

00 26: variable storage address

01: data word length, 00 A9, 1-word length (2 Byte)

00 A9: user data content, depending on the keys set.





Write register data




This instruction writes 55 aa to address 0x0020 in the data storage area:

0xA5 0x5A 0x05 0x82 0x00 0x20 0x55 0xaa

Since we've set Light1's text display storage address to 0x0020, writing data to this address using a serial port is equivalent to changing the content of Light1's text display box.





Read register data




The serial port sends the following command to the display module:

0xA5 0x5A 0x03 0x83 0x00 0x20

Represents the value of reading 0x0020, and in the change project, represents t he switch state of the read-lamp.


Comments

Popular posts from this blog

How to assemble LCD LCD screen correctly?

 Many devices in our lives will use LCD LCD screen, today to specifically analyze how to properly assemble LCD LCD screen, I hope to help you. LCD the tools assembled by the LCD screen are mainly hammers and wrenches, which are used to screw the frame foot. The order of assembly operation is to put all the tools and raw materials on the workbench in an orderly manner first. Second, the shell according to the process card instructions correctly placed on the worktable, if there is assembly tooling, as required on the tooling, pay attention to the shell direction to be correct. Next remove the protective film of the LCD screen, wipe the electrode with dust-free paper, confirm the direction, according to the process card instructions, correctly put into the shell. remove the circuit board, if you want to add a backlight, the backlight is first fixed on the PCB board. Align the circuit board to the frame position according to the process card. Load the housing to press the zebr

What is HMI and Why Use STONE HMI Display?

HMI is changing the way several industries are run now. It is a technology that automates several fields and improves productivity and efficiency on many levels. The merging of humans and machines through HMI is simply the next norm in industrial automation. Interested in finding out more about HMI? Read on to get a general overview of this technology. Also, we’ll introduce STONE HMI displays and why they’re among the leaders in HMI technology worldwide. Defining what HMI is HMI stands for Human Machine Interface. It consists of a dashboard allowing a person to manipulate and interact with a system, device, or machine. HMI is often regarded as the merger of humans and machines for better automation efficiency. HMI is also known as: Operator Interface Terminal (OIT) Man-Machine Interface (MMI) Local Operator Interface (LOI) Operator Terminal (OT) The HMI presents visual information regarding a system to the user. The person, in turn, can operate and control the