[Graduation Project] 57-Ultrasonic ranging simulation reversing radar system design based on microcontroller (source program + schematic engineering + PCB + simulation engineering + thesis)

[Graduation Project] 57-Ultrasonic ranging simulation reversing radar system design based on microcontroller (source program + schematic engineering + PCB + simulation engineering + thesis)

Information requirements

The materials include: a complete set of graduation project materials (high quality)
Schematic project files
Schematic screenshots
PCB Project files
Simulation model project files
Source code project
Simulation screenshots
Construction video< /span> Answer thesis low repetition rate document
Physical pictures

design manual

Summary

This design introduces the principle of an ultrasonic distance meter based on microcontroller control: the AT89S52 controls the timing, and the HC-SR04 ultrasonic module is used to transmit and receive, and calculate the round-trip time from transmitting to receiving the ultrasonic wave, thereby obtaining the actual measured distance. And temperature compensation adjustment is used in data processing, and the distance and temperature are displayed with LCD1602 liquid crystal display module.

The entire hardware circuit is composed of ultrasonic transmitting and receiving circuits, power circuits, display circuits and other modules. The signals from each probe are comprehensively analyzed and processed by the microcontroller to realize various functions of the ultrasonic range finder. On this basis, the overall scheme of the system was designed, and finally each functional module was implemented through hardware and software. Relevant parts are accompanied by hardware circuit diagrams and program flow charts, which provide system composition, circuit principles and program design. This system has the advantages of easy control, reliable operation, high ranging accuracy, strong readability and clear process. The implemented works can be used in various applications where distance parameters need to be measured.

design framework architecture

Ultrasonic distance meter based on single-chip microcomputer system... I

Ultrasonic range finder system based on single chip. II

1. Introduction... 8

1.1 Research background of the topic... 8

1.2. Proposal of the topic and research significance... 9

1.2.1 Proposal of the topic... 9

1.2.2 The significance of this research... 9

1.3. Research status at home and abroad... 10

1.3.1 Development history… 10

1.3.2 Research status... 11

2. Ultrasonic ranging principle and error analysis... 11

2.1 Introduction to Ultrasound… 11

2.1.1 What is ultrasound… 11

2.1.2 Characteristics and characteristics of ultrasonic waves... 12

2.1.3 Application of ultrasonic waves… 13

2.1.4 Principle of ultrasonic ranging... 14

2.2 Error analysis of ultrasonic ranging... 14

3. System hardware design... 16

3.1 System structure design... 16

3.2 Introduction to AT89S52 microcontroller… 17

3.2.1 AT89S52 microcontroller functions… 17

3.2.2 Main features of AT89S52 microcontroller... 17

3.2.3 AT89S52 pin description… 18

3.3 Introduction to DS18B20 temperature sensor… 20

3.4 Ultrasonic module HC-SR04. 21

3.4.1 HC-SR04 features… 21

3.4.2 Basic working principle of HC-SR04... 21

3.4.3 Ultrasonic timing diagram... 22

3.5.1 Introduction to LCD1602… 23

3.5.2 LCD1602 display program flow chart... 24

3.6 Ultrasonic transmitting and receiving circuit… 25

3.7 LCD display circuit… 26

3.8 Microcontroller and its associated circuits... 26

3.8.1 Minimum system and reset circuit of microcontroller... 26

3.8.2 Microcontroller clock circuit… 27

3.8.3 Button circuit… 27

3.8.4 Power module… 28

3.8.5 Alarm circuit… 28

3.8.6 Temperature detection circuit… 29

4. System software design... 29

4.1 Main program flow... 29

4.2 Subroutine design… 32

4.2.1 Ultrasonic ranging procedure… 32

4.2.2 Temperature measurement subroutine… 34

4.2.3 Display program… 37

4.2.4 Calculation procedure… 38

5. Debugging... 39

5.1 System hardware debugging… 39

5.2 System hardware debugging... 41

5.3 Static debugging… 41

5.4 System comprehensive debugging... 42

6 Summary 43

7. References... 43

8. Appendix… 45

Appendix A Program List... 45

Appendix B Ultrasonic ranging circuit schematic diagram... 57

Appendix C PCB schematic diagram and physical diagram... 58

Design instructions and design documents

Please add image description
Please add image description
Please add image description
Please add image description
Please add image description
Please add image description

Source code display

 图4.4 DS18B20测温程序流程图
/*------------------------------------------------
                    18b20初始化
------------------------------------------------*/
bit Init_DS18B20(void)
{
	bit dat=0;
	DQ = 1;    				//DQ复位
 	DelayUs2x(5);   		//稍做延时
 	DQ = 0;         		//单片机将DQ拉低
 	DelayUs2x(200); 		//精确延时 大于 480us 小于960us
 	DelayUs2x(200);
 	DQ = 1;        			//拉高总线
 	DelayUs2x(50); 			//15~60us 后 接收60-240us的存在脉冲
 	dat=DQ;        			//如果x=0则初始化成功, x=1则初始化失败
 	DelayUs2x(25); 			//稍作延时返回
 	return dat;
}
/*------------------------------------------------
                    读取一个字节
------------------------------------------------*/
unsigned char ReadOneChar(void)
{
	unsigned char i=0;
	unsigned char dat = 0;
	for (i=8;i>0;i--)
 	{
  		DQ = 0; 			// 给脉冲信号
  		dat>>=1;
  		DQ = 1; 			// 给脉冲信号
  		if(DQ)
   		dat|=0x80;
  		DelayUs2x(25);
 	}
 	return(dat);
}
/*------------------------------------------------
                    写入一个字节
------------------------------------------------*/
void WriteOneChar(unsigned char dat)
{
 	unsigned char i=0;
 	for (i=8; i>0; i--)
 	{
  		DQ = 0;
  		DQ = dat&0x01;
  		DelayUs2x(25);
  		DQ = 1;
  		dat>>=1;
 	}
	DelayUs2x(25);
}
/*------------------------------------------------
                    读取温度
------------------------------------------------*/
unsigned int ReadTemperature(void)
{
	unsigned char a=0;
	int b=0;
	int t=0;
	float tt=0;
	while(Init_DS18B20()); 	//检测初始化是否成功
	WriteOneChar(0xCC); 	// 跳过读序号列号的操作
	WriteOneChar(0x44); 	// 启动温度转换
	DelayMs(10);
	Init_DS18B20();
	WriteOneChar(0xCC); 	//跳过读序号列号的操作 
	WriteOneChar(0xBE); 	//读取温度寄存器等(共可读9个寄存器) 前两个就是温度
	a=ReadOneChar();   		//低位
	b=ReadOneChar();   		//高位
	t=b;
 	t<<=8;
 	t=t|a;
 	tt=t*0.0625;
 	t= tt*10+0.5; 
 	return(t);
}

Guess you like

Origin blog.csdn.net/cqtianxingkeji/article/details/135012019