CN115113210A - Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof - Google Patents

Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof Download PDF

Info

Publication number
CN115113210A
CN115113210A CN202210632217.9A CN202210632217A CN115113210A CN 115113210 A CN115113210 A CN 115113210A CN 202210632217 A CN202210632217 A CN 202210632217A CN 115113210 A CN115113210 A CN 115113210A
Authority
CN
China
Prior art keywords
ultrasonic
chip microcomputer
distance
pin
nixie tube
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210632217.9A
Other languages
Chinese (zh)
Inventor
石小龙
王智超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yancheng Institute of Technology
Original Assignee
Yancheng Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yancheng Institute of Technology filed Critical Yancheng Institute of Technology
Priority to CN202210632217.9A priority Critical patent/CN115113210A/en
Publication of CN115113210A publication Critical patent/CN115113210A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S15/00Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
    • G01S15/02Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems using reflection of acoustic waves
    • G01S15/06Systems determining the position data of a target
    • G01S15/08Systems for measuring distance only
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S15/00Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
    • G01S15/88Sonar systems specially adapted for specific applications
    • G01S15/93Sonar systems specially adapted for specific applications for anti-collision purposes
    • G01S15/931Sonar systems specially adapted for specific applications for anti-collision purposes of land vehicles
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • General Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Automation & Control Theory (AREA)
  • Measurement Of Velocity Or Position Using Acoustic Or Ultrasonic Waves (AREA)

Abstract

The invention provides an automobile reversing ultrasonic distance meter based on a 51-single-chip microcomputer and a distance measuring method thereof in the technical field of ultrasonic distance meters, and the ultrasonic distance meter comprises an ultrasonic distance measuring module, the single-chip microcomputer and a working module, wherein the ultrasonic distance measuring module is in electric signal connection with the single-chip microcomputer, the single-chip microcomputer is connected with a power supply, and comprises a reset circuit and a crystal oscillator circuit for the single-chip microcomputer to work; the working module comprises a nixie tube used for displaying a circuit, a buzzer used for alarming and a key, the single chip microcomputer is respectively connected with the nixie tube, the buzzer and the key through electric signals, a driver is connected to the single chip microcomputer, and the driver is connected with the nixie tube. The invention can effectively measure the distance between the obstacle and the tail of the vehicle, and sends out an alarm to prompt the driver in real time according to the distance measured, thereby successfully solving the problem that the driver needs to continuously visit the obstacle from left to right when parking, and improving the safety when driving.

Description

Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof
Technical Field
The invention relates to the technical field of ultrasonic distance measuring instruments, in particular to an automobile reversing ultrasonic distance measuring instrument based on a 51 single chip microcomputer and a distance measuring method thereof.
Background
With the continuous development of computers and automation technology, the position of ranging technology in modern industry is more and more important. For example, in the processing operation of a modern assembly line, a worker needs to quickly detect whether a large quantity of part products on the assembly line meet the size requirement, and the traditional contact type distance measuring instrument not only consumes a long time, but also has low measuring accuracy and complex steps. With the rapid progress of scientific technology, in order to meet the needs of industrial development, a non-contact ranging technology is developed and then applied to a detection instrument for sure and succeeded.
The development of non-contact distance measuring instruments has reached the present, and three common non-contact distance measuring instruments are mainly developed.
Compared with laser and radar range finders, the ultrasonic range finder has the following advantages:
1. the ultrasonic wave is insensitive to common external factors such as color, illuminance and electromagnetic field, so that the adaptability is strong and the application range is wide;
2. the propagation speed of the ultrasonic wave is lower than that of the optical wave, and the energy dissipation speed is low during propagation, so that the ultrasonic wave can be directly applied to the measurement of the distance between a near target;
3. the ultrasonic range finder has the advantages of simple structure, small size, convenience in carrying, low manufacturing cost, simple and reliable information processing, easiness in integration and capability of realizing real-time control.
Because of the above advantages, the ultrasonic ranging apparatus is widely used in industry as one of non-contact measurement systems, and can be seen in aspects of obstacle avoidance by robots, industrial automatic processing detection, automobile backing and automatic driving, intelligent blind guiding systems, measurement of liquid level position in reservoirs, geophysical well logging, and the like.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide an automobile reversing ultrasonic distance meter based on a 51 single chip microcomputer and a distance measuring method thereof.
The ultrasonic distance measuring instrument for automobile reversing based on the 51 single-chip microcomputer comprises an ultrasonic distance measuring module, the single-chip microcomputer and a working module, wherein the ultrasonic distance measuring module is in electric signal connection with the single-chip microcomputer, the single-chip microcomputer is connected with a power supply, and the single-chip microcomputer comprises a reset circuit and a crystal oscillator circuit for working of the single-chip microcomputer;
the working module comprises a nixie tube for displaying a circuit, a buzzer for alarming and a key, the single chip microcomputer is respectively connected with the nixie tube, the buzzer and the key through electric signals, a driver is connected to the single chip microcomputer, and the driver is connected with the nixie tube.
In some embodiments, the ultrasonic ranging module adopts HC-SR04, and the ultrasonic ranging module includes a control circuit, an ultrasonic transmitter, and an ultrasonic receiver, where the control circuit is connected to the ultrasonic transmitter and the ultrasonic receiver, respectively, and the ultrasonic ranging module can detect an obstacle at a distance of 2cm to 4m, and the ranging accuracy of the ultrasonic ranging module is 3 mm.
In some embodiments, the single chip microcomputer is AT89S52 of a CMOS8 bit single chip microcomputer, the single chip microcomputer includes a basic operating condition pin, an input/output pin, and a control pin, the basic operating condition pin includes a power supply pin, a reset pin, and a clock pin, the power supply pin includes a power supply positive pin and a power supply negative pin, 40 pins of the single chip microcomputer are the power supply positive pin, 20 pins of the single chip microcomputer are the power supply negative pin, the reset circuit is electrically connected to the internal of the single chip microcomputer through the reset pin, the clock pin includes 18 pins and 19 pins of the single chip microcomputer, I/O pins of the single chip microcomputer are four sets of interfaces P0 to P3, each set of interfaces includes 8 pins for connection, and the control pin includes 29 pins, 30 pins, and 31 pins of the single chip microcomputer.
In some embodiments, the nixie tube is a common-anode nixie tube, and the nixie tube is composed of 7 segments of LED nixie tubes integrated into a whole, the nixie tube has 8 ports, a signal output from a P1 port of the single chip microcomputer is responsible for controlling the 8 ports of the nixie tube, and the nixie tube adopts dynamic scanning display;
the buzzer is an electromagnetic buzzer, a PNP type triode is arranged in a driving circuit of the buzzer, the triode amplifies the driving current output by the singlechip, and the triode controls the buzzer to give out and stop alarm sound; the keys are independent keyboards, the independent keyboards adopt time delay function keys to remove jitter, one ends of normally open keys of the independent keyboards are grounded, and the other ends of the normally open keys of the independent keyboards are connected with an I/O port.
In some embodiments, the power supply is a 5V dc regulated power supply.
The invention also provides a distance measuring method of the automobile reversing ultrasonic distance meter based on the 51 single chip microcomputer, which comprises the following steps: step 1, starting an ultrasonic distance meter, and carrying out initialization setting on the ultrasonic distance meter;
step 2, calling a display subprogram, and enabling the ultrasonic ranging module to carry out ranging to judge whether an obstacle exists or not;
step 3, if the obstacle does not exist, returning to the step 1; if the obstacle exists, the measured distance value of the ultrasonic ranging module is calculated through the single chip microcomputer;
and 4, reflecting the distance obtained through processing by the nixie tube, setting the range of the safe distance by a user through a key, and sending an audible and visual alarm prompt by a buzzer and LED light when the measured value exceeds the warning distance, so that the work of the ultrasonic range finder is finished.
In some embodiments, in step 3, the distance measuring method of the ultrasonic distance measuring module specifically includes the following steps:
step 3-1, the system provides a high level with duration of at least 0.01 millisecond to an I/O port TRIG of the ultrasonic ranging module, so that the ultrasonic ranging module starts ranging;
step 3-2, after ranging starts, the ultrasonic ranging module can emit a plurality of square waves with the same frequency to the outside through the vibration of the wafer, and the system can repeatedly detect whether ultrasonic signals reflected back due to the fact that the ultrasonic signals touch obstacles or not at a higher frequency;
and 3-3, if the ECHO signal is detected, the I/O port ECHO of the ultrasonic ranging module externally outputs a high-level signal with the duration of the ultrasonic wave from the emission time to the return time, and the system can calculate the distance to be measured according to the duration of the high level and the speed of the ultrasonic wave.
In some embodiments, in step 4, reflecting the processed distance through the nixie tube specifically includes the following steps: step 1, the nixie tube starts to work, and processed data are transmitted to the nixie tube through the single chip microcomputer;
and 2. when the CPU sends the character codes to the field output port, all nixie tubes receive the same character codes, whether the lightened nixie tubes depend on the common electrode (COM end) of the nixie tubes, the COM end is connected with the I/O port of the singlechip, the nixie tube display circuit processes the distance result obtained by the singlechip, and the nixie tubes stop working.
In some embodiments, in step 4, the step of setting the range of the safe distance by the user through the key specifically includes the following steps: step 1, pressing the key to set a safety distance and setting an upper limit of the safety distance;
step 2, after the upper limit of the safe distance is set, pressing the key to set the safe distance and setting the lower limit of the safe distance;
and 3, after the lower limit of the safety distance is set, pressing the key again to finish the key operation.
In some embodiments, after the ultrasonic range finder is powered on for a period of time, the ranging system works normally, at this time, if a reset key is pressed, the reset circuit starts to work, the capacitor is short-circuited by the reset key, the current sent by the power supply does not charge the capacitor any more, and the capacitor releases the internal stored electric quantity before starting to enable the voltage at two ends of the capacitor to be lower than 1.5V again, so that the voltage at two ends of the resistor is larger than 3.5V, and therefore, a reset pin is changed from a low-level signal to a high-level signal when the system works normally, so that the single chip microcomputer system starts to reset.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention takes a singlechip as a core, is assisted by a buzzer alarm circuit, a reset circuit, an LED digital tube display circuit and the like to form the singlechip, and after an operator switches on a power supply and presses a main switch, the HC-SR04 ultrasonic ranging module on the system emits ultrasonic waves to detect obstacles, then the reflected ultrasonic signals are transmitted to the 51 single chip microcomputer through a line to be analyzed and processed, the single chip microcomputer sends the obtained results to the LED nixie tube in an electric signal mode after processing the information, the distance measured is displayed to the operator by lighting the nixie tube, besides the basic function, the system can also manually adjust the safety distance between the nixie tube and the obstacle, if the distance calculated by the single chip microcomputer exceeds the range, the system can automatically send out an acousto-optic alarm to prompt related personnel to notice, and the distance measurement accuracy of the whole ultrasonic distance meter is improved;
2. the invention can effectively measure the distance between the obstacle and the tail of the vehicle, and send out an alarm to prompt the driver according to the distance measured, thereby successfully solving the problem that the driver needs to continuously visit the obstacle from left to right when parking, and improving the safety when driving;
3. the ultrasonic ranging module selected by the invention is HC-SR04, the miniaturization, the part area for transmitting and receiving ultrasonic waves are small, the ranging module and the barrier are positioned on the same horizontal line, the route through which the ultrasonic waves pass is the route in actual measurement, the measurement accuracy is improved, and the LED lamp is arranged, so that a user can conveniently observe and test.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a schematic structural diagram of an automobile reversing ultrasonic distance meter based on a 51-chip microcomputer;
FIG. 2 is a schematic diagram of the pin arrangement and external bus structure of the single chip microcomputer according to the present invention;
FIG. 3 is a block diagram of the internal structure of the single-chip microcomputer of the present invention;
FIG. 4 is a circuit diagram of the reset circuit of the present invention;
FIG. 5 is a circuit diagram of a crystal oscillator circuit according to the present invention;
FIG. 6 is a schematic diagram of a display circuit of the nixie tube of the present invention;
FIG. 7 is a schematic circuit diagram of a key of the present invention;
FIG. 8 is a distance measuring flow chart of the ultrasonic distance meter for automobile backing based on 51 SCM of the present invention;
FIG. 9 is a flow chart illustrating a display data subroutine according to the present invention;
FIG. 10 is a flow chart illustrating a key subroutine according to the present invention;
FIG. 11 is a simulation operation diagram of the ultrasonic distance meter for automobile backing based on 51 SCM of the present invention for detecting that the distance does not exceed the safe distance;
FIG. 12 is a simulation operation diagram of the ultrasonic distance meter for automobile backing based on 51 SCM for detecting the exceeding of the safe distance.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Fig. 1 is a schematic structural diagram of an automobile reversing ultrasonic distance meter based on a 51-chip microcomputer, and the ultrasonic distance meter comprises an ultrasonic distance measuring module, the chip microcomputer and a working module, wherein the ultrasonic distance measuring module is electrically connected with the chip microcomputer, the chip microcomputer is connected with a power supply, and the chip microcomputer comprises a reset circuit and a crystal oscillator circuit for the chip microcomputer to work; the working module comprises a nixie tube used for displaying a circuit, a buzzer used for alarming and a key, the single chip microcomputer is respectively connected with the nixie tube, the buzzer and the key through electric signals, a driver is connected to the single chip microcomputer, and the driver is connected with the nixie tube. In the embodiment, a 5V direct current stabilized power supply is adopted as the power supply.
The ultrasonic ranging module adopts HC-SR04, and the ultrasonic ranging module includes control circuit, ultrasonic transmitter and ultrasonic receiver, and control circuit is connected the setting with ultrasonic transmitter, ultrasonic receiver respectively, and the ultrasonic ranging module can detect the barrier of 2cm-4m department, and the range finding precision of ultrasonic ranging module is 3 millimeters.
Fig. 2 is a schematic diagram showing a pin arrangement and an external bus of a single chip microcomputer, fig. 3 is a block diagram showing an internal structure of the single chip microcomputer, the single chip microcomputer is AT89S52 of a CMOS 8-bit single chip microcomputer, the single chip microcomputer includes a basic working condition pin, an input/output pin and a control pin, the basic working condition pin includes a power supply pin, a reset pin and a clock pin, the power supply pin includes a power supply positive electrode pin and a power supply negative electrode pin, 40 pins of the single chip microcomputer are the power supply positive electrode pin, 20 pins of the single chip microcomputer are the power supply negative electrode pin, a reset circuit is connected with an internal electric signal of the single chip microcomputer through the reset pin, the clock pin is 18 pins and 19 pins of the single chip microcomputer, I/O pins of the single chip microcomputer are four groups of interfaces P0 to P3, each group of interfaces includes 8 pins for connection, and the control pin is 29 pins, 30 pins and 31 pins of the single chip microcomputer.
The single chip microcomputer system mainly has two reset operations of power-on reset and reset by pressing a reset key. The working process of power-on reset is as follows: when the single chip microcomputer system is just electrified, the voltage at two ends of the capacitor is 0V, and after the single chip microcomputer system is electrified, the direct current power supply with the voltage of 5V charges the capacitor. The voltage across the capacitor rises from 0V to about 3.5V in a time (generally less than 0.3 second) that the capacitor charges to 0.7 times the supply voltage, so that the voltage across the resistor drops from the supply voltage to the voltage at the high-low level boundary, and the voltage received at the RST pin is synchronous with the voltage on the resistor, and therefore drops from 5V to 1.5V. In the process, the reset pin receives high level, so that the system is automatically reset.
As shown in fig. 4, the circuit diagram of the reset circuit is shown, after the ultrasonic range finder is powered on for a period of time, the ranging system works normally, if the reset key is pressed at this moment, the reset circuit starts to work, the capacitor is short-circuited by the reset key, the current sent by the power supply does not charge the capacitor any more, the capacitor starts to release the internal stored electric quantity, so that the voltage at two ends of the capacitor is lower than 1.5V again, the voltage at two ends of the resistor is larger than 3.5V, the reset pin is changed from a low level signal to a high level signal when the system works normally, and the single chip microcomputer system starts to reset.
Fig. 5 is a schematic circuit diagram of a crystal oscillator circuit, which is a crystal oscillator for short and is used to provide a clock signal, i.e., a working signal pulse to control the operation of the system, and the pulse determines the working frequency of the single chip. The crystal oscillator circuit can ensure that the singlechip system works well and orderly, and if the crystal oscillator runs unstably or does not have the crystal oscillator, all parts of the system can not be synchronized normally when the distance measurement is carried out, so that the result is wrong. The main components of the crystal oscillator circuit comprise a crystal oscillator and two capacitors, wherein the two capacitors are not used for distinguishing a positive pole and one end connected with the two ceramic chip capacitors needs to be grounded. In order to reduce the influence of harmonic waves generated by an oscillation circuit on the stability of the whole circuit as much as possible in a single chip microcomputer system, two ceramic chip capacitors between 10pf and 50pf are selected to be connected with two pins of a crystal oscillator.
As shown in fig. 6, the display circuit schematic diagram of the nixie tube is a common-anode nixie tube, the nixie tube is composed of 7 LED nixie tubes which are integrated into a whole, the nixie tube has 8 ports, signals output from the P1 port of the single chip microcomputer are responsible for controlling the 8 ports of the nixie tube, and the nixie tube adopts dynamic scanning display. The dynamic scanning display is performed in a similar mode of lighting a water lamp, and the COM ends of all the nixie tubes are controlled in turn through the I/O ports, so that all the nixie tubes can be lighted in turn instead of lighting all the nixie tubes at the same time. In the process of bit scanning, each nixie tube can be instantly lightened and then extinguished only by a singlechip, which is a high-speed dynamic process. Because the image formed by the light signal generated by the light-emitting diode in the human brain stays for a short time (i.e. afterglow effect), the nixie tube is not lighted at the same time, but feels a group of stable display numbers. In all scanning display modes, dynamic scanning display is the most applied one in a single chip microcomputer system, and the reason is that in the process of continuously displaying data, only one digital light is lightened by the single chip microcomputer whenever, so that occupied I/O interface lines are few, and the power consumption and the burden of the system are effectively reduced.
The buzzer is an electromagnetic buzzer, and the working principle of the electromagnetic buzzer is that current passes through an electromagnetic coil, so that a magnetic field generated by the electromagnetic coil interacts with a magnetic field of a magnet per se to excite a vibrating diaphragm to periodically vibrate, and an alarm sound is emitted. A necessary condition for the buzzer to be able to sound an alarm is to supply it with current. A PNP type triode is arranged in a driving circuit of the buzzer, the triode amplifies driving current output by the singlechip and controls the buzzer to give out and stop alarm sound.
As shown in fig. 7, the circuit diagram of the key is shown, the key is an independent keyboard, one end of a normally open key of the independent keyboard is grounded, and the other end of the normally open key of the independent keyboard is connected to the I/O port. When the program starts to run, the state of the I/O port is high level, and the key is not closed. When the key is pressed, the I/O port is directly connected with the ground, so that the I/O port becomes low level. After the key is released, the voltage at two ends of the pull-up resistor in the singlechip enables the I input/output port to be restored from low level to high level.
The independent keyboard adopts a time delay function key to remove jitter, when the key is pressed by an operator, a system does not immediately detect whether the key is a closed level or not, but immediately executes a time delay program, and the time delay program generally delays for 10-200 milliseconds to avoid key jitter. After the delay is finished, the system detects the level state of the key again, if the level at the key does not change as the previous state, the key is considered to be pressed actually and is not caused by shaking, and then the system calls the next processing procedure.
As shown in fig. 8, which is a distance measuring flow chart of the ultrasonic distance meter for automobile backing based on 51 scm, the distance measuring method of the ultrasonic distance meter for automobile backing based on 51 scm includes the following steps: step 1, starting an ultrasonic distance meter, and carrying out initialization setting on the ultrasonic distance meter;
step 2, calling a display subprogram, ranging by an ultrasonic ranging module, and judging whether an obstacle exists or not;
step 3, if the obstacle does not exist, returning to the step 1; if the obstacle exists, the measured distance value of the ultrasonic ranging module is calculated through the single chip microcomputer;
and 4, reflecting the distance obtained through processing by a nixie tube, setting the range of the safe distance by a user through a key, and sending an audible and visual alarm prompt by a buzzer and LED light when the measured value exceeds the warning distance, so that the work of the ultrasonic range finder is finished.
In step 3, the distance measuring method of the ultrasonic distance measuring module specifically includes the following steps: step 3-1, the system provides a high level with duration of at least 0.01 millisecond to an I/O port TRIG of the ultrasonic ranging module, so that the ultrasonic ranging module starts ranging;
step 3-2, after ranging starts, the ultrasonic ranging module can emit a plurality of square waves with the same frequency to the outside through the vibration of the wafer, and the system can repeatedly detect whether ultrasonic signals reflected back due to the fact that the ultrasonic signals touch obstacles or not at a higher frequency;
and 3-3, if the ECHO signal is detected, the I/O port ECHO of the ultrasonic ranging module externally outputs a high-level signal with the duration of the ultrasonic wave from the emission time to the return time, and the system can calculate the distance to be measured according to the duration of the high level and the speed of the ultrasonic wave.
As shown in fig. 9, which is a schematic flow chart of the data displaying subroutine, in step 4, the step of reflecting the distance obtained by processing through the nixie tube specifically includes the following steps: step 1, the nixie tube starts to work, and processed data are transmitted to the nixie tube through the single chip microcomputer;
and 2. when the CPU sends the character codes to the field output port, all the nixie tubes receive the same character codes, and whether the lighted nixie tubes depend on the common pole (COM end) of the nixie tubes, the COM end is connected with the I/O port of the singlechip, and when the digital tubes are lighted by the system, the digital tubes depend on the bit selection codes sent to the input output port. The nixie tube display circuit processes the distance result obtained by the singlechip, and the nixie tube stops working.
As shown in fig. 10, which is a schematic flow chart of the key subprogram, in step 4, the step of setting the range of the safe distance by the user through a key specifically includes the following steps: step 1, pressing a key to set a safety distance and setting an upper limit of the safety distance;
step 2, after the upper limit of the safe distance is set, pressing a key to set the safe distance, and setting the lower limit of the safe distance;
and 3, after the lower limit of the safety distance is set, pressing the key again to finish the key operation.
The simulation operation of the ultrasonic distance measuring instrument designed at this time is performed on a proteus 8, and fig. 11 shows that when the distance value measured by the system is within the safe distance range, it can be seen that the system is normally operated and no alarm is given.
The function of each key is described in detail below:
s1: upper and lower limits on the system safety distance (i.e., the distance at which an alarm will not be triggered) may be set.
S2: the safety distance is reduced.
S3: the safety distance is increased.
S4: and a reset key of the system is pressed, and the system is restored to the initial state.
S5: the measured distance is shortened.
S6: the measured distance is increased.
Because the simulation operation diagram of the system cannot actually measure the distance between the system and the obstacle like a single chip microcomputer product, S5 keys and S6 keys are arranged to simulate the distance measurement situation in the implementation.
U3: is an ultrasonic ranging module which is responsible for transmitting and receiving ultrasonic signals and transmitting the ultrasonic signals to a singlechip
Fig. 12 shows that when the measured distance exceeds the set safe distance, the system will sound a buzzer and light an LED to indicate to the driver.
Those skilled in the art will appreciate that, in addition to implementing the systems, apparatus, and various modules thereof provided by the present invention in purely computer readable program code, the same procedures can be implemented entirely by logically programming method steps such that the systems, apparatus, and various modules thereof are provided in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system, the device and the modules thereof provided by the present invention can be considered as a hardware component, and the modules included in the system, the device and the modules thereof for implementing various programs can also be considered as structures in the hardware component; modules for performing various functions may also be considered to be both software programs for performing the methods and structures within hardware components.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (10)

1. A51-singlechip-based automobile reversing ultrasonic distance meter is characterized by comprising an ultrasonic distance measuring module, a singlechip and a working module, wherein the ultrasonic distance measuring module is in electric signal connection with the singlechip, the singlechip is connected with a power supply, and the singlechip comprises a reset circuit and a crystal oscillator circuit for working of the singlechip;
the working module comprises a nixie tube for displaying a circuit, a buzzer for alarming and a key, the single chip microcomputer is respectively connected with the nixie tube, the buzzer and the key through electric signals, a driver is connected to the single chip microcomputer, and the driver is connected with the nixie tube.
2. The ultrasonic distance meter for automobile reversing based on 51 single chip microcomputer according to claim 1, wherein the ultrasonic distance measuring module adopts HC-SR04, the ultrasonic distance measuring module includes a control circuit, an ultrasonic transmitter and an ultrasonic receiver, the control circuit is respectively connected with the ultrasonic transmitter and the ultrasonic receiver, the ultrasonic distance measuring module can detect an obstacle at 2cm-4m, and the distance measuring precision of the ultrasonic distance measuring module is 3 mm.
3. The ultrasonic distance meter for automobile reversing based on 51-chip microcomputer according to claim 2, wherein the chip microcomputer is AT89S52 of a CMOS8 bit chip microcomputer, the chip microcomputer includes a basic operating condition pin, an input/output pin and a control pin, the basic operating condition pin includes a power supply pin, a reset pin and a clock pin, the power supply pin includes a power supply positive electrode pin and a power supply negative electrode pin, 40 pins of the chip microcomputer are the power supply positive electrode pin, 20 pins of the chip microcomputer are the power supply negative electrode pin, the reset circuit is electrically connected with the inside of the chip microcomputer through the reset pin, the clock pin is 18 pins and 19 pins of the chip microcomputer, I/O pins of the chip microcomputer are four groups of interfaces P0 to P3, each group of the interfaces includes 8 pins for connection, and the control pin is 29 pins, a pin of the chip microcomputer, 30 feet and 31 feet.
4. The ultrasonic automobile reversing distance meter based on the 51-chip microcomputer according to claim 3, wherein the nixie tube is a common anode nixie tube, the nixie tube is composed of 7 segments of LED nixie tubes which are integrated into a whole, the nixie tube has 8 ports, a signal output by a P1 port of the single-chip microcomputer is responsible for controlling the 8 ports of the nixie tube, and the nixie tube adopts dynamic scanning display;
the buzzer is an electromagnetic buzzer, a PNP type triode is arranged in a driving circuit of the buzzer, the triode amplifies the driving current output by the singlechip, and the triode controls the buzzer to give out and stop alarm sound; the keys are independent keyboards, the independent keyboards adopt time delay function keys to remove jitter, one ends of normally open keys of the independent keyboards are grounded, and the other ends of the normally open keys of the independent keyboards are connected with an I/O port.
5. The ultrasonic distance meter for automobile backing based on 51 SCM of claim 1 wherein the power supply adopts 5V DC regulated power supply.
6. A distance measuring method of a 51-singlechip-based automobile reversing ultrasonic distance meter according to any one of claims 1-5, characterized by comprising the following steps: step 1, starting an ultrasonic distance meter, and carrying out initialization setting on the ultrasonic distance meter;
step 2, calling a display subprogram, wherein the ultrasonic ranging module is used for ranging and judging whether an obstacle exists or not;
step 3, if the obstacle does not exist, returning to the step 1; if the obstacle exists, the measured distance value of the ultrasonic ranging module is calculated through the single chip microcomputer;
and 4, reflecting the distance obtained through processing by the nixie tube, setting the range of the safe distance by a user through a key, and sending an audible and visual alarm prompt by a buzzer and LED light when the measured value exceeds the warning distance, so that the work of the ultrasonic range finder is finished.
7. The distance measuring method of the ultrasonic distance meter for automobile backing based on the 51-chip microcomputer according to claim 6, wherein in the step 3, the distance measuring method of the ultrasonic distance measuring module specifically comprises the following steps: step 3-1, the system provides a high level with duration of at least 0.01 millisecond to an I/O port TRIG of the ultrasonic ranging module, so that the ultrasonic ranging module starts ranging;
step 3-2, after ranging starts, the ultrasonic ranging module can emit a plurality of square waves with the same frequency to the outside through the vibration of the wafer, and the system can repeatedly detect whether ultrasonic signals reflected back due to the fact that the ultrasonic signals touch obstacles or not at a higher frequency;
and 3-3, if the ECHO signal is detected, the I/O port ECHO of the ultrasonic ranging module externally outputs a high-level signal with the duration of the ultrasonic wave from the emission to the return, and the system can calculate the distance to be measured according to the duration of the high level and the speed of the ultrasonic wave.
8. The distance measuring method of claim 7, wherein the step 4 of reflecting the distance obtained by processing through the nixie tube specifically comprises the following steps: step 1, the nixie tube starts to work, and processed data are transmitted to the nixie tube through the single chip microcomputer;
and 2. when the CPU sends the character codes to the field output port, all nixie tubes receive the same character codes, whether the lightened nixie tubes depend on the common electrode (COM end) of the nixie tubes, the COM end is connected with the I/O port of the singlechip, the nixie tube display circuit processes the distance result obtained by the singlechip, and the nixie tubes stop working.
9. The distance measuring method of the ultrasonic distance meter for automobile backing based on the 51-chip microcomputer according to claim 8, wherein in the step 4, the step of setting the range of the safe distance by the user through the key specifically comprises the following steps: step 1, pressing the key to set a safety distance and setting an upper limit of the safety distance;
step 2, after the upper limit of the safe distance is set, pressing the key to set the safe distance and setting the lower limit of the safe distance;
and 3, after the lower limit of the safety distance is set, pressing the key again to finish the key operation.
10. The method as claimed in claim 6, wherein after the ultrasonic range finder is powered on for a period of time, the range finder system operates normally, and at this time, if the reset key is pressed, the reset circuit starts to operate, the capacitor is short-circuited by the reset key, the current from the power supply does not charge the capacitor any more, and the capacitor releases the stored electric quantity before the capacitor starts to release, so that the voltage across the capacitor is again lower than 1.5V, and the voltage across the resistor is higher than 3.5V, so that the reset pin changes from a low level signal to a high level signal when the system operates normally, and the single chip microcomputer system starts to reset.
CN202210632217.9A 2022-06-06 2022-06-06 Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof Withdrawn CN115113210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210632217.9A CN115113210A (en) 2022-06-06 2022-06-06 Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210632217.9A CN115113210A (en) 2022-06-06 2022-06-06 Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof

Publications (1)

Publication Number Publication Date
CN115113210A true CN115113210A (en) 2022-09-27

Family

ID=83326803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210632217.9A Withdrawn CN115113210A (en) 2022-06-06 2022-06-06 Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof

Country Status (1)

Country Link
CN (1) CN115113210A (en)

Similar Documents

Publication Publication Date Title
US9036453B2 (en) Obstacle detection device
US4327360A (en) Alarm device responsive to movement of protected object, power source condition and alarm ground path
RU2018136756A (en) LOGIC FOR IDENTIFICATION OF FAILURES IN THE OUTDOOR MONITOR OF READY TO WORK FOR THE AUTOMATIC OUTDOOR DEFIBRILLATOR (AND)
US5539160A (en) Coordinate input apparatus and method
US4524356A (en) Obstacle detecting device for vehicles
EP0220877A1 (en) Fail-safe sensor system
CN115113210A (en) Automobile reversing ultrasonic range finder based on 51 single chip microcomputer and range finding method thereof
CN104849719A (en) Laser radar ranging system
JPH0667793A (en) Coordinate input device
CN104656088A (en) Ultrasonic automobile anti-collision system having temperature compensation function and adopting pulse counting
CN104656087A (en) Ultrasonic automobile collision avoidance system adopting pulse counting
CN103273873A (en) Automobile anti-glare system
JP4139226B2 (en) Method for operating a position measuring device and a position measuring device suitable for this method
CN203178302U (en) Automatic measurement device for driving speeds of industrial vehicle
CN206420532U (en) A kind of contactless liquid level monitoring alarm device based on laser ranging
Li et al. High precision laser ranging based on STM32 microcontroller
KR100390181B1 (en) The control system for signal light
CN205486694U (en) Electron device of TV is closely watched in prevention
CN108983244A (en) A kind of Ultrasonic Range Finder for Parking auxiliary system
CN117347977A (en) Infrared distance measurement sensor control circuit
JP3765134B2 (en) Instantaneous power failure detection device
CN110109183B (en) Sensing device for detecting object proximity
CN106114214A (en) A kind of intelligent car-backing CAS
CN109061587A (en) A kind of radar host computer test macro
KR0181534B1 (en) Computer having monitoring apparatus of cpu

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220927