Use STONE HMI display To Create Refrigerator Controls
With the continuous improvement of technology, our home appliances are more and more functional and easier to use.
As an electronics enthusiast, I am interested in the control of home appliances.
Our fridge is not possible with any of the man-machine interface, but if there is a refrigerator with human-machine interface, let users can through the touch screen operation, control of refrigerator on the lower cooling efficiency, display the current the temperature inside the refrigerator, display the current indoor and outdoor temperature, and some feedback on the usage of refrigerator (days running, filter life, etc.), so, it is very convenient and practical for users.
So today I'll simply use a touch screen to make a refrigerator control interface.The displayer is STONE STVC050WT-01.
STONE STVC050WT - 01 is an intelligent HMI display module in 5 inches, 480 * 272 resolution. On the module has been integrated display and touch screen driver, developers need only on the official TOOL 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.
Go to the official website for more information：https://www.stoneitech.com/support/download/software
Make UI display interface
UI pictures are designed by Photoshop. Since the screen is 480*272, the resolution of the designed picture should be consistent with the screen.The design effect is as follows:
Create the project in the TOOL software
Put a new project into STONE STVC050WT-01 development software TOOL, then pour in the designed UI picture, add corresponding buttons and display text, and the effect is as follows:
There are few controls, only digital text display controls, incremental adjustment controls, but these two controls are enough to complete the required function.
1. The upper part of the UI interface is the relevant control of the refrigerator freezer, showing the current temperature, working power of the refrigerator, and the key operation to adjust the power. The "Fast" button means that the power is set to maximum with one click.
2. The middle part of the UI interface is the relevant control of the refrigerator, showing the current temperature, working power of the refrigerator, and the key operation to adjust the power. The "Fast" button means that the power is set to maximum with one click.
3. Below the UI interface are some state displays, through which users can intuitively see the number of days the refrigerator has been running, filter element life, outdoor temperature and indoor temperature.Single-chip communication
The text widget
With MCU communication related content, we need to make clear the display screen and MCU communication mechanism and data source.
STONE STVC050WT-01 communicates with single chip through a serial port.
Previously, when we were making UI, we used display controls. The display data of these display controls was actually saved at some address of the flash of STONE STVC050WT-01.
Here we will show the temperature, the temperature data is form a temperature sensor, the temperature sensor is connected to the single chip microcomputer, so when the single chip microcomputer temperature data collected, only need to put the temperature data through a serial port to the address on this display control, temperature data can be displayed on screen in real time.
Instructions for writing data can be found in the STONE STVC050WT-01 specification.
This instruction represents writing 0x00 and 0x04 to the address 0x0020 in the data storage area: 0xA5 0x5A 0x05 0x82 0x00 0x20 0x00 0x04
Here I use single-chip code to achieve the following:
After the serial port screen is connected by the single chip microcomputer, the serial port of the single chip microcomputer sends this instruction, and the data above 0x0020 address of the serial port screen can be modified, and this address is the temperature display of our refrigerator.
The same is true for all other places where data is displayed, just change the address of the data.button
We used a lot of buttons in this project
Adjusting the refrigeration power of the refrigerator actually changes the value in the address of the middle display control, so we can read the address data of this display control regularly with a piece of code in the single-chip microcomputer. The instructions to read the address are as follows:
0xA5 0x5A 0x03 0x83 0x00 0x22
This instruction means to read the value of 0x0022, and in this project, it means to read the refrigeration power of the refrigerator after user adjustment, and then the single-chip microcomputer controls the peripheral device to make corresponding actions. The single-chip microcomputer code is as follows:
When we need to read display controls the data above, only need to register to read the instruction, through the MCU send instruction to the serial interface screen, serial interface screen will return relevant register data to the microcontroller, MCU receives the data will be ready to do the corresponding control devices, we here is to control the refrigeration power of the refrigerator.
Running state includes:
1. Operation days
2. Filter element life
3. Outdoor temperature
4. Indoor temperature
To obtain these data, in addition to the first, the other three need the the corresponding sensor to collect these data.
Filter element lifetime acquisition sensor and temperature sensor are required respectively.
When the single-chip microcomputer collected these data, through the serial port to the designated display control address transmission data, the value of the display control on the corresponding change.
Running days can be implemented in two ways:
1. Use the RTC of STONE STVC050WT-01 serial port display screen to display data directly on the screen
2. Use the single chip microcomputer's RTC to transfer data to the serial port screen for display
The STONE STVC050WT-01 serial port display comes with the RTC, which can be found in the STONE in development guide.operation effect