A method for judging vehicle start and stop by using OBD interface
By collecting the voltage difference between the H and L signals of the OBD interface, and combining the calculation and comparison modules, the problems of misjudgment of vehicle start-stop status and data interference were solved, achieving reliable start-stop judgment, reducing costs and improving system reliability.
Patent Information
- Application Number
- CN202310422037.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-04-19
Smart Images

Figure CN116442931B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power supply switch judgment method, and particularly relates to a method for judging the start and stop of a vehicle by using an OBD interface. BACKGROUND
[0002] The OBD interface of an automobile refers to an interface similar to a plug-in interface in the automobile, and its function can be simply understood as follows: a staff member can know the information and state of the vehicle by connecting a computer with the OBD interface, and the stop and start state of the vehicle can be applied in many aspects. Many vehicles equipped with modified devices are powered through the OBD interface, for example, a driving recorder.
[0003] By judging the start and stop state of the vehicle, the power taking device can realize the on-off of electric energy. In the prior art, there are mainly three ways to judge the start and stop state of the vehicle.
[0004] The first method is to judge the voltage fluctuation range of the vehicle battery, that is, to distinguish the difference in the amplitude of the battery voltage before and after the vehicle is started and the engine is ignited. In this way, the voltage value of the vehicle battery is detected. When the vehicle starts the engine, the charging voltage generated by the engine driving the vehicle generator is used to judge whether the vehicle is started. Thus, the power taking device is provided with a signal that the vehicle has been started, so that the power taking device enters a working state, provides an output voltage, and supplies power to the target device.
[0005] The second method is to detect the voltage amplitude of the H line of the CAN signal. This method uses a single-chip AD to collect the voltage amplitude of the H signal line of the CAN bus in the OBD interface to judge. When the vehicle is started, the H signal line of the CAN signal changes from 0V to 3.5V or above. When the vehicle is stopped, the H signal of the CAN bus changes from 3.5V or above to 0V. The start and stop of the vehicle are judged by this method.
[0006] The third method is to judge whether the vehicle is started or stopped by communicating data with the CAN bus of the OBD interface of the vehicle and obtaining the engine speed information of the vehicle.
[0007] The above three common methods for judging the start and stop of the vehicle have the following disadvantages:
[0008] The first method has obvious problems. When the vehicle is driving, the vehicle battery is fully charged, and the output voltage of the generator is automatically controlled by the vehicle computer system to reduce the output, thereby causing misjudgment. In addition, some vehicles enter an automatic start-stop mode when waiting at a red light, the engine stops rotating, the generator also stops outputting, and misjudgment is also caused to the power taking device. The misjudgment caused by the foregoing conditions causes the power taking device to stop outputting, and brings an incorrect shutdown operation to the vehicle electrical equipment, thereby affecting the normal operation of the electrical equipment.
[0009] The second method is not applicable to some vehicles because the vehicles have a long delay-off time after stopping, which can be 10-15 minutes, and the level of the CAN bus signal is kept at 2.5V for a long time, so that the power taking device cannot be turned off in time, the external power consuming device is in a running state for a long time, and the vehicle battery is over-consumed.
[0010] The third method mainly has a problem that when the vehicle is at a traffic light intersection, the engine is stopped after entering the automatic start-stop mode, the engine speed information is 0, the power taking device is misjudged and the output is turned off. Meanwhile, the scheme needs to use a special chip or an MCU system supporting a CAN controller to realize, and the realization of the data communication process is constrained by the communication protocol, the communication is complex, and some incomplete communication protocol software programs can also bring error interference data to the vehicle ECU system, thereby affecting the normal operation of the vehicle and causing safety hazards. SUMMARY
[0011] The purpose of the present application is to provide a method for judging the start-stop of a vehicle by using an OBD interface to solve the problems in the background art.
[0012] To achieve the above purpose, the present application provides the following technical scheme:
[0013] A method for judging the start-stop of a vehicle by using an OBD interface, comprising a collection module one and a collection module two, the input ends of the collection module one and the collection module two are connected with the H signal end and the L signal end of the OBD interface respectively, the output ends of the collection module one and the collection module two are connected with an operation module, the output end of the operation module is connected with a comparison module, and the comparison module is connected with a microprocessor;
[0014] Firstly, the voltage values of the H signal and the L signal are obtained by the collection module one and the collection module two respectively, and are transmitted to the operation module;
[0015] Secondly, the voltage difference of the H signal and the L signal is obtained by the operation module, and then the difference is transmitted to the comparison module;
[0016] Thirdly, the comparison module obtains the calculation difference of the operation module and the threshold one of the storage module at the same time, and then compares the two, when the difference is within the range of the threshold one, the comparison module outputs signal one to the microprocessor, at this time the microprocessor confirms that the vehicle is in a starting state; when the difference exceeds the range of the threshold one, the comparison module sends signal two to the microprocessor or does not send signal, at this time the microprocessor identifies that the vehicle is in a closed state.
[0017] Further technical solutions, further comprising a timing module arranged between the comparison module and the microprocessor, the comparison module sends a signal to the microprocessor first requiring triggering the timing module, after the timing time of the timing module, the comparison module communicates with the microprocessor;
[0018] When the timing time of the timing module is passed, the comparison module sends a signal one to the microprocessor, at this time the microprocessor confirms that the vehicle is in the starting state;
[0019] When the timing time of the timing module is passed, the comparison module sends a signal two or no signal to the microprocessor, at this time the microprocessor clears the timing module.
[0020] Further technical solutions, the H signal and the L signal are output in the same period.
[0021] Further technical solutions, the H signal and the L signal are differential period outputs, and the operation module comprises an identifier one for confirming the H signal, an identifier two for confirming the L signal, and an operation device;
[0022] When the H signal is greater than the threshold two of the identifier one when the H signal is at a high level, it can be input into the operation device, and when the H signal is less than the threshold two of the identifier one when the H signal is at a low level, it cannot be input into the operation device at this time;
[0023] When the L signal is greater than the threshold three of the identifier two when the L signal is at a high level, it can be input into the operation device, and when the L signal is less than the threshold three of the identifier two when the L signal is at a low level, it cannot be input into the operation device at this time;
[0024] The operation device obtains the voltage values of the H signal and the L signal and performs difference operation.
[0025] Further technical solutions, the microprocessor outputs a vehicle ACC signal.
[0026] Further technical solutions, the collection module one comprises a resistor R1, one end of the resistor R1 is connected with an OBD interface H signal output end, the other end of the resistor R1 is connected with an input end one of the operation module, and the output end of the resistor R1 is further electrically connected with a resistor R2 and a capacitor C1, and the other ends of the resistor R2 and the capacitor C1 are grounded respectively.
[0027] Further technical solutions, the collection module two comprises a resistor R3, one end of the resistor R3 is connected with an OBD interface L signal output end, the other end of the resistor R3 is connected with an input end two of the operation module, and the output end of the resistor R3 is further electrically connected with a resistor R4 and a capacitor C2, and the other ends of the resistor R4 and the capacitor C2 are grounded respectively.
[0028] The beneficial effects of the present application are:
[0029] The method of the present application is used to judge the start and stop of the vehicle, and only simple voltage collection is needed to realize the judgment information of the start and stop of the vehicle, and it is very reliable, does not need to communicate with the vehicle in the form of data exchange, eliminates the data interference hidden danger, can effectively control and manage the cost, and improves the reliability.
[0030] Other features and advantages of the present application will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The logic flow chart of the embodiment one of the present application.
[0032] Figure 2 The logic flow chart of the embodiment two of the present application.
[0033] Figure 3 The logic flow chart of the operation module of the present application.
[0034] Figure 4 The logic circuit diagram of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application.
[0036] Embodiment one, with reference to Figure 1 A method for judging the start and stop of the vehicle by using the OBD interface, comprising a collection module one and a collection module two, the input ends of the collection module one and the collection module two are connected with the H signal end and the L signal end of the OBD interface respectively, the output ends of the collection module one and the collection module two are connected with an operation module, the output end of the operation module is connected with a comparison module, the comparison module is connected with a microprocessor;
[0037] Firstly, the voltage values of the H signal and the L signal are obtained by the collection module one and the collection module two respectively, and are transmitted to the operation module;
[0038] Secondly, the voltage difference of the H signal and the L signal is obtained by the operation module, and then the difference is transmitted to the comparison module;
[0039] Thirdly, the calculation difference of the operation module and the threshold one of the storage module are obtained by the comparison module at the same time, and then the two are compared, when the difference is within the range of the threshold one, the comparison module outputs signal one to the microprocessor, at this time, the microprocessor confirms that the vehicle is in the starting state; when the difference exceeds the range of the threshold one, the comparison module sends signal two to the microprocessor or does not send signal, at this time, the microprocessor confirms that the vehicle is in the closing state.
[0040] The above method can be applied to the power taking device, and the power taking device is used with the equipment installed on the automobile, such as the power consumption equipment such as the driving recorder; the working time of the driving recorder is generally in the use of the vehicle starting, when the vehicle engine is in the lock state, the driving recorder should be in the closed state, and the power taking device obtains the state of the vehicle through the above method, so that the transmission and cutting of the electric energy are realized, and the driving record is avoided. The recorder is in the power-on state for a long time to consume the battery power;
[0041] It should be explained that the automobile start-stop in the application refers to the state of unlocking and locking the automobile, and turning on and off the driving computer, for example, when the vehicle stops and the engine is turned off, the driving computer will be automatically turned off after a period of time without locking the vehicle, and the vehicle battery and the OBD interface are always connected. Even if the vehicle is in the locked state, the OBD interface 2 still has electric energy, so the power taking device is arranged to obtain the start-stop state of the vehicle to determine the on-off of the electric energy.
[0042] The specific numerical values will be described below.
[0043] When the vehicle is in the starting state, the voltage value of the H signal is assumed to be 3.5V, and the voltage value of the L signal is assumed to be 1.5V. Of course, the voltage values of the H signal and the L signal may fluctuate, so the threshold value one is 1.8-2.2. The H signal voltage value is obtained by the acquisition module one, and the L signal voltage value is obtained by the acquisition module two. Then the H signal and the L signal values are transmitted to the operation module by the acquisition module one and the acquisition module two. The fluctuation of the H signal and the L signal voltage values is ignored, and the difference value obtained by operation is 2. Then the difference value is output to the comparison module by the operation module, and the threshold value one in the storage module is obtained by the comparison module. As can be seen, the difference value is 2, and the threshold value one is in the range of 1.8-2.2, so the comparison module sends a signal one to the microprocessor, the microprocessor judges that the automobile is in the starting state, the power taking device is in the on state, and the OBD interface can supply power to the equipment through the power taking device. Of course, the above-mentioned threshold value one is set only for illustration, and can be set according to the actual situation.
[0044] When the vehicle is in the off state and the person is still in the vehicle for a period of time, the driving computer generally has a delay-off function, so the H signal still outputs a voltage of 3.5V and the L signal also outputs a voltage of 1.5V within a certain time, that is, the equipment is still in the running state at this time.
[0045] When the vehicle is in the off state and the person leaves the vehicle, the lock state is carried out, the vehicle computer knows that the vehicle is stopped, at this time the H signal voltage value is reduced to 2.5V, the L signal voltage value is increased to 2.5V, at this time the difference value of the operation module is 0, of course, according to different vehicle models, the H signal voltage value and the L signal voltage value can be reduced to 0V, the difference value is not in the threshold one range, the comparison module outputs signal two or does not output signal to the micro processing, at this time the micro processing determines that the vehicle is in the off state, so that the power taking device is in the off state, and the OBD interface cannot supply power to the device through the power taking device;
[0046] It should be noted that the OBD interface is a general standard interface in the current automobile industry. In China, according to the GB18352.3-2005 standard requirement, the vehicle after 2006 has OBD interface, and the OBD interface has CAN communication interface, that is, the H signal and L signal of CAN bus output. As long as the device on the CAN bus is running and communicating, the voltage change will appear on the H signal and L signal.
[0047] The method of the application can determine the start and stop of the vehicle by simply collecting the voltage, and the determination information of the start and stop of the vehicle is very reliable, without data exchange with the vehicle, without data interference hidden danger, and can effectively control and manage the cost, while improving the reliability.
[0048] Embodiment two, with reference to Figure 2 ;
[0049] Based on the timing module between the comparison module and the microprocessor in embodiment one, the comparison module sends a signal to the microprocessor, which first triggers the timing module. After the timing time of the timing module, the comparison module is connected with the microprocessor, as follows:
[0050] Firstly, the H signal and L signal voltage values are obtained by the acquisition module one and the acquisition module two respectively, and are transmitted to the operation module;
[0051] Secondly, the voltage difference of the H signal and L signal is obtained by the operation module, and then the difference is transmitted to the comparison module;
[0052] Thirdly, the comparison module obtains the calculation difference of the operation module and the threshold one of the storage module, and then compares the two, and then the comparison module sends the result signal to the timing module and triggers it. After the timing time of the timing module, the comparison module is connected with the microprocessor;
[0053] When the timing time of the timing module is passed, the comparison module sends signal one to the micro processing, at this time the microprocessor confirms that the vehicle is in the start state;
[0054] When the timing time of the timing module is over, the comparison module sends signal two or does not send signal to the microprocessor, at this time the microprocessor clears the timing module.
[0055] In this embodiment, the intermittent on and off state caused by the fluctuation of H signal and L signal can be avoided. First, the comparison module needs to send signal to the timing module to trigger it. After the timing module is triggered, it starts timing, for example, 2 seconds. After 2 seconds, the comparison module communicates with the microprocessor. At this time, the comparison module outputs signal one to the microprocessor. The microprocessor judges that the vehicle is in the starting state, and then executes according to the above embodiment. When the comparison module sends signal two or does not send signal to the microprocessor, the microprocessor sends signal to the timing module, and the time is cleared.
[0056] Based on embodiment one and embodiment two;
[0057] The H signal and the L signal are actually output in the formation period of the sawtooth wave, so there are two cases of same period output and differential period output for the H signal and the L signal output;
[0058] In the same period output, the H signal is at high level, and the L signal is also at high level. When the H signal is at low level, the L signal is also at low level. When the H signal and the L signal are in the same period output, the acquisition module one and the acquisition module two can simultaneously obtain the voltage values of the H signal and the L signal, and then simultaneously send the voltage values of the H signal and the L signal to the operation module for calculation.
[0059] In the differential period output, the output periods of the H signal and the L signal are completely staggered, or there is partial overlap between the output periods of the H signal and the L signal. Both of the above two cases will cause problems in the H signal and the L signal values obtained by the acquisition module one and the acquisition module two.
[0060] Taking the case that the output periods of the H signal and the L signal are completely staggered as an example, when the H signal is at high level, the L signal is at low level, or when the L signal is at high level, the H signal is at low level, that is, when the H signal voltage value is 3.5V, the L signal voltage value is 0V. At this time, the calculated value will be greater than the preset threshold one of the storage module and an error will occur.
[0061] Referring to Figure 3, based on the problem in the operation module is provided for identifying H signal recognizer one, for identifying L signal recognizer two and operation, recognizer one and recognizer two are respectively provided with corresponding threshold two and threshold three, operation is electrically connected with recognizer one and recognizer two, according to the above embodiment, for example, threshold two and threshold three are all set to >1V, when the first half cycle, H signal voltage value is 3.5V, greater than the value of threshold two, can be input into operation, and L signal voltage value is 0V, less than the value of threshold three, then cannot be input into the operation, until the second half cycle, H signal voltage value is 0V, less than the preset value of threshold two, cannot be input into the operation, and L signal voltage value is 1.5V, greater than the value of threshold three, then input into the operation, at this time, operation can obtain the voltage value of H signal and L signal to calculate the difference.
[0062] Based on the above-mentioned vehicle start-stop mode, when the vehicle is in the starting state, the microprocessor can also output the vehicle ACC signal;
[0063] In the embodiment, referring to Figure 4 The acquisition module one includes a resistor R1, one end of the resistor R1 is connected with the OBD interface 2H signal output end, the other end of the resistor R1 is connected with the input end one of the operation module, and the output end of the resistor R1 is further electrically connected with a resistor R2 and a capacitor C1, the other end of the resistor R2 and the capacitor C1 is grounded respectively, wherein the resistor R1 is 20 kilo-ohms, the resistor R2 is 100 kilo-ohms, and the capacitor C1 is 100 nanofarad.
[0064] The acquisition module two includes a resistor R3, one end of the resistor R3 is connected with the OBD interface 2L signal output end, the other end of the resistor R3 is connected with the input end two of the operation module, and the output end of the resistor R3 is further electrically connected with a resistor R4 and a capacitor C2, the other end of the resistor R4 and the capacitor C2 is grounded respectively, wherein the resistor R3 is 20 kilo-ohms, the resistor R4 is 100 kilo-ohms, and the capacitor C2 is 100 nanofarad.
[0065] It is apparent for those skilled in the art that the present application is not limited to the details of the above-mentioned exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and all changes falling within the meaning and range of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be regarded as limiting the claims involved.
[0066] The above merely describes preferred embodiments of the present application and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining the unlocking and locking state of a vehicle using an OBD interface to determine the start and stop of the vehicle, characterized in that: The application relates to a vehicle starting state detection device, which comprises a collecting module one and a collecting module two, the input ends of the collecting module one and the collecting module two are connected with the H signal end and the L signal end of an OBD interface respectively, the output ends of the collecting module one and the collecting module two are connected with an operation module, the output end of the operation module is connected with a comparison module, the comparison module is connected with a microprocessor, and a timing module is arranged between the comparison module and the microprocessor. In the first step, the voltage values of H signals and L signals are obtained through the collecting module one and the collecting module two respectively, and the voltage values are transmitted to the operation module. In the second step, the voltage difference of the H signals and the L signals is obtained through the operation module, and then the difference is transmitted to the comparison module, the H signals and the L signals are differential period outputs, and the operation module comprises an identifier one for confirming the H signals, an identifier two for confirming the L signals and an operator. When the H signal is at a high level and greater than the threshold value two of the identifier one, the H signal can be input into the operator; when the H signal is at a low level and smaller than the threshold value two of the identifier one, the H signal cannot be input into the operator. When the L signal is at a high level and greater than the threshold value three of the identifier two, the L signal can be input into the operator; when the L signal is at a low level and smaller than the threshold value three of the identifier two, the L signal cannot be input into the operator. The operator obtains the voltage values of the H signals and the L signals and then performs difference operation. In the third step, the comparison module simultaneously obtains the calculation difference of the operation module and the threshold value one of a storage module, and then the two are compared; when the difference is within the range of the threshold value one, the comparison module outputs a signal one to the microprocessor, and the microprocessor confirms that the vehicle is in a starting state; when the difference exceeds the range of the threshold value one, the comparison module sends a signal two to the microprocessor or does not send a signal, and the microprocessor confirms that the vehicle is in a closing state.
2. The method for determining whether a vehicle is started or stopped by using an OBD interface according to claim 1, characterized in that: The timing module is arranged between the comparison module and the microprocessor, the comparison module sends a signal to the microprocessor first by triggering the timing module, and the comparison module is connected with the microprocessor after the timing time of the timing module. When the comparison module sends the signal one to the microprocessor after the timing time of the timing module, the microprocessor confirms that the vehicle is in the starting state. When the comparison module sends the signal two to the microprocessor or does not send a signal after the timing time of the timing module, the microprocessor clears the timing module.
3. The method for determining whether a vehicle is started or stopped by using an OBD interface according to claim 1 or 2, characterized in that: The H signals and the L signals are the same period outputs.
4. The method for determining whether a vehicle is started or stopped by using an OBD interface according to claim 1, characterized in that: The microprocessor outputs a vehicle ACC signal.
5. The method for determining whether a vehicle is started or stopped by using an OBD interface according to claim 1, characterized in that: The collecting module one comprises a resistor R1, one end of the resistor R1 is connected with the H signal output end of the OBD interface, the other end of the resistor R1 is connected with the input end one of the operation module, the output end of the resistor R1 is further electrically connected with a resistor R2 and a capacitor C1, and the other ends of the resistor R2 and the capacitor C1 are grounded.
6. The method for determining whether a vehicle is started or stopped by using an OBD interface according to claim 1 or 5, characterized in that: The collecting module two comprises a resistor R3, one end of the resistor R3 is connected with the L signal output end of the OBD interface, the other end of the resistor R3 is connected with the input end two of the operation module, the output end of the resistor R3 is further electrically connected with a resistor R4 and a capacitor C2, and the other ends of the resistor R4 and the capacitor C2 are grounded.
Citation Information
Patent Citations
Vehicle network health assessment
CN104579816A
Automobile ignition judgment method, device and vehicle-mounted equipment
CN107139867A
Electricity taking device adopting vehicle OBD (On-Board Diagnostic) interface
CN219428057U