Intelligent wardrobe design based on microcontroller

1. Abstract

With the continuous development of science and technology, people have higher and higher requirements for the quality of life. As an important part of smart home, smart wardrobe can provide users with convenient and personalized clothing management services. This article mainly studies the design of intelligent wardrobe based on single-chip microcomputer. Through the design and implementation of hardware system and software system, the intelligent management of wardrobe is realized.

2. Introduction

As an emerging household product, smart wardrobes have functions such as automatic identification, classified storage, and remote control. They can effectively solve the problems of clothing accumulation and difficulty in finding in traditional wardrobes. This article mainly studies the design of intelligent wardrobe based on single-chip microcomputer. Through the design and implementation of hardware system and software system, the intelligent management of wardrobe is realized.

3. System design

1. Hardware design

This design uses STC89C52 microcontroller as the control core, and realizes the identification, classification storage and environmental monitoring of clothing through infrared sensors, temperature and humidity sensors and other modules. At the same time, communication with the mobile phone APP is realized through the Bluetooth module to realize the remote control function.

2. Software design

This design uses C language to write the program, which mainly includes infrared sensor module, temperature and humidity sensor module, Bluetooth module and other drivers, as well as the main control program. The main control program is mainly responsible for the control and data processing of each module to realize the intelligent management of the wardrobe.

4. System implementation

1. The infrared sensor module realizes the identification of clothing and determines the type and quantity of clothing by detecting the infrared reflection signal on the clothing.

2. The temperature and humidity sensor module monitors the environment inside the wardrobe and ensures a suitable storage environment for clothes by detecting temperature and humidity data.

3. The Bluetooth module realizes communication with the mobile phone APP. Users can view the clothing information in the wardrobe through the mobile phone APP and perform remote control.

4. The main control program realizes the control and data processing of each module, and realizes the classified storage and environmental monitoring of clothing based on the data from infrared sensors, temperature and humidity sensors and other modules.

5. Experimental results and analysis

Through actual testing, the smart wardrobe designed by this design can accurately identify the type and quantity of clothing and realize classified storage of clothing; at the same time, it can monitor the temperature and humidity in the wardrobe in real time to ensure that the storage environment of clothing is suitable; in addition, users can use the mobile APP to Remote control enables intelligent management of wardrobes.

Part of the code is as follows

#include <reg52.h>
#include <intrins.h>

typedef unsigned char uchar;
typedef unsigned int uint;

sbit MQ4 = P1^0; // 甲醛传感器连接单片机P1.0引脚
sbit MQ7 = P1^1; // 苯传感器连接单片机P1.1引脚
sbit MQ135 = P1^2; // CO2传感器连接单片机P1.2引脚

uchar code table[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 数码管显示数字0-9的编码

void delay(uint z)
{
    uint x, y;
    for (x = z; x > 0; x--)
        for (y = 110; y > 0; y--);
}

void display(uchar num)
{
    uchar i;
    for (i = 0; i < 4; i++)
    {
        P2 = table[num % 10];
        num /= 10;
        delay(5);
        P2 = 0x00;
        delay(5);
    }
}

void main()
{
    uchar mq4_value, mq7_value, mq135_value;
    while (1)
    {
        mq4_value = MQ4; // 读取甲醛传感器的值
        mq7_value = MQ7; // 读取苯传感器的值
        mq135_value = MQ135; // 读取CO2传感器的值

        display(mq4_value); // 显示甲醛浓度值
        display(mq7_value); // 显示苯浓度值
        display(mq135_value); // 显示CO2浓度值
    }
}

Completely private

Guess you like

Origin blog.csdn.net/qq_58404700/article/details/135400120