[SCM graduation project] [cl-010] Intelligent fire extinguishing car | Tracking and obstacle avoidance car | Infrared tracking car | Ultrasonic obstacle avoidance car

1. Basic introduction

Item name:
Design of intelligent fire-fighting trolley monitoring system based on microcontroller
Design of monitoring system for tracking and obstacle avoidance car based on single-chip microcomputer
Design of infrared tracking car detection system based on microcontroller
Design of ultrasonic obstacle avoidance car system based on microcontroller

Project number: mcuclub-cl-010
Microcontroller type: STC89C52, STM32F103C8T6
Specific functions:
Specific functions:
1. Tracking is carried out through a pair of infrared tracking tubes. During the tracking process, obstacles in front are detected through ultrasonic waves. When the distance of the obstacle is less than 50cm and greater than 30cm, the buzzer will alarm. When the distance of the obstacle is less than or equal to 30cm, it will automatically stop until the obstacle is removed
2. Use Bluetooth to control the car to move forward, backward, turn left, turn right, stop, accelerate forward, decelerate forward, and detect obstacles in front through ultrasonic waves. When the distance of the obstacle is less than 50cm and greater than 30cm, the buzzer will alarm. Automatically avoid obstacles when the distance of the obstacle is detected to be less than or equal to 30cm
3. Measure the speed through the infrared speed tube, and send the speed value and distance to the mobile phone for display
4. Use the flame sensor to detect whether there is a fire. After a fire occurs, stop the vehicle, close the relay to extinguish the fire, and then continue moving forward until the fire is extinguished.

2. Data Overview

Physical information

Please add an image 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 five parts. The first part is the infrared tracking module, which tracks through a pair of infrared tracking tubes; the second part is the ultrasonic ranging module, which detects obstacles ahead through ultrasonic waves; the third part is the speed sensor module, which uses The infrared speed measuring tube measures the speed; the fourth part is the flame detection module, which detects whether a fire occurs through the flame sensor; the fifth part is the power supply module, through which the entire system can be powered. The output consists of three parts. The first part is the DC motor drive module, through which the car is controlled to move forward, backward, turn left, turn right, stop, accelerate forward, and decelerate forward; the second part is the relay module, which uses the relay to extinguish the fire. ; The third part is the sound and light alarm module. When the obstacle is detected to be less than 50cm or greater than 30cm, the buzzer will alarm. When the obstacle is detected to be less than or equal to 30cm, it will automatically stop until the obstacle is removed. 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

******* processing function
*****/
void Manage_function(void)
{
if(FIRE == 1) //No fire
{
RELAY = 0;
if(flag_mode == 0) //Tracking mode
{
if(distance_value > 30)
{
if(infrared_l) //If the left infrared tube detects a black line
{
flag_direction = 5;
}
else if(infrared_r) //If the right infrared tube detects a black line
{
flag_direction = 3;
}
else
flag_direction = 4; //The car is normal
\t\t\t
if(distance_value < 50) //When the obstacle distance is detected to be less than 50cm and greater than 30cm, the buzzer will alarm
{
if(time_num % 2 == 0)
{
BEEP = ~BEEP;
}
}
else
{
BEEP = 0;
}
}
else //When an obstacle is detected and the distance is less than or equal to 30cm, the car will automatically stop until the obstacle is removed.
{
flag_direction = 1;
BEEP = 0;
}
}
else //During Bluetooth control
{
if(distance_value < 50 & amp; & amp; distance_value > 30) //When the obstacle is detected to be less than 50cm and greater than 30cm, the buzzer will alarm. When the obstacle is detected to be less than or equal to 30cm, turn right to avoid the obstacle.
{
if(time_num % 2 == 0)
{
BEEP = ~BEEP;
}
}
else if(distance_value <= 30)
{
flag_direction = 3;
motor_speed = 20;
Delay_ms(200);
flag_direction = 4;
distance_value = Hcsr04_GetDistance(25); //Get the distance value
BEEP = 0;
}
else
{
BEEP = 0;
}
}
}
else //A fire breaks out, stop the car to put out the fire
{
BEEP = 0;
RELAY = 1;
flag_direction = 1;
}
}