EN
CN

STONE HMI DISPLAY APPLICATION IN NEW ENERGY FIELD SOLAR CHARGING

 

STONE HMI solar charging

 

Solar energy is the energy generated by the continuous nuclear fusion reaction process inside the sun, while solar power generation panel is the tool to convert solar energy into electricity. During the conversion process, we generally focus on the following parameters:

A. Output voltage of solar panels

B. The output voltage of the circuit protection device, that is, the real output voltage of the output terminal

C. Conversion efficiency

According to the above information, we can use the uart touch screen of STONE to make a human-machine interface to display the power generation of solar panel and charging of lithium battery in real time.

 

 

The HMI display is as follows

 

1. Display the power generation voltage of the solar charging panel through the STONE display module

2. Display lithium battery voltage through the STONE display module

3. The charging efficiency is shown by the STONE display module

In practical application, there may be more parameters to pay attention to, but since I am not from this major, I only pay attention to the above three parameters.

 

 

What hardware modules are needed?

 

We will probably need the following five hardware modules:

1. Solar charging panel

2. STONE STVI070WT-01 serial touch display module

3. Arduino UNO development board

4. Lithium battery charging board

5. Lithium battery

 

 

Solar modules purchased

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(1)

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(2)

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(3)

 

 

STONE STVI070WT-01 HMI display module description

 

In this project, I intend to use the screen STONE STVI070WT-01 to display the relevant parameters of solar charging.

This display has been integrated with a driver chip, and an upper computer can be used by users. Users only need to add the designed UI pictures to the upper computer through buttons, text boxes, and other logic, and then download the generated configuration files into the display screen to run.

STVI070WT-01 communicates with MCU through UART-rs232 signal, which indicates that we need to add a MAX3232 chip to convert RS232 signal into TTL signal to communicate with Arduino's MCU.

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(4)

 

 

If you are not sure how to use the MAX3232, please refer to the following pictures

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(5)

 

If you think the level conversion is too cumbersome, you can use other models of the STONE display, some of which can output uart-ttl signals directly.

Website has detailed information and introduction: https://www.stoneitech.com/

Video tutorials and tutorials are also available on the website.

 

 

How do I develop the STONE HMI display module?

 

There are three main steps in the development of the STONE HMI display module:

A. designed the display logic and button logic with STONE TOOL software and downloaded the design file to the display module.

B. MCU communicates with the STONE LCD display module through the serial port.

C. With the data obtained in step 2, the MCU takes other actions.

Of course, these also require the premise of designing a nice UI, usually in JPEG format.

 

 

Use the STONE TOOL software

 

Download the latest version of STONE TOOL (currently TOOL2019) from the web site and install it.

After the software installation is completed, the following interface will be displayed when opening the software:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(6)

 

Click the "File" button in the upper left corner to create a new project.

 

 

Arduino development environment

 

The Arduino development environment is an Arduino IDE that you can download over the network.

https://www.arduino.cc/en/software

After installing the Arduino IDE, By default, the Arduino IDE creates two functions for us: the setup function and the loop function.

There are also many introductions about Arduino on the network, if you do not understand you can directly go to the network to find.

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(7)

 

 

How to use STONE TOOL software?

 

First, we need to design a UI picture in Photoshop. The following interface is a very simple UI picture I designed in Photoshop:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(8)

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(9)

 

 

STONE TFT LCD display data

 

Once you've designed the UI to display the image, save it as JPG.

Open the STONE TOOL2019 software and create a new project:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(10)

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(11)

 

Remove the default loaded images from the new project, and then add the UI images that we designed ourselves.

 

 

Add a data text component

 

We need to collect 3 data in total, so we need to add 3 data text display components:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(12)

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(13)

 

The "Property setting" on the right is the Property setting for the component. The location, size, name, initial value, data length, component address, and so on are all set here.

What needs to be explained here is the component address. Each component has its own component address. The component address shown in the figure is 0x0133.

This is determined by the component address.

The specific properties of the component are described as follows:

 

X coordinates: the X coordinates the position of the component across the UI

Y coordinates: the y-direction position of the component in the overall UI

Width&Height: width and length of the component

Moving lock: fixed position

Name define: the Name of the component

Variable memory address: the component's address

Initial value: the Initial value of the component

Integer digits: how many digits (ones, tens, hundreds, etc.) are displayed

Decimal digits: whether the Decimal point is displayed

Text color: the color of Text

FONT0 ID: font selection

Based on our actual requirements, we added three digital display components and then changed the properties as needed.

 

 

Simulation

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(14)

 

First click "1", then click "2", you can see the running effect on the computer.

 

 

Modified baud rate

 

The display supports the modification of the UART baud rate, which is set in the following interface:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(15)

 

The maximum baud rate is 921600, in this case, I'm using 115200.

Modifying the baud rate is actually modifying the values of R1, R5, and R9 registers in the STONE HMI display module:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(16)

 

R5 and R9 are invalid when the value of R1 is 0x00-0x10.

When R1 is 0x11, the baud rate is determined by R5 and R9.

But we don't have to worry about that, just know that the maximum baud rate is 921600.

 

 

Generate configuration files

 

After the above UI interface design is completed, you can generate the configuration file, and then download the configuration file to the STVI070WT-01 display screen. This part of the operation is described in the STONE development materials.

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(17)

 

Perform step 1 first, and then insert the USB flash drive into the computer. The disk symbol will be displayed. Then click "Download to u-disk" to Download the configuration file to the USB drive.

In addition, if you can't use the USB drive to upgrade, you can also directly connect the USB interface of the computer and the Micro USB of STONE STVI070WT-01.

 

Then click download online and follow the instructions to update the configuration file to the STONE display module.

 

 

Arduino

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(18)

 

To use Arduino UNO's development board for the solar charging simulation experiment is likely to need several functions:

ADC acquisition function

UART function (baud rate 115200)

 

 

Arduino peripheral driver code

 

First, we need to get the component address of the STONE display:

In my project, the address is as follows:

Input voltage display component address: 0x0133

Conversion efficiency display component address: 0x0135

Address of lithium battery voltage module: 0x0137

If you need to change the display content of the corresponding space, you only need to send data to the corresponding address of the display through the Arduino serial port to change the display content.

There is a sample ADC in Arduino's standard library:

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(19)

 

The sample code is as follows

 

/*

AnalogReadSerial

 

Reads an analog input on pin 0, prints the result to the Serial Monitor.

Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).

Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

 

This example code is in the public domain.

 

http://www.arduino.cc/en/Tutorial/AnalogReadSerial

*/

 

// the setup routine runs once when you press reset:

void setup() {

// initialize serial communication at 9600 bits per second:

Serial.begin(115200);

}

 

// the loop routine runs over and over again forever:

void loop() {

// read the input on analog pin 0:

int sensorValue = analogRead(A0);

// print out the value you read:

Serial.println(sensorValue);

delay(1); // delay in between reads for stability

}

 

With a few modifications based on this example, the test of the STONE serial touch display module solar charging can be done.

 

 

Arduino sends data to be displayed in the STONE HMI display module

 

The following instruction represents writing 00 04 data to address 0x0020 of the data storage area:

0xA5 0x5A 0x05 0x82 0x01 0x33 0x00 0x04

0xA55A: data frame header

0x05: length of valid data, starting at 0x82

0x82: write register instructions

0x0133: write the video memory address

0x0004: data to be written

All you need to do is a program in Arduino and send data in this format to the STONE HMI display module.

 

 

Connection diagram

 

4-STONE-HMI-DISPLAY-APPLICATION-IN-NEW-ENERGY-FIELD-SOLAR-CHARGING-1(20)