Automobile multi-speed alarm device and method thereof
Technical Field
The invention relates to the technical field of automobile control, in particular to an automobile multi-speed alarm device and an automobile multi-speed alarm method.
Background
With the development of control technology, an ECU (electronic control unit) is installed on all the existing automobiles. The ECU is used for acquiring driving information such as vehicle speed in real time and giving a corresponding control instruction according to the operation of a driver. Although the driving computer can acquire and display the vehicle speed in real time, warning information cannot be given according to the vehicle speed limit.
Disclosure of Invention
The invention aims to provide an automobile multi-speed alarm device, which can overcome the defects of the prior art, can monitor the driving speed in real time and can alarm the overspeed behavior.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows.
A multi-speed alarm device for automobile comprises a single chip microcomputer, wherein a first pin of the single chip microcomputer is connected to a first switch, a second pin of the single chip microcomputer is connected to a second switch, a third pin of the single chip microcomputer is connected to a third switch, a fourth pin of the single chip microcomputer is connected to a fourth switch, a fifth pin of the single chip microcomputer is connected to a fifth switch, a sixth pin of the single chip microcomputer is connected to a sixth switch, a seventh pin of the single chip microcomputer is connected to a seventh switch, a twelfth pin of the single chip microcomputer is connected to a speed signal input end through a photoelectric isolator, the photoelectric isolator is connected to a high level through a sixteenth resistor, a fourteenth pin of the single chip microcomputer is connected to a ninth switch, a thirty-first pin of the single chip microcomputer is connected to a high level, an eighteenth pin and a nineteenth pin of the single chip microcomputer are connected to a crystal oscillator, the eighteenth pin and the nineteenth, a ninth pin of the singlechip is connected to a high level through an eighth switch and a fifth capacitor which are connected in parallel, a ninth pin of the singlechip is grounded through a fourteenth resistor, a twentieth pin of the singlechip is grounded, a thirty-ninth pin, a thirty-eighth pin, a thirty-seventh pin, a thirty-sixth pin, a thirty-fifth pin, a thirty-fourteenth pin, a thirty-third pin and a thirty-second pin of the singlechip are connected to a pull-up resistor, the thirty-ninth pin, the thirty-eighth pin, the thirty-seventh pin, the thirty-sixth pin, the thirty-fifth pin, the thirty-fourteenth pin, the thirty-third pin and the thirty-second pin of the singlechip are respectively connected to a display screen through a first resistor, a second resistor, a third resistor, a fourth resistor, a fifth resistor, a sixth resistor, a seventh resistor and an eighth resistor, the display screen is respectively connected to collectors of the first triode, the second triode, the third triode and the fourth triode, the emitting electrodes of the first triode, the second triode, the third triode and the fourth triode are connected to a high level, a twenty-fifth pin of the single chip microcomputer is connected to the base electrode of the fourth triode through a twelfth resistor, a twenty-sixth pin of the single chip microcomputer is connected to the base electrode of the third triode through an eleventh resistor, a twenty-seventh pin of the single chip microcomputer is connected to the base electrode of the second triode through a tenth resistor, a twenty-eighth pin of the single chip microcomputer is connected to the base electrode of the first triode through a ninth resistor, an eighth pin of the single chip microcomputer is connected to the base electrode of the fifth triode through a fifteenth resistor, the emitting electrode of the fifth triode is connected to the high level, and the collecting electrode of the fifth triode is connected to.
A multi-speed alarm method of an automobile is applied to the multi-speed alarm device of the automobile, and comprises the following steps:
the vehicle speed signal on the vehicle is obtained through the signal input end, the vehicle speed signal is transmitted to the single chip microcomputer after being subjected to photoelectric coupling, and the single chip microcomputer judges whether the vehicle speed signal is 0 or not and transmits a judgment result to the display screen for displaying; if the vehicle speed signal is 0, respectively setting at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h as a speed alarm signal, writing data into a single chip microcomputer, and storing the data in a power-down mode; if the vehicle speed signal is not 0, the single chip microcomputer loads data according to at least one of speed alarm signals of which the vehicle speed signal is greater than preset speed alarm signals of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h, and the single chip microcomputer converts the loaded speed alarm signals and sends the converted signals to the buzzer for alarming.
In a preferred embodiment of the present invention, after the power supply to the multi-speed alarm device of the vehicle is powered on and displayed, the single chip obtains no rotation speed signal in the vehicle 4s, that is, the speed signal is determined to be 0.
In a preferred embodiment of the present invention, if the vehicle speed signal is not 0, the method further includes: and switching the obtained vehicle speed signal into a mileage signal, so that the display screen is converted from speed display into mileage display.
In a preferred embodiment of the present invention, the setting at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h as the speed alarm signal comprises:
when the vehicle is in a stop state and no speed signal exists, the vehicle enters a setting mode according to a first switch, the second switch counts up, the third switch counts down, preset vehicle speed signals are respectively adjusted to be 60km/h, 80km/h, 100km/h, 110km/h and 120km/h through the second switch and the third switch, after a buzzer sounds sent by a buzzer is heard by pressing a fourth switch for more than one second, the speed alarm signal which indicates that the over-speed alarm setting is finished, and the initial value setting is finished.
In a preferred embodiment of the invention, when at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h is selected as an initial value and set, the seventh switch is toggled, and when the second switch is pressed down and buzzing sound is heard by the buzzer, the alarm setting of the speed alarm signal indicating that the speed signal is over-speed is finished, the seventh switch is toggled to the original position;
if the speed alarm signal needs to be changed, one of the seventh switch and the third switch, the seventh switch and the fourth switch, the seventh switch and the fifth switch, and the seventh switch and the sixth switch is simultaneously toggled to update the speed alarm signal as an initial value, and then the seventh switch is toggled back to the original position.
In the preferred embodiment of the present invention, the single chip sends the speed signal to the display screen for refreshing display every 0.5 seconds after processing and operation.
Adopt the beneficial effect that above-mentioned technical scheme brought to lie in: the invention can monitor the speed of the automobile and record the driving mileage of the automobile. The system can freely set various over-speed alarms, can be changed during parking and driving, and is convenient and quick.
Drawings
FIG. 1 is a main circuit diagram of an embodiment of the present invention.
Fig. 2 is a circuit diagram of a switching display section in an embodiment of the present invention.
Fig. 3 is a circuit diagram of an overspeed warning portion in one embodiment of the present invention.
Fig. 4 is a circuit diagram of a speed signal input section in an embodiment of the present invention.
FIG. 5 is a circuit diagram of the reset portion in one embodiment of the present invention.
Fig. 6 is a program flow diagram of one embodiment of the present invention.
Detailed Description
Referring to fig. 1 to 5, an embodiment of the present invention includes a single chip microcomputer U1, a first pin P10 of the single chip microcomputer U1 is connected to a first switch S1, a second pin P1 of the single chip microcomputer U1 is connected to a second switch S1, a third pin P1 of the single chip microcomputer U1 is connected to a third switch S1, a fourth pin P1 of the single chip microcomputer U1 is connected to a fourth switch S1, a fifth pin P1 of the single chip microcomputer U1 is connected to a fifth switch S1, a sixth pin P1 of the single chip microcomputer U1 is connected to a sixth switch S1, a seventh pin P1 of the single chip microcomputer U1 is connected to a seventh switch S1, a twelfth pin OUT of the single chip microcomputer U1 is connected to a speed signal input terminal through an isolator U1, the optoelectronic isolator U1 is connected to a high VCC, the optoelectronic isolator U1 is connected to a fourteenth pin P1 of the single chip microcomputer U1, the optoelectronic isolator 1 is connected to a high VCC level, the optoelectronic isolator 1 is connected to a ninth switch S1, the optoelectronic isolator 1 and the, an eighteenth pin and a nineteenth pin of the singlechip U1 are grounded through a fourth capacitor C4 and a third capacitor C3, respectively, a ninth pin RST of the singlechip U1 is connected to a high level VCC through an eighth switch S8 and a fifth capacitor C5 which are connected in parallel, a ninth pin RST of the singlechip U1 is grounded through a fourteenth resistor R14, a twentieth pin GND of the singlechip U1 is grounded, a thirty ninth pin P00, a thirty eighth pin P01, a thirty seventh pin P02, a thirty sixth pin P02, a thirty fifth pin P02, a thirty fourth pin P02, a thirty third pin P02 and a thirty second pin P02 of the singlechip U1 are connected to a pull-up resistor J02, and the thirty ninth pin P02, the thirty eighth pin P02, the thirty seventh pin P02, the thirty sixth pin P02, the thirty fifth pin P02, the thirty fourth pin P02, the thirty third pin P02, the thirty second resistor P02, the third pin P02, the thirty resistor R02, the fourth resistor P02, A second resistor R2, a third resistor R2, a fourth resistor R2, a fifth resistor R2, a sixth resistor R2, a seventh resistor R2 and an eighth resistor R2 are connected to the display screen DS 2, the display screen DS 2 is respectively connected to the collectors of a first transistor Q2, a second transistor Q2, a third transistor Q2 and a fourth transistor Q2, the emitters of the first transistor Q2, the second transistor Q2, the third transistor Q2 and the fourth transistor Q2 are connected to a high level VCC, a twenty-fifth pin P2 of the singlechip U2 is connected to the base of the fourth transistor Q2 through the twelfth resistor R2, a twenty-sixth pin P2 of the singlechip U2 is connected to the base of the third transistor Q2 through the eleventh resistor R2, a twenty-seventh pin P2 of the singlechip U2 is connected to the base of the second transistor Q2 through the tenth resistor R2, a twenty-eighth pin P2 of the singlechip U2 is connected to the ninth transistor Q2, an eighth pin P17 of the singlechip U1 is connected to a base of a fifth triode Q5 through a fifteenth resistor R15, an emitter of the fifth triode Q5 is connected to a high level VCC, and a collector of the fifth triode Q5 is connected to a buzzer T1.
Referring to fig. 6, based on the same inventive concept of the automotive multi-speed warning device of the embodiment of the present invention, there is also provided an automotive multi-speed warning method, including: the vehicle speed signal on the vehicle is obtained through the signal input end, the vehicle speed signal is transmitted to the single chip microcomputer U1 after being subjected to photoelectric coupling, the single chip microcomputer U1 judges whether the vehicle speed signal is 0 or not and transmits a judgment result to the display screen DS1 for displaying; if the vehicle speed signal is 0, respectively setting at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h as a speed alarm signal, writing data into a single chip microcomputer U1, and storing the data in a power-down mode; if the vehicle speed signal is not 0, the single chip microcomputer U1 loads data according to at least one of the preset speed alarm signals of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h of the vehicle speed signal, and the single chip microcomputer U1 converts the data of the loaded speed alarm signal and sends the converted loaded speed alarm signal to the buzzer for alarming.
In the preferred embodiment of the invention, after the power supply of the automobile multi-speed alarm device is powered on for displaying, the singlechip U1 obtains a no-rotation-speed signal in the automobile 4s, namely, the speed signal is determined to be 0.
In a preferred embodiment of the present invention, if the vehicle speed signal is not 0, the method further includes: switching the obtained vehicle speed signal into a mileage signal so that the display screen DS 1) converts the speed display into a mileage display.
In a preferred embodiment of the present invention, the setting at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h as the speed alarm signal comprises:
in the vehicle stop state, when no speed signal exists, the vehicle enters a setting mode according to a first switch S1, a second switch S2 is used for adding and counting, a third switch S3 is used for subtracting and counting, preset vehicle speed signals are respectively adjusted to be 60km/h, 80km/h, 100km/h, 110km/h and 120km/h through a second switch S2 and a third switch S3, and after a buzzer T1 is sounded by pressing a fourth switch S4 for more than one second as a speed alarm signal, the speed alarm signal alarm setting of the over-speed is finished, and the initial value setting is finished.
In the preferred embodiment of the invention, when at least one of 60km/h, 80km/h, 100km/h, 110km/h and 120km/h is selected as an initial value to be set, the seventh switch S7 is toggled, and the speed alarm signal which indicates that the speed signal is over-speed when the buzzer T1 sounds is pressed down by pressing the second switch S2 is set to alarm, the seventh switch S7 is toggled back to the original position;
if the speed alarm signal needs to be changed, one of the seventh switch S7, the third switch S3, the seventh switch S7, the fourth switch S3, the seventh switch S7, the fourth switch S4, the seventh switch S7, the fifth switch S5, the seventh switch S7 and the sixth switch S6 is toggled to update the speed alarm signal as an initial value, and then the seventh switch S7 is toggled back to the original position.
In the preferred embodiment of the present invention, the single-chip microcomputer U1 sends the speed signal to the display screen DS1 every 0.5 seconds to refresh the display after processing and operation.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.