[SCM graduation project] [jj-019] Intelligent range hood | Kitchen fume detection | Kitchen environment detection | Kitchen fire detection

1. Basic introduction

Item name:
Design of intelligent range hood system based on single-chip microcomputer
Design of kitchen oil smoke detection system based on microcontroller
Design of kitchen environment detection system based on microcontroller
Design of kitchen fire detection system based on microcontroller

Project name: range hood
Microcontroller type: STC89C52
Specific functions:
1. Use the MQ-2 smoke sensor to detect the smoke concentration in the kitchen. If the smoke concentration is less than the set minimum threshold, the range hood fan will not work; if the smoke concentration is between the set upper and lower thresholds, the fan will rotate at low speed; if the smoke concentration is greater than Set the maximum threshold and the fan rotates at high speed
2. Detect the temperature through DS18B20. If the temperature is higher than the set maximum threshold, the fire extinguishing relay will close, start extinguishing the fire, and sound and light alarm;
3. Use the human body pyroelectric induction module to detect whether there is someone, and detect the light value through the photoresistor. When there is someone and the light value is less than the set minimum value, the lights will be turned on automatically.
4. Control the fan through MX1508 and use PWM to control the speed;
5. Use buttons to set thresholds, adjust fan speed, turn on lights, and switch modes;
6. Display the measured value through the display screen
Extended functions: Send measurement data to the mobile phone through the Bluetooth module, and can control the fan speed, turn on the lights and switch modes

2. Data Overview

Physical information

Please add a picture description

Simulation data

Please add an image description

3. Display of some information on 51 microcontroller

1. Physical picture display

Microcontroller model: STC89C52
Power supply interface: TYPE-C
Board type: PCB integrated board, thickness 1.2, two-layer board (upper and lower layers are copper-clad and grounded)
Device type: The components are basically pin type, and some buck chips will use SMD type.

2. Simulation diagram display

Simulation software version: proteus8.9
Circuit connection method: network label connection method
Note: Some physical components are not included in the simulation. They will be replaced by other components with similar working principles in the simulation. This may cause the physical program to be different from the simulation program.

3. Schematic display

Software version: AD2013
Circuit connection method: network label connection method
Note: The schematic diagram only shows the pin diagram of the module, not the internal structure diagram of the module.

4. PCB diagram display

Exported from the schematic diagram, there is a project number in the middle, which is hidden under the base of the microcontroller and will not be seen after inserting the microcontroller.
Two-layer board, top and bottom covered with copper and grounded.

IV. Display of some information on 32 microcontroller

1. Physical picture display

Microcontroller model: STM32F103C8T6
Power supply interface: TYPE-C
Board type: PCB integrated board, thickness 1.2, two-layer board (upper and lower layers are copper-clad and grounded)
Device type: The components are basically pin type, and some buck chips will use SMD type.

2. Schematic display

Software version: AD2013
Circuit connection method: network label connection method
Note: The schematic diagram only shows the pin diagram of the module, not the internal structure schematic diagram of the module.

3. PCB diagram display

Exported from the schematic diagram, there is a project number in the middle, which is hidden under the base of the microcontroller and will not be seen after inserting the microcontroller.
Two-layer board, top and bottom covered with copper and grounded.

5. System block diagram

Drawing software: VISIO

This design uses a single-chip microcomputer as the core controller, plus other modules to form the entire system of this design, including the central control part, the input part and the output part. The central control part adopts a single-chip microcomputer controller, whose main function is to obtain the data of the input part, and finally control the output part after internal processing and logical judgment. The input consists of six parts. The first part is the temperature detection module, through which the temperature of the current environment is detected; the second part is the button module, through which the interface can be switched, thresholds set, modes switched, etc.; the third part is the power supply module. This module can provide power to the entire system; the fourth part is the smoke detection module, which detects the smoke concentration in the current environment; the fifth part is the human body infrared pyroelectric induction module, which senses whether there is a person; the sixth part It is the light detection module, through which light is detected. The output consists of four parts. The first part is the display module, through which the monitored data and the set threshold can be displayed; the second part is the relay module, which controls heating and cooling respectively through two relays; the third part is the sound and light alarm module , when the monitored value is not within the set threshold, an audible and visual alarm is issued; the fourth part is the DC motor module, through which the fan is driven. In addition, the Bluetooth module serves as both input and output. The Bluetooth module is connected to the mobile phone and can transmit the monitored data to the user’s mobile phone. The user can also send instructions through the mobile phone to control the work of the relay and its mode switching. In addition, the Bluetooth module serves as both input and output. The Bluetooth module is connected to the mobile phone and can transmit the monitored data to the user’s mobile phone. The user can also send instructions through the mobile phone to control the work of the relay and its mode switching. The specific system block diagram is shown in Figure 3.1.

6. Partial program display

Software version: keil5
Note: The logic program and driver are separated and distributed in main.c and other .c files

*******Display function
*****/
void Display_function(void)
{<!-- -->
switch(flag_display) //Display different interfaces according to different display mode flags
{<!-- -->
case 0: //Interface 0:
Oled_ShowCHinese(1, 0, "Smoke:"); //Display smoke concentration
sprintf(display_buf,"%dPPM ",smog_value);
Oled_ShowString(1, 6, display_buf);
\t\t
Oled_ShowCHinese(2, 0, "Lighting:"); //Display lighting value
sprintf(display_buf,"%dLx ",light_value);
Oled_ShowString(2, 6, display_buf);

Oled_ShowCHinese(3, 0, "Temperature:"); //Display temperature value
sprintf(display_buf,"%d.? ",temp_value/10,temp_value );
Oled_ShowString(3, 6, display_buf);
\t\t
if(flag_motor_speed == 0) //Display motor status
{<!-- -->
Oled_ShowCHinese(4,3,"Stop");
}
else if(flag_motor_speed == 1)
{<!-- -->
Oled_ShowCHinese(4,3,"low speed");
}
else if(flag_motor_speed == 2)
{<!-- -->
Oled_ShowCHinese(4,3,"High Speed");
}

if(flag_mode == 0) //Display mode
Oled_ShowCHinese(4,0,"automatic");
else
Oled_ShowCHinese(4,0,"Manual");
\t\t\t
if(MAN == 0) //Display whether there is anyone
Oled_ShowCHinese(4,6,"Someone");
else
Oled_ShowCHinese(4,6,"No one");
break;

case 1: //Interface 1:
Oled_ShowCHinese(1,1,"Set the maximum smoke value");
if(time_num % 5 == 0)
{<!-- -->
sprintf(display_buf,"%d ",smog_max);
Oled_ShowString(2, 7, display_buf);
}
if(time_num % 10 == 0)
{<!-- -->
Oled_ShowString(2, 7, " ");
}
break;
\t\t
case 2: //Interface 2:
Oled_ShowCHinese(1,1,"Set the minimum smoke value");
if(time_num % 5 == 0)
{<!-- -->
sprintf(display_buf,"%d ",smog_min);
Oled_ShowString(2, 7, display_buf);
}
if(time_num % 10 == 0)
{<!-- -->
Oled_ShowString(2, 7, " ");
}
break;
\t\t
case 3: //Interface 3:
Oled_ShowCHinese(1,1,"Set the maximum temperature value");
if(time_num % 5 == 0)
{<!-- -->
sprintf(display_buf,"%d ",temp_max);
Oled_ShowString(2, 7, display_buf);
}
if(time_num % 10 == 0)
{<!-- -->
Oled_ShowString(2, 7, " ");
}
break;
\t\t
case 4: //Interface 4:
Oled_ShowCHinese(1,1,"Set the minimum lighting value");
if(time_num % 5 == 0)
{<!-- -->
sprintf(display_buf,"%d ",light_min);
Oled_ShowString(2, 7, display_buf);
}
if(time_num % 10 == 0)
{<!-- -->
Oled_ShowString(2, 7, " ");
}
break;
default:
break;
}
}

/****
*******Handling function
*****/
void Manage_function(void)
{<!-- -->
if(flag_display == 0)
{<!-- -->
if(flag_mode == 0) //In automatic mode, the motor speed flag can be changed by smoke concentration
{<!-- -->
if(smog_value < smog_min) //Smoke concentration <minimum value
{<!-- -->
flag_motor_speed = 0; //Motor stops
}
else if(smog_value >= smog_min & amp; & amp; smog_value <= smog_max) //Smoke concentration minimum value<=Smoke concentration<=Smoke concentration maximum value
{<!-- -->
flag_motor_speed = 1; //Motor low speed
}
else //smoke concentration>smoke concentration maximum value
{<!-- -->
flag_motor_speed = 2; //Motor high speed
}
if(MAN == 0 & amp; & amp; light_value< light_min)
{<!-- -->
RELAY_LED = 1;
}
else
{<!-- -->
RELAY_LED = 0;
}
if(temp_value > temp_max*10) //Temperature>temperature maximum value
{<!-- -->
RELAY = 1; //relay closed
if(time_num % 2 == 0) //Buzzer alarm
{<!-- -->
BEEP = ~BEEP;
LED = ~LED;
}
}
else //otherwise
{<!-- -->
RELAY = 0; //Relay is disconnected
BEEP = 0; //Buzzer stops alarming
LED = 1;
}
}
else //in manual mode
{<!-- -->
BEEP = 0; //Buzzer stops alarming
LED = 1;
}
switch(flag_motor_speed) //Control the motor speed according to different motor speed flags
{<!-- -->
case 0:
speed_value = 0; //Stop
break;
\t\t\t
case 1:
speed_value = 6; //low speed
break;

case 2:
speed_value = 9; //High speed
break;

default:
break;
}
}
else
{<!-- -->
RELAY = 0; //Relay is disconnected
BEEP = 0; //Buzzer stops alarming
LED = 1;
RELAY_LED = 0;
}

}