Design and implementation of smart refrigerator based on Internet of Things technology

Publisher:blazingsLatest update time:2013-01-25 Source: RFID世界网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    0Introduction

    With the rapid development of people's living standards and the accelerating pace of life, refrigerators play an increasingly important role in families, but they are troublesome to organize. At the same time, people often cannot figure out whether the food has been used up or forget some food in the refrigerator, causing various life troubles.     

    This design uses radio frequency identification (RFID) technology, combined with the Internet and information processing technology, to establish an intelligent refrigerator food supervision system to record the food in the refrigerator. Then the food in the refrigerator can be displayed on the refrigerator's LCD screen by querying the database, or you can send text messages to the refrigerator to query the food at home, and buy the food in the refrigerator through the mobile phone, meeting the needs of future smart homes.     

    With the development of the Internet of Things, the investment in smart homes in the direction of the Internet of Things is rapidly expanding, and the finished products of RFID tags are constantly decreasing. In the future, they may replace barcodes for food outsourcing, and RFID tags are known for their durability, durability, and maintenance-free. As most people's families have reached a well-off level, they are eager for more convenient and trouble-free home appliances. Although this system is only a prototype, it is moderately priced and uses more cutting-edge technology. It is more trouble-free than traditional refrigerators, providing convenience for the busy lives of urban people and solving many trivial matters in life. It will be accepted by most people when it is put on the market.     

    1 System overall design    

    1.1 System Overall Plan

    According to the functions and technical requirements of the smart refrigerator terminal, it is decided to adopt the "hardware + software" system structure to design the smart refrigerator terminal. The application layer is written based on the OS according to the different needs of the project. Each part is briefly introduced as follows:    

    The system uses a hardware development platform based on Intel Xscale PXA270, which is an ARM processor based on Intel XScale architecture.    

    The embedded operating system is Windows CE5.0. Windows CE is a highly modular embedded operating system that users can customize and tailor according to their device requirements through the Platform Builder tool.    

    Application framework: qt-embedded-wince-opensource4.6 has a rich standard library, dynamic engine, widget style sheet, powerful graphics drawing and multi-threading capabilities; it achieves high performance and small footprint on Windows CE.     

    This system is a household appliance that can query and access food at any time through the Internet. Users can learn about refrigerator food information through text messages and decide whether to buy online. The overall system scheme diagram 1 is as follows.

Figure 1 System Block Diagram

Figure 1 System Block Diagram

    1.2 System Module

    According to the design plan, we divide the entire system into three main modules, as shown in Figure 2.

Figure 2 System module diagram

Figure 2 System module diagram

    1.3 Module Function Detailed Description

    (1) Food status module.     

Table 1

Table 1   

    (2) Online shopping module.

Table 2

Table 2   

    (3) Recipe module.

Table 3

Table 3

    2. Hardware Design  

Figure 3 System hardware block diagram

Figure 3 System hardware block diagram     

    2.1RFID reader/writer, antenna module

    ISO18000-6CI series reader is a new generation of long-distance electronic tag reader developed by Shenzhen Xinshi Technology Co., Ltd. The tags supported by the reader are mainly passive electronic tags that comply with ISO18000-6C (hereinafter referred to as "6C") protocol. Users can use this reader to read, write, lock and other functions on 6C electronic tags. The reader has three working modes of reading electronic tags: master-slave, timing and trigger. The communication interfaces connecting the host and the controller are RS-232, RS-485 and Wiegand interfaces. It can be directly connected to a control device with a standard Wiegand W26 or W34 interface, or it can be connected to a controller or PC through a standard communication interface for data communication and exchange; there are also four trigger signal input interfaces. When the pressure sensor detects a change in the pressure in the refrigerator, the corresponding function is triggered to enable the reader to scan the food labels in the refrigerator. At the same time, this module provides reading and writing multiple tags at a time, which is suitable for the design of this project.     

    2.2GPRS/GSM module

    This module uses DU600 of Hongpeng Electronics Co., Ltd., which supports multiple connection modes and can realize the basic functions of mobile phone communication. The GPRS module of the smart refrigerator only needs to send and receive text messages and interpret the received text messages. It only needs DU600 to select the wake-up mode to wait for the receipt of text messages and can send control instructions to PXA270 through the instructions obtained after interpreting the text messages to realize the purchase function and query function.  

Figure 4 Schematic diagram of the working of the reader and the electronic tag

Figure 4 Schematic diagram of the working of the reader and the electronic tag    

    2.3 Pressure sensor module

    Through the 89C51 single-chip computer, the LCD module, serial port module and 24-bit ADC module are integrated. This module is mainly responsible for sensing the change of pressure and transmitting the interrupt signal to the central control platform through the serial port.     

    The pressure sensor HX711 uses HiSilicon's patented integrated circuit technology and is a 24-bit A/D converter chip designed for high-precision electronic scales. When the pressure sensor changes, it will send a signal to the core board to indicate that there is a change in the refrigerator and start RFID scanning.     

    2.4 Temperature control module

    This module is a refrigeration control system based on a single-chip microcomputer, with real-time temperature display and adjustable refrigeration temperature, the lowest of which can reach minus 10 degrees.    

    The temperature sensor of this module uses DS18B20. According to the communication protocol of DS18B20, the host (single-chip microcomputer) must go through three steps to control DS18B20 to complete temperature conversion: reset the DS18B20 before each reading and writing, send a ROM instruction after the reset is successful, and finally send a RAM instruction, so that the DS18B20 can perform the predetermined operation. Reset requires the main CPU to pull down the data line for 500 microseconds and then release it. When DS18B20 receives the signal, it waits for about 16 to 60 microseconds, and then sends a low pulse of 60 to 240 microseconds. The main CPU receives this signal to indicate that the reset is successful. At the same time, this module uses a semiconductor refrigeration chip to simulate the refrigerator preservation function.     

Figure 5 Partial schematic diagram of temperature control module

Figure 5 Partial schematic diagram of temperature control module     

    3. Software Design     

    3.1 System Software Block Diagram

    The software block diagram of the smart refrigerator based on Windows CE 5.0 is shown in Figure 6.

Figure 6 Software Block Diagram

Figure 6 Software Block Diagram   

    3.2 Application Development

    (1) RFID implementation process.

    Use the ReadID function in the RFID API to read the RFID card in the refrigerator, and read the RFID card multiple times in a row. During the reading process, use the anti-collision algorithm to exclude the same RFID card information read, and then save the obtained RFID card information in the data structure so that the data structure can be used to check the database information later. After the reading is completed, disconnect the RFID connection and start comparing the data with the database.     

    Here we use the widely used binary tree anti-collision algorithm. When exchanging data between the reader and the transponder, part or all of the serial number bits are often transmitted. The transmission order at this time is defined as: send the low bit first, then the high bit. When comparing data inside the reader or transponder, the following principle is followed, that is, compare the bits in sequence, compare the low bit first, then the high bit, and agree that 0<1. According to this comparison order, when judging the size, the low-bit data takes priority, that is, when comparing two numbers A and B, the size of the first unequal bit starting from the low bit determines the size of the two numbers. Only when all the bits of the two numbers are equal, the two numbers are equal. During the execution of the binary tree algorithm, the reader will send multiple commands to the transponder to divide the transponder into two groups and obtain a unique transponder after multiple groupings. In this grouping process, the command parameters are stored in the form of nodes to form a data bifurcation tree, thus forming a "binary tree". The binary tree anti-collision algorithm of the smart refrigerator is compared in the transponder. Because there can be multiple readers, and the data read by the reader is finally sent to the transponder, the transponder is selected as the place to burn the anti-collision algorithm. In this way, the tag data can be transmitted to the main control platform PXA270 after the transponder receives the tag read by the reader and excludes the same.  

Figure 7 RFID reading flow chart

Figure 7 RFID reading flow chart

    (2) GPRS implementation process     

    When the shopping list is received after database comparison, the GPRS program written in C++ code is run through QT. First, the information data to be sent to the customer is obtained from QT, and then OnBnClickedBtnOpen() is used to configure the RS-232 serial port connection to configure GPRS, and wait for the GPRS connection to succeed.     

    When the connection is successful, GPRS will return "AT+OPENAT=MODE:3#" data to confirm the connection is successful. Then send the message to GPRS through the OnBnClicked-BtnSend (string) function, and then GPRS will send it to the customer's mobile phone according to the content of the message. After the message is sent successfully, GPRS will wait for 5 minutes for the customer to send a reply to confirm the purchase.     

    If the customer has not replied to confirm the purchase within 5 minutes, the purchase of food will be automatically canceled and the GPRS connection will be disconnected; if the customer replies to confirm the purchase within 5 minutes, the program will return a confirmation message and disconnect the GPRS connection.

Figure 8 GPRS algorithm flow chart

Figure 8 GPRS algorithm flow chart 

Figure 9 Pressure sensor algorithm flow chart

Figure 9 Pressure sensor algorithm flow chart     

    (3) Pressure sensor implementation process

    When the refrigerator is opened, PXA270 energizes the pressure sensor. The pressure sensor will record the initial gravity when it works for the first time. When the refrigerator is closed, the gravity of the pressure sensor is measured and compared with the initial gravity to see if it has changed. If it has not changed, the pressure sensor is turned off and the pressure sensor ID reader is disconnected.    

    (4) Temperature control process

    Due to the problem of PXA270 external socket, the temperature sensor is based on the microcontroller operation and does not need to be embedded in the PAX270 development board. The temperature sensor will start with the start of the refrigerator. When the data measured by the temperature sensor is sent to the microcontroller, the microcontroller will first compare the temperature in the refrigerator with the set refrigerator temperature. If it is higher than the refrigerator temperature, the refrigeration device will be turned on. During the refrigeration period, the refrigerator temperature is also continuously measured and compared with the set refrigerator temperature value; if it is less than or equal to the set refrigerator temperature value, the refrigeration device is turned off. The microcontroller continues to receive the refrigerator temperature transmitted from the temperature sensor and compares the set refrigerator temperature value to prepare to start refrigeration at any time to maintain the refrigerator temperature. When the refrigerator is powered off, the microcontroller will stop running and directly turn on the refrigerator again after power is turned on and the microcontroller is initialized from the beginning.

Figure 10 Temperature control algorithm flow chart

Figure 10 Temperature control algorithm flow chart

    (5) Online shopping process

    In this process, we specified the Internet of Things supermarket website that the refrigerator can directly access for docking. Therefore, in this project, we built a shopping website (ASP) in order to interact with this type of product. By calling the system's own header fileThe function HINTERNETInternetOpenUrl() is used to open a complete FTP, Gopher or HTTP URL resource to obtain product related information.     

    In addition, users need to log in to the shopping website to place an order. Here, we assume that each smart refrigerator is equipped with a dedicated account to bind the login and submit the page through POST. When the refrigerator logs in successfully, you can purchase the goods and place an order.    

    (6) Database implementation

    Through SQLite, the refrigerator stores various information about food for easy search.   

Table 4NowTab1

    NowTab1 stores the food table in the refrigerator last time, which is convenient for comparing the changes with the data read by RFID this time, and appropriately deleting or adding NowTab1 data for the next comparison, and can also display the food in the refrigerator.  

Table 5HistoryTab3

Table 5HistoryTab3

    HistoryTab3 saves the food that has been stored in the refrigerator so that customers can find the food they have bought.

Table 6SureTab2

Table 6SureTab2

    SureTab2 stores the food table of the basic needs of the refrigerator. This table is used to confirm that if the food in the NowTab1 table is missing a certain amount, it will be compared with SureTab2. If a certain food is missing beyond the limit, the shopping program will be started and the missing food will be purchased to prevent the refrigerator from running out of food.   

Table 7 NameTab4

Table 7 NameTab4

    NameTab4 stores the name corresponding to the number. NameTab4 is used to easily obtain the name of the food from the information read by the RFID.

     If the name cannot be found, it can be found on the numbering website and added to the AddrTab5 table for later retrieval.

Table 8AddrTab5

Table 8AddrTab5

    AddrTab5 can get the address name according to the address number. AddrTab5 is to facilitate the production address of the food from the information read by RFID. If the address cannot be found, the address can be found online through the address number and added to the AddrTab5 table for later search.

Table 9 Cookbook 5

Table 9 Cookbook 5

    You can first list the ingredients and recipes that can be cooked in the refrigerator according to Cookbook5. Cookbook5 is a recipe stored in a database, which makes it easy to find recipes that can be cooked from the existing ingredients in the refrigerator. Cookbook5 can download recipes from the Internet and save them in the database.

Table 10RDCookbook6

Table 10RDCookbook6

    You can get recommended recipes through RDCookbook6. RDCookbook6 lists the most likely recipes to be cooked based on the ingredients currently in the refrigerator and the recipes in Cookbook5.    

    (7) GUI interface design

    The GUI of this system is implemented using QTE.    

    ①Brief design overview A groupBox control is placed on the left side of the main interface, and four pushBottons are added to it, which represent: main interface, food status, online shopping and recipe recommendation. A stackedWidget control is placed on the right side of the main interface, and a total of five pages are added to realize the display of different functional modules. The buttons are connected through signals and slots to realize the jump of the corresponding functional interface.

    ②Main design implementation methods.    

    ●Hide the title bar.

    his->setWindowFlags(Qt::FramelessWindowHint);

    this->setWindowModality(Qt::ApplicationModal);

    ●Calendar display.

    //Display date

    curFile=QDateTime::currentDateTime(). toString("dd");

    ui->label_9->setStyleSheet("font-size:30px");

    ui->label_9->setText(curFile);

    //Display year and month

    curFileyear=QDateTime::currentDateTime(). toString("2011-MM");

    ui->label_8->setStyleSheet("font-size:18px");

    ui->label_8->setText(curFileyear);

    ●Dynamic update time.

    QTimer*timer=newQTimer();

    connect(timer,SIGNAL(timeout()),this,SLOT(timerUpDate()));

    timer->start(1000);

    voidicebox::timerUpDate()

    {

    curFiletime=QDateTime::currentDateTime(). toString("hh:mm:ss");

    ui->label_7->setText(curFiletime);

    }     

    4 Conclusion

    RFID refrigerators can give full play to the advantages of radio frequency identification technology, provide protection for the healthy life of modern families, reduce the waste of social resources, conform to the concept of green environmental protection in contemporary society, and can be applied to smart homes. However, at present, supermarket products have not yet used RFID tags, so every food needs to be labeled, which will be a cumbersome process, and the label cost may exceed the food itself. This is a problem encountered in the practical use of smart refrigerators. However, with the popularization of supermarket logistics RFID technology and the further decline in label prices, smart refrigerators will inevitably enter every household and become the protagonist of smart homes.

Reference address:Design and implementation of smart refrigerator based on Internet of Things technology

Previous article:Design and implementation of a smart refrigerator based on the Internet of Things
Next article:Design and implementation of smart refrigerator based on Internet of Things technology

Latest Home Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号