【Open Source】 Smart Cabinet Management System Based on DWIN T5L Screen

Using the T5L chip as the main control and T5L chip drives the serial bus servo to control the door switch, and processes the sensor data collected by the auxiliary controller, and drives the LCD screen for data display. It has an abnormal warning function and an automatic lighting system, which can be used normally in dim light situations.

wps_doc_0

1. Program Description

(1) The T5L screen is used as the main control to directly drive the serial bus servo. Using Feite STS series steering gear, the torque ranges from 4.5KG to 40KG, and the protocol is universal.

(2) The serial bus steering gear has current, torque, temperature and voltage protection functions, and its safety is higher than that of conventional motors;

(3) One serial port supports simultaneous control of 254 servos.

 2.Scheme design

(1) Scheme block diagram

wps_doc_1

(2) Mechanical structure diagram

In order to prevent the power failure of the intelligent cabinet door from being out of control, this design adopts a dual steering gear design. After a power failure, due to the existence of the door latch, even if the door opening servo is unloaded, the smart cabinet is still in the locked state. The mechanical structure is shown in the figure:

wps_doc_2
wps_doc_3

Diagram of the opening structure

Diagram of the closing structure

(3) DGUS GUI Design

wps_doc_4 wps_doc_5

(4) Circuit Schematic
The circuit schematic is divided into three parts: main circuit board (servo drive circuit + auxiliary controller + interface), step-down circuit, and lighting circuit (installed in the cabinet).

wps_doc_6

Main Circuit Board

wps_doc_7

Step-down Circuit

wps_doc_8

Lighting Circuit

5. Program example

Temperature and humidity detection and refresh, time update (AHT21 is driven by the auxiliary controller, and the temperature and humidity data is written into the DWIN screen)
/*****************Temperature and humidity update**********************/
void dwin_Tempe_humi_update( void)
{
        uint8_t  Tempe_humi_date[20];  //Commands sent to the LCD screen
        AHT20_Read_CTdata(CT_data);  //Read temperature and humidity
        
        Tempe_humi_date[0]=0x5A;
        Tempe_humi_date[1]=0xA5;
        Tempe_humi_date[2]=0x07;
        Tempe_humi_date[3]=0x82;
        Tempe_humi_date[4]=(ADDR_TEMP_HUMI>>8)&0xff;
        Tempe_humi_date[5]=ADDR_TEMP_HUMI&0xff;
        Tempe_humi_date[6]=((CT_data[1] *200*10/1024/1024-500)>>8)&0xff;
        Tempe_humi_date[7]=((CT_data[1] *200*10/1024/1024-500))&0xff;//Calculate the temperature value (enlarged by 10 times, if t1=245, it means that the temperature is now 24.5°C)

        Tempe_humi_date[8]=((CT_data[0]*1000/1024/1024)>>8)&0xff;
   Tempe_humi_date[9]=((CT_data[0]*1000/1024/1024))&0xff;  //Calculate the humidity value (magnified 10 times, if c1=523, it means that the humidity is 52.3% now)

        Usart_SendString( USART_DWIN,Tempe_humi_date,10);

}


Post time: Nov-08-2022