STONE LCD Arduino Esp8266 Cooler

Post your circuits and ideas here
Post Reply
Message
Author
Brayden
Posts: 12
Joined: 01 Jul 2021, 22:54

STONE LCD Arduino Esp8266 Cooler

#1 Post by Brayden » 27 Mar 2022, 00:57

It is known that the cooling machine is widely used in the industry. In this paper, I will show you how to use STONE HMI LCD as the display to combine the temperature sensor with Arduino esp8266 cooler application; the communication between the temperature sensor and Arduino esp8266 is realized by single line communication, and the communication mode between esp8266 and stone intelligent display is serial communication.
The block diagram and principle of the whole application are as follows:



This time, the function of the cooler is divided into automatic mode and manual mode. In the automatic mode, the temperature threshold can be set on the STONE TFT LCD screen. We can obtain the current ambient temperature through the DS18B20 sensor and then compare it with the set temperature threshold. When it is higher than the current ambient temperature range, esp8266 starts the stepper motor as a cooling function, and we can also stop the cooling through the stop button; in the manual mode, we can use the STONE TFT LCD directly sets the rotation speed and rotation times of the cooling motor. After the setting is completed, click the start button. Similarly, you can click the stop button to stop in advance.
Let’s start with the rendering:



In terms of device selection, this application needs to use a temperature sensor to detect the environmental temperature change. An esp8266 is used as the main control, a stepping motor, and an LED indicator. The most important is the STONE TFT LCD screen, which is used to communicate with the MCU.

Device List
DS18B20*1;
Esp8266 module * 1;
LED lamp * 3;
Stepper motor * 1;
STONE TFT LCD screen * 1.
STONE TFT LCD Communication Principle
The STONE TFT LCD realizes the function of the button switching interface;
The STONE TFT LCD can automatically jump to the main interface;
The STONE TFT LCD realizes time setting function;
The STONE TFT LCD realizes data variable distribution;
The STONE TFT LCD realizes variable input function;
The STONE TFT LCD realizes the menu bar selection function;
Esp8266 Control Principle
Esp8266 to realize LED control;
Esp8266 realizes DS18B20 data reading and analysis;
Esp8266 realizes the speed and rotation control of the stepper motor.
Here Is A Brief Schematic Diagram Of The Project
Module Introduction
Temperature Sensor
STONE-LCD-Arduino-ESP8266-Cooler
The temperature sensor I use DS18B20, DS18B20 is a commonly used digital temperature sensor, its output is a digital signal, with small size, low hardware overhead, strong anti-interference ability, high precision characteristics, development has certain difficulty.



It should be noted that to use the DS18B20 temperature sensor interface, you need to install the one wire library Dallas temperature library.

Stepper
ULN2003 is a Darlington display with high voltage and high current. It can be directly connected with TTL and CMOS circuits under 5V working voltage. It can directly process the data that needs a standard logic buffer. Here we use a DIP-16 package, 4-phase 5-wire 5V stepper motor.



LED
This is a galloping lamp display module with 8 LEDs. The external voltage is 3-5.5vdc, and the corresponding LED can be lighted at a low level. It is especially suitable for the IO test of a single-chip microcomputer to realize the control of indicator light.

ESP826
STONE-LCD-Arduino-ESP8266-Cooler
Esp8266 can be started directly from the external memory when it is equipped with an application and is the only application processor in the device. The built-in cache memory can improve system performance and reduce memory requirements. In addition, esp8266 has a powerful on-chip processor and storage capacity, which enables it to integrate sensors and other application-specific devices through GPIO port, which realizes the minimum system resources occupied in the early development and operation.



STVC101WT-01
10.1 inch 1024×600 industrial grade TFT panel and 4-wire resistance touch screen;
brightness is 300cd / m2, LED backlight;
RGB color is 65K;
visual area is 222.7mm * 125.3mm;
visual angle is 70 / 70 / 50 / 60;
working life is 20000 hours. 32-bit cortex-m4 200Hz CPU;
CPLD epm240 TFT-LCD controller;
128MB (or 1GB) flash memory;
USB port (U disk) download;
toolbox software for GUI design, simple and powerful hex instructions.
Basic functions
Touch screen control / display image / display text / display curve / read and write data / play video and audio. It is suitable for various industries.
UART interface is RS232 / RS485 / TTL;
voltage is 6v-35v;
power consumption is 3.0w;
working temperature is – 20 ℃ / + 70 ℃;
air humidity is 60 ℃ 90%.
STVC101WT-01 module communicates with MCU through a serial port, which needs to be used in this project. We only need to add the designed UI picture through the upper computer through the menu bar options to buttons, text boxes, background pictures, and page logic, then generate the configuration file, and finally download it to the display screen to run.
In addition to the data manual, there are user manuals, common development tools, drivers, some simple routine demos, video tutorials, and some for testing projects.

Design And Production
ESP8266
To complete the code development of esp32, Arduino is used to develop and compile. First, you need to install the environment and enter the Arduino official website: https://www.arduino.cc/en/Main/Software. download the version for your own platform.



After installation, we will build a new project. Here we will write the logic code, and then formulate the serial port protocol with stone TFT LCD, mainly to receive BUF.



TOOL 2019
Download tools
To develop our stone TFT LCD, we need to use a PC development software tool 2019. All operations are carried out on this PC software
After downloading, it can be placed in any location on the hard disk. After decompression, it can be used directly without installation.

New project
Double click TOOL 2019.exe. To complete this project, a new project needs to be created.


Click File -> new, then in the pop-up new project box, select my screen model as STV, size 1024 * 600, set the project name as stone, and finally select the project saving path, and then click OK. After that, it will jump to the Blue interface, which is the default background image of the new project.

Add pictures
After the completion of the new project, it is necessary to add the pictures made in advance to the project. The size of the background image needs to be consistent with the actual size of the screen, that is, 1024 * 600.

Right-click picture file and add No.11 pictures required by the project into the project in the pop-up selection box.

Interface setting
RTC
Due to the need to display the time, we need to add an RTC control here. The screen has the RTC timing function, which can be used to display the local time. The initial time can be written by the MCU, and then the stone screen can be independently timed.



In the first step, select the RTC control clock setting as the button to set the initial test time; in the second step, add a time display and place it in the upper right corner.

STONE-LCD-Arduino-ESP8266-Cooler

In clock setting, the button effect uses picture 2, which requires a keyboard, so the keyboard set is set to the eighth picture, and then the eighth keyboard is set.



Select the keyboard area. This area is the keyboard area that pops up when you click the set time button. Other non-selected areas are not visible.



In the customization of the keyboard, take the number 1 as an example, and define the key value in the pop-up keyboard box, and select page 10 for button effect.
The above completes the RTC time setting production.

Pop up menu
In manual mode, it is necessary to set the motor speed in three gears: high, medium, and low. Here is the pop-up menu. The following is the production process.



Click the image tool, select three small icons under the icon file generator, and then click generate icon file. Finally, an ICO file will appear under the icon file.
After the ICO file is finished, open the picture No.6. click Touch Configuration->Pop up menu.



In the third step, you need to select the “can” area, which is the effect of the actual operation. After that, the value of each icon needs to be calibrated on page 7. There is a one-to-one correspondence between the keys value and the image, and the value of 1 corresponds to the No. 1 Icon.



After that, add a variable icon to the original location. Note that the storage address of the icon should be consistent with the address of the pop up control. The initial value is set to 1, which is to display the No. 1 Icon. The icon library uses the 1.ico generated just now and sets the upper and lower limits.
This completes the pop-up menu settings.

Page Jump settings
Here I made a boot interface effect, the production process is as follows:

STONE-LCD-Arduino-ESP8266-Cooler

Click screen config and change the number in the boot page box to 0, which corresponds to the image No. 0. In this way, image No. 0 will be displayed first each time the machine is turned on.

STONE-LCD-Arduino-ESP8266-Cooler

After setting the completion time, you will enter the mode selection interface, where you can add two-button controls, click button icon to add, and then set button effect to interface 4, page switch in intelligent mode to corresponding interface 5, and manual mode to interface 6.

STONE-LCD-Arduino-ESP8266-Cooler

In this way, the whole stone project is developed.

Code
if(dataflag == true)
{
if(datalen == 13)
{
memset(RecievedTemp, 0 , 13);
for(cout_i = 0; cout_i < 13; cout_i ++)
{
RecievedTemp[cout_i] = Serial.read();
}
Serial.write(RecievedTemp, 13);
memset(RecievedTemp, 0 , 13);
dataflag = false;
}
}
else if(datalen == 9)
{
memset(RecievedTemp, 0 , 9);
for(cout_i = 0; cout_i < 9; cout_i ++)
{
RecievedTemp[cout_i] = Serial.read();
}
Serial.write(RecievedTemp, 9);
switch(RecievedTemp[5])
{
case 0x39://temp
if(HeadStepper.isRunning() == true)
{
HeadStepper.stop();
}
StepperStart = false;
// TempStartStop = true;
Temperatue = RecievedTemp[8];
break;
case 0x2B://temp start
TempStartStop = true;
StepperStart = false;
// HeadStepper_Setting_Run(speed_str[0], 5);
break;
case 0x2A://temp stop
if(HeadStepper.isRunning() == true)
{
HeadStepper.stop();
}
TempStartStop = false;
StepperStart = false;
// terstop = true;

Please contact us if you need a complete procedure

Attached

Post Reply