7-Ultrasonic distance measurement and temperature compensation based on 51 single chip microcomputer

Publisher:chang_riLatest update time:2021-09-24 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Specific implementation functions

The system consists of STC89C52 microcontroller + ultrasonic distance sensor (HC-SR04) + DS18B20 temperature sensor + LCD1602 liquid crystal display + button + buzzer + power supply


Specific functions: 1. LCD1602 liquid crystal displays the measured distance and temperature;


2. The measuring range is 0.02m~4m, and the accuracy is 0.01m;


3. You can set the upper and lower limits of the distance alarm; button functions: plus key, minus key, set key


4. If the alarm value exceeds the set upper and lower limits, the sound and light alarm will start.

design background

The rapid rise and vigorous development of single-chip microcomputer technology has outstanding advantages such as stability, safety, efficiency and economy, so its application is also very extensive. Single-chip microcomputers are already everywhere, closely related to our lives, and have penetrated into all aspects of life, such as air conditioners, VCD machines, mobile phones, microwave ovens, automatic washing machines and automotive electronic equipment. The characteristics of single-chip microcomputers are small size, that is, their integrated characteristics. Their internal structure is a simplification of ordinary computer systems. By adding some peripheral circuits, a complete small system can be formed. Single-chip microcomputers have strong scalability. It has powerful data processing functions similar to ordinary computers. By using some scientific algorithms, it can obtain strong data processing capabilities. Therefore, single-chip microcomputers can greatly improve the intelligence, data processing capabilities and processing efficiency of industrial equipment in industrial applications, and single-chip microcomputers do not need to occupy a large space.


At the same time, with the development and progress of society, ultrasonic ranging systems are becoming increasingly important, and their application scope is rapidly expanding. Since ultrasonic ranging is a non-contact detection technology, it is not affected by light, the color of the object being measured, etc., and has a certain adaptability in harsh environments (such as dust), so it is extremely widely used. It is commonly used in surveying and mapping topographic maps, building houses, bridges, roads, excavating mines, oil wells, etc., reversing radars, construction sites, and some industrial sites, such as liquid level, well depth, pipeline length, etc. Ultrasonic detection is often faster, more convenient, simple to calculate, easy to achieve real-time control, and can meet industrial practical requirements in terms of measurement accuracy.


hardware design

The project "Ultrasonic Distance Measurement Based on Single Chip Microcomputer" consists of a 51 single chip microcomputer minimum system, an ultrasonic distance measurement module, a drive display circuit, a 5V DC voltage regulator circuit, a temperature sensor, etc. The ultrasonic distance measurement module HC-SR04 is used to measure the distance, and the data is analyzed and processed, transmitted to the 51 single chip microcomputer, and then displayed through LCD1602. At the same time, the power supply part uses a 5V DC voltage regulator.


software design

The main function of the main program is to display the distance, read out and process the measured distance value of HC-RS04, control the effective distance limit with buttons, and when the measured value exceeds the preset value, the buzzer will sound an alarm.


Schematic

The schematic diagram of this system was designed using Altium Designer19, as shown in the figure.

program

This design uses KEIL5 software to implement program design, as shown in the figure.

Simulation Implementation

This design uses protues8.7 software to implement simulation design, as shown in the figure.

Reference address:7-Ultrasonic distance measurement and temperature compensation based on 51 single chip microcomputer

Previous article:8-Badminton score counter based on 51 single chip microcomputer
Next article:6-PM2.5 detection and alarm system based on 51 single chip microcomputer

Latest Microcontroller 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号