CN108931720A - A kind of switch signal detection circuit and detection method - Google Patents
A kind of switch signal detection circuit and detection method Download PDFInfo
- Publication number
- CN108931720A CN108931720A CN201810763201.5A CN201810763201A CN108931720A CN 108931720 A CN108931720 A CN 108931720A CN 201810763201 A CN201810763201 A CN 201810763201A CN 108931720 A CN108931720 A CN 108931720A
- Authority
- CN
- China
- Prior art keywords
- switch
- signal
- switch state
- port
- module
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/327—Testing of circuit interrupters, switches or circuit-breakers
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Testing Of Short-Circuits, Discontinuities, Leakage, Or Incorrect Line Connections (AREA)
Abstract
The present invention provides a kind of switch signal detection circuit and detection methods, comprising: at least one bus resistance, power supply module, at least one switch state module and the port AD;At least one bus resistance and at least one switch state module are set gradually between power supply module and the port AD;Power supply module, for providing voltage to each switch state module respectively by least one bus resistance;Each of at least one switch state module switch state module for the input switch signal when receiving external triggering, and changes the electric current transmitted by least one bus resistance using switching signal;The port AD, for acquiring at least one level signal at least one switch state module both ends, and determine the corresponding input state of each switching signal according at least one level signal according to preset detection duration.This programme can reduce the testing cost of switching signal.
Description
Technical field
The present invention relates to Internet technical field, in particular to a kind of switch signal detection circuit and detection method.
Background technique
The core cell that micro-control unit (Micro Control Unit, MCU) is controlled as various systems, is answered extensively
For numerous areas such as consumer electronics, automotive electronics, information, industry control, communication, space flight and military projects, and it is daily to penetrate into us
Each corner of life.Valuable source one of of the quantity and type of I/O interface as MCU, determines its specific applied field
Merge the cost price for controlling MCU.
Currently, an I/O interface can only detect a switching signal in actual application.And a system often has
There is more peripheral hardware load, this requires us, and I/O resource MCU more abundant must be selected to want with the difference for meeting system
It asks.And when the I/O resource of MCU is unable to satisfy system requirements, it is also necessary to increase MCU quantity.
As can be seen from the above description, the prior art utilize MCU detection switch signal, detection it is at high cost.
Summary of the invention
The embodiment of the invention provides a kind of switch signal detection circuit and detection methods, can reduce the inspection of switching signal
Survey cost.
In a first aspect, the embodiment of the invention provides a kind of switch signal detection circuits, comprising: at least one bus electricity
Resistance, power supply module, at least one switch state module and the port AD;
Set gradually between the power supply module and the port AD at least one described bus resistance and it is described at least
One switch state module;
The power supply module, at least one bus resistance described in respectively to switch state module described in each
Voltage is provided;
Switch state module described in each of at least one described switch state module, for receiving outside
Input switch signal when triggering, and change the electric current by least one bus resistance transmission using the switching signal;
The port AD, for acquiring at least one switch state module both ends according to preset detection duration
At least one level signal, and the corresponding input shape of each described switching signal is determined according at least one described level signal
State.
Preferably, the port AD, for storing 2nThe detection corresponding with switch state described in each of a switch state
Voltage value;At least three level signal of continuous acquisition, according to the corresponding level value of level signal described in each and the level
The quantity of signal obtains average level value;The determining and average level value pair from each described detection voltage value of storage
The close voltage value answered;According to the corresponding switch state of the close voltage value, determine that each described switching signal is corresponding
Input state;
Wherein, n characterizes the quantity of the switch state module, the difference of the close voltage value and the average level value
Absolute value is less than or equal to preset value range.
Preferably, the port AD for each described level signal to be converted to corresponding digital signal, and removes
Abnormal signal in the digital signal;It the corresponding level value addition of each described digital signal will obtain after removal abnormal signal
Level value summation is obtained, and obtains average level value divided by the quantity of the digital signal using the level value summation;
Wherein, the abnormal signal, comprising: the highest digital signal of numerical value and the minimum digital signal of numerical value.
Preferably, the switch state module, comprising: switch and at least one switch resistance;
At least one described switch resistance is connected at least one described bus resistance;
At least one described switch resistance connects the switch far from one end of at least one bus resistance;
One end ground connection of each described switch far from least one switch resistance.
Preferably, further comprise: filter;
The filter is arranged between at least one described switch state module and the port AD;
The filter, the interference letter in electric current for being filtered through at least one switch state module transfer
Number;
The port AD, for acquiring at least one level signal after the filters filter interference signal.
Preferably, the filter, comprising: at least one filter resistance and at least one filter capacitor;
At least one described filter resistance is arranged between at least one described switch state module and the port AD;
One end of at least one filter capacitor is connected at least one described filter resistance, other end ground connection.
Preferably, further comprise: display module;
The display module, the corresponding input of each described switching signal for being determined according to the port AD
State determines the corresponding connection status of each described switch state module, and exports each described connection status.
Second aspect, the embodiment of the invention provides a kind of inspections of any switch signal detection circuit of first aspect
Survey method, comprising:
It is mentioned respectively at least one switch state module using the power supply module by least one described bus resistance
Voltage supplied;
Using at least one described switch state module, the input switch signal when receiving external triggering, and utilize
The switching signal changes the electric current by least one bus resistance transmission;
Using the port AD according to preset detection duration, at least one described switch state module both ends are acquired extremely
A few level signal, and the corresponding input shape of each described switching signal is determined according at least one described level signal
State.
Preferably, before at least one level signal at least one switch state module both ends described in the acquisition,
Further comprise:
Pass through the interference signal in the electric current of at least one switch state module transfer using filters filter;
At least one level signal at least one switch state module both ends described in the acquisition, comprising:
At least one level signal after acquiring the filters filter interference signal.
Preferably, described, at least one level signal according to determines the corresponding input of each described switching signal
After state, further comprise:
The corresponding input state of each described switching signal determined using display module according to the port AD,
It determines the corresponding connection status of each described switch state module, and exports each described connection status.
In embodiments of the present invention, by set gradually between power supply module and the port AD at least one bus resistance and
At least one switch state module can make at least one switch state module by input switch signal when external trigger, with
Make to change the electric current transmitted from least one bus resistance, then passes through at least one switch state module both ends of AD port processing
Level signal can determine the corresponding input state of each switching signal according to level signal.To sum up, in detection switch
When signal, only bus resistance, switch state module and the port AD need to be set, can be detected the input of at least one switch state module
Switching signal, without using MCU I/O interface detect, so as to reduce the testing cost of switching signal.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.
Fig. 1 is a kind of schematic diagram for switch signal detection circuit that one embodiment of the invention provides;
Fig. 2 is the schematic diagram for another switch signal detection circuit that one embodiment of the invention provides;
Fig. 3 is a kind of schematic diagram for switch signal detection circuit including filter that one embodiment of the invention provides;
Fig. 4 is the schematic diagram that the another kind of one embodiment of the invention offer includes the switch signal detection circuit of filter;
Fig. 5 is a kind of schematic diagram for switch signal detection circuit including display module that one embodiment of the invention provides;
Fig. 6 be one embodiment of the invention provide another include the schematic diagram of the switch signal detection circuit of filter;
Fig. 7 is a kind of flow chart for switch signal detection method that one embodiment of the invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, the embodiment of the invention provides a kind of switch signal detection circuits characterized by comprising at least
One bus resistance 101, power supply module 102, at least one switch state module 103 and the port AD 104;
Set gradually between the power supply module 102 and the port AD 104 at least one described bus resistance 101 and
At least one described switch state module 103;
The power supply module 102, at least one bus resistance 101 described in respectively to switch shape described in each
Morphotype block 103 provides voltage;
Switch state module 103 described in each of at least one described switch state module, for outside receiving
Input switch signal when the triggering in portion, and changed using the switching signal and transmitted by least one described bus resistance 101
Electric current;
The port AD 104, for acquiring at least one described switch state module 103 according to preset detection duration
At least one level signal at both ends, and determine that each described switching signal is corresponding according at least one described level signal
Input state.
In embodiments of the present invention, by set gradually between power supply module and the port AD at least one bus resistance and
At least one switch state module can make at least one switch state module by input switch signal when external trigger, with
Make to change the electric current transmitted from least one bus resistance, then passes through at least one switch state module both ends of AD port processing
Level signal can determine the corresponding input state of each switching signal according to level signal.To sum up, in detection switch
When signal, only bus resistance, switch state module and the port AD need to be set, can be detected the input of at least one switch state module
Switching signal, without using MCU I/O interface detect, so as to reduce the testing cost of switching signal.
In an embodiment of the present invention, the port AD, for storing 2nA switch state and each described switch shape
The corresponding detection voltage value of state;At least three level signal of continuous acquisition, according to the corresponding level of level signal described in each
The quantity of value and the level signal obtains average level value;From each described detection voltage value of storage determine with it is described
The corresponding close voltage value of average level value;According to the corresponding switch state of the close voltage value, determines and open described in each
The corresponding input state of OFF signal;
Wherein, n characterizes the quantity of the switch state module, the difference of the close voltage value and the average level value
Absolute value is less than or equal to preset value range.
In embodiments of the present invention, before detection switch signal, the port AD is it needs to be determined that quantity is the switch state mould of n
The block assembled state different in disconnection or connection, i.e., 2nA switch state and the corresponding detection electricity of each switch state
Pressure value.And the port AD needs at least three level signal of continuous acquisition when acquiring level signal, so that the level to acquisition is believed
Average level value is obtained after number being handled, in the erroneous judgement for utmostly reducing switching signal input state.Obtaining acquisition
After the corresponding average level value of level signal, it is also necessary to determine phase corresponding with average level value from the detection voltage value of storage
Nearly voltage value can determine that the corresponding input state of each switching signal according to the corresponding switch state of close voltage value.
To sum up, this programme can judge the input state of variable connector signal by the port AD, without being connect using the I/O of MCU
Mouth detection, so as to reduce the cost of switching signal.
In an embodiment of the present invention, the port AD, for each described level signal to be converted to corresponding number
Word signal, and remove the abnormal signal in the digital signal;Each described digital signal is corresponding after abnormal signal will be removed
Level value be added and obtain level value summation, and be averaged divided by the quantity of the digital signal using the level value summation
Level value;
Wherein, the abnormal signal, comprising: the highest digital signal of numerical value and the minimum digital signal of numerical value.
In embodiments of the present invention, level signal is being converted to corresponding digital signal by the port AD, and to digital signal
Carry out digital filtering processing, i.e., the highest digital signal of numerical value and the minimum digital signal of numerical value in removal digital signal, so that
Digital signal is smoothly processed, ratio of the abnormal signal in useful digital signal is reduced, to improve switching signal
Detection accuracy.
Based on a kind of switch signal detection circuit shown in FIG. 1, as shown in Fig. 2, in an embodiment of the present invention, it is described to open
Off status module 103, comprising: switch 1031 and at least one switch resistance 1032;
At least one described switch resistance 1032 is connected at least one described bus resistance 101;
At least one described switch resistance 1032 connects the switch far from one end of at least one bus resistance
1031;
One end ground connection of each described switch 1031 far from least one switch resistance.
In embodiments of the present invention, switch when receiving external triggering can input switch signal, meanwhile, by extremely
A few switch resistance changes the electric current transmitted from least one bus resistance, so that AD Port detecting is to level signal,
The input state that each switching signal is determined according to level signal, without being detected using the I/O interface of MCU, so as to drop
The testing cost of low switch signal.
Based on a kind of switch signal detection circuit shown in FIG. 1, as shown in figure 3, in an embodiment of the present invention, further
It include: filter 401;
The filter 401 is arranged between at least one described switch state module 103 and the port AD 104;
The filter 401, it is dry in the electric current that at least one described switch state module 103 is transmitted for being filtered through
Disturb signal;
The port AD 104, for acquiring at least one level signal after the filter 401 filters interference signal.
In embodiments of the present invention, filter is set between switch state module and the port AD, can use filter
Interference signal in electric current is filtered, so that the level signal after AD port processing filtering interference signal, realization effectively disappear
Except the purpose of voltage disturbance influence caused by AD port processing result.
Based on a kind of switch signal detection circuit shown in Fig. 3, as shown in figure 4, in an embodiment of the present invention, the filter
Wave device 401, comprising: at least one filter resistance 4011 and at least one filter capacitor 4012;
At least one described filter resistance 4011 is arranged at least one described switch state module 103 and the port AD
Between 104;
One end of at least one filter capacitor 4012 is connected at least one described filter resistance 4011, another termination
Ground.
In embodiments of the present invention, on hardware, at least one is set between each switch state module and the port AD
Filter resistance and at least one filter capacitor.It can make AD port processing, by least one filter resistance and at least one
Filter capacitor filters the level signal after interference signal, to effectively eliminate voltage disturbance caused by the sampled result of the port AD
It influences, the reliability of enhancing switching signal input state judgement.
Based on a kind of switch signal detection circuit shown in FIG. 1, as shown in figure 5, in an embodiment of the present invention, further
It include: display module 501;
The display module 501, the corresponding institute of each described switching signal for being determined according to the port AD 104
Input state is stated, determines each corresponding connection status of the switch state module 103, and export each described connection shape
State.
In embodiments of the present invention, the port AD, can be true after determining the corresponding input state of each switching signal
Each fixed corresponding connection status of switch state module, for example, switch state module is on-state or off-state, output
Each corresponding connection status of switch state module, the use state of each switch state module is understood convenient for user, so that
User is adjusted according to demand, to realize the purpose that can be improved user experience.
In order to which what is be more clear illustrates technical solution of the present invention and advantage, below with power supply module VCC, bus resistance
The R0 and concatenated switch A of switch resistance Ra and switch resistance Rb concatenated switch B and filter resistance Rx and filter capacitor C
For, as shown in fig. 6, a kind of switch signal detection circuit provided in an embodiment of the present invention is described in detail, comprising:
Switch resistance Ra, switch resistance Rb, filter resistance and filtered electrical are set gradually between power supply module and the port AD
Hold C.
One end connection switch A of the switch resistance Ra far from power supply unit.
One end connection switch B of the switch resistance Rb far from power supply unit.
Filter capacitor C is grounded far from one end of the port AD.
Power supply module VCC, for providing voltage to switch A and switch B by bus resistance R0.
Specifically, power supply module is switched to each by bus resistance R0 and provides voltage, and switch can be made to receive
When to external touch-control, change electric current transmit by bus resistance, so that AD port processing is to each switch for switching and inputting
Signal.
For example, power supply module VCC provides the voltage of 10V to switch A and switch B by bus resistance R0.
Switch A for the input switch signal when receiving external triggering, and passes through switch resistance using switching signal
Ra changes the electric current transmitted from bus resistance R0.
Switch B for the input switch signal when receiving external triggering, and passes through switch resistance using switching signal
Rb changes the electric current transmitted from bus resistance R0.
Specifically, switch A and switch B is required to input switch signal, that is, turn on when receiving external triggering
Switch is closed or disconnects, so as to change the electric current transmitted from bus resistance R0 by switching corresponding switch resistance.
For example, in the triggering for receiving user, input switch signal 1 switchs in an ON state switch A.
Similarly, in the triggering for receiving user, input switch signal 1 switchs in an ON state switch B.
Using filter resistance Rx and filter capacitor C, for being filtered through switch A, switch resistance Ra, switch B and switch electricity
Hinder the interference signal in the electric current of Rb transmission.
Specifically, in order to eliminate voltage disturbance influence caused by the sampled result of the port AD, need to be arranged filter resistance Rx
With filter capacitor C so that AD port processing pass through filter resistance Rx and the filtered level signal of filter capacitor C.
The port AD, for storing 2nA switch state detection voltage value corresponding with each switch state, wherein n table
Sign includes the quantity of the switch state module of switch and switch resistance.
Specifically, when the quantity of switch is n, the port AD needs to store 2nA switch state and each switch state pair
The detection voltage value answered, so that after the level signal for collecting each switch ends, according to the corresponding level of level signal
The voltage value of value and storage, determines the state of the switching signal of each switch input, and then determines the connection status of each switch.
For example, the quantity switched in circuit is 2, and the quantity of switch state is 22A, i.e. switch A and switch B are equal
Be in an off state, switch A is in an off state with switch B in an ON state, switch A is in an off state and switch B at
On-state is in on-state, and switch A and switch B.
The resistance value of bus resistance R0 is 4 Ω, and the resistance value of switch resistance Ra is 2 Ω, and the resistance value of switch resistance Rb is 3 Ω.
When switch A and switch B are in off-state, switching signal input state is 0, and corresponding detection voltage value is
10V。
Switch A in an ON state when switching signal input state be 1, and switching signal when switch B is in an off state
Input state is 0, and corresponding detection voltage value is 1.7V.
When switch A is in an off state switching signal input state be 0, and switch B in an ON state when switching signal
Input state is 1, and corresponding detection voltage value is 3.7V.
Switch A and switch B are in on-state, and switching signal input state is 1, and corresponding detection voltage value is
3V。
The port AD, for according to preset detection duration, continuous acquisition to pass through filter resistance and filter capacitor filtering interference
Each level signal is converted to corresponding digital signal, and removes digital signal by least three level signals after signal
In abnormal signal;According to removal abnormal signal after each digital signal corresponding level value and digital signal quantity,
Obtain average level value, wherein the abnormal signal, comprising: the highest digital signal of numerical value and the minimum digital signal of numerical value.
Specifically, the port AD recycles digital filtering according to preset detection duration, the multiple level signals of continuous acquisition
Mode handles collected level signal so as to the full extent reduce switching signal input state erroneous judgement can
Energy.
For example, the input switch signal 1 when switch A receives external trigger, switch B are inputted still in off-state
Switching signal 0, the port AD synchronization continuous acquisition to level signal q, level signal w, level signal e, level signal r and
Level signal t,
The port AD is by level signal 2.0V, level signal 1.6V, level signal 1.6V, level signal 1.6V and level signal
1V is converted to corresponding digital signal, and handles the digital signal of conversion, removes the highest digital signal sum number of numerical value
It is worth minimum digital signal, further according to number of switches 3 and goes the highest digital signal of divider value and remove the minimum number of numerical value
The sum of each digital signal after signal, acquiring average level value is 1.6V.
The port AD, for determining close voltage value corresponding with average level value from the detection voltage value of storage, according to
The corresponding switch state of close voltage value, determines the corresponding input state of each switching signal.
Wherein, the absolute value of the difference of close voltage value and the average level value is less than or equal to preset value range.
Specifically, the port AD needs each detection electricity from storage after the average level value for obtaining each switch ends
In pressure value, the determining close voltage value for being less than or equal to preset value range with the absolute value of the difference of average level value, further according to phase
The corresponding switch state of nearly voltage value, that is, can determine each switch is in an off state still on-state.
For example, preset value range is ± 0.2;
The port AD is that can determine opposite with average level value 1.6V in 10V, 1.7V, 3.7V and 3V from detection voltage value
The close voltage value answered is 1.7V.
The corresponding switch state of close voltage value 1.7V be switch A in an ON state, switch B is in an off state.
Display module, the corresponding input state of each switching signal for being determined according to the port AD, determines each
Corresponding connection status is switched, and exports each and switchs corresponding connection status.
Specifically, the port AD can determine each switch in connection after the input state for determining each switching signal
State or off-state, display module export the connection status of each switch, facilitate user and understand locating for each switch
State, so that user adjusts the connection status of each switch according to demand.
For example, the connection status of display module output switch A is to connect, and the connection status of switch B is to disconnect.
To sum up, a kind of switch signal detection circuit provided in an embodiment of the present invention, may be implemented variable connector signal
Detection, can enhance the application power of less I/O resource MCU, solve control system due to MCU price factor higher cost
The phenomenon that problem and MCU resource are excessively remaining, form low load with strong power.This programme seals in conjunction using the port AD and switch room
The mode of suitable switch resistance realizes that variable connector signal input state detects using the principle of switch resistance combination partial pressure.It will open
The corresponding analog quantity of OFF signal input state is converted into digital quantity, and the range based on digital quantity judges the input of variable connector signal
State.On hardware, filter resistance and filter capacitor are increased in the port AD can effectively eliminate voltage disturbance to AD sampled result
Caused by influence.On software, the port AD sampled result is handled using the method for digital filtering, enhances switching signal
The reliability of input state erroneous judgement.
As shown in fig. 7, the embodiment of the invention provides the switch signal detection circuits as described in any in above-described embodiment
Detection method characterized by comprising
Step 701: passing through at least one described bus resistance using the power supply module and switch shape at least one respectively
Morphotype block provides voltage;
Step 702: using at least one described switch state module, when receiving external triggering, input switch is believed
Number, and change the electric current by least one bus resistance transmission using the switching signal;
Step 703: using the port AD according to preset detection duration, acquiring at least one described switch state module
At least one level signal at both ends, and determine that each described switching signal is corresponding according at least one described level signal
Input state.
In embodiments of the present invention, changed by least one switch state module by input switch signal when external trigger
Become the electric current that power supply module is transmitted from least one bus resistance, then passes through at least one switch state module two of AD port processing
The level signal at end can determine the corresponding input state of each switching signal according to level signal.To sum up, it is detecting
When switching signal, only bus resistance, switch state module and the port AD need to be set, can be detected at least one switch state module
The switching signal of input, without being detected using the I/O interface of MCU, so as to reduce the testing cost of switching signal.
In an embodiment of the present invention, at least one electricity at least one switch state module both ends described in the acquisition
Before ordinary mail number, further comprise:
Pass through the interference signal in the electric current of at least one switch state module transfer using filters filter;
At least one level signal at least one switch state module both ends described in the acquisition, comprising:
At least one level signal after acquiring the filters filter interference signal.
In an embodiment of the present invention, described, at least one level signal according to determines each described switch letter
After number corresponding input state, further comprise:
The corresponding input state of each described switching signal determined using display module according to the port AD,
It determines the corresponding connection status of each described switch state module, and exports each described connection status.
The each embodiment of the present invention at least has the following beneficial effects:
1, in an embodiment of the present invention, by setting gradually at least one bus electricity between power supply module and the port AD
Resistance and at least one switch state module, can make at least one switch state module be believed by input switch when external trigger
Number, so as to change the electric current transmitted from least one bus resistance, then pass through at least one switch state module of AD port processing
The level signal at both ends can determine the corresponding input state of each switching signal according to level signal.To sum up, it is examining
When surveying switching signal, only bus resistance, switch state module and the port AD need to be set, can be detected at least one switch state mould
The switching signal of block input, without being detected using the I/O interface of MCU, so as to reduce the testing cost of switching signal.
2, in an embodiment of the present invention, before detection switch signal, the port AD is it needs to be determined that quantity is the switch shape of n
The morphotype block assembled state different in disconnection or connection, i.e., 2nA switch state and the corresponding inspection of each switch state
Survey voltage value.And the port AD needs at least three level signal of continuous acquisition when acquiring level signal, so as to the electricity of acquisition
Ordinary mail number obtains average level value after being handled, in the erroneous judgement for utmostly reducing switching signal input state.It is being adopted
After the corresponding average level value of the level signal of collection, it is also necessary to which determination is corresponding with average level value from the detection voltage value of storage
Close voltage value the corresponding input of each switching signal can determine that according to the corresponding switch state of close voltage value
State.To sum up, this programme can judge the input state of variable connector signal by the port AD, without utilizing MCU's
I/O interface detection, so as to reduce the cost of switching signal.
3, in an embodiment of the present invention, level signal is being converted to corresponding digital signal by the port AD, and to number
Signal carries out digital filtering processing, i.e., the highest digital signal of numerical value and the minimum digital signal of numerical value in removal digital signal,
So as to smoothly be processed to digital signal, ratio of the abnormal signal in useful digital signal is reduced, to improve switch
The detection accuracy of signal.
4, in an embodiment of the present invention, switch when receiving external triggering can input switch signal, meanwhile, lead to
It crosses at least one switch resistance and changes the electric current transmitted from least one bus resistance, so that AD Port detecting is believed to level
Number, the input state of each switching signal is determined according to level signal, without being detected using the I/O interface of MCU, so as to
Reduce the testing cost of switching signal.
5, filter in an embodiment of the present invention, is set between switch state module and the port AD, can use filter
Wave device is filtered the interference signal in electric current, so that the level signal after AD port processing filtering interference signal, realization have
Effect eliminates the purpose of voltage disturbance influence caused by AD port processing result.
6, in an embodiment of the present invention, on hardware, it is arranged at least between each switch state module and the port AD
One filter resistance and at least one filter capacitor.It can make AD port processing, by least one filter resistance and at least
Level signal after one filter capacitor filtering interference signal, makes the port AD sampled result to effectively eliminate voltage disturbance
At influence, enhancing switching signal input state judgement reliability.
7, in an embodiment of the present invention, the port AD is after determining the corresponding input state of each switching signal, i.e.,
Can determine each corresponding connection status of switch state module, for example, switch state module be on-state or off-state,
Each corresponding connection status of switch state module is exported, the use state of each switch state module is understood convenient for user,
So that user is adjusted according to demand, to realize the purpose that can be improved user experience.
It should be noted that, in this document, such as first and second etc relational terms are used merely to an entity
Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation
Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non-
It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements,
It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence " including one ", is not arranged
Except there is also other identical factors in the process, method, article or apparatus that includes the element.
Finally, it should be noted that the foregoing is merely presently preferred embodiments of the present invention, it is merely to illustrate skill of the invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention,
Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.
Claims (10)
1. a kind of switch signal detection circuit characterized by comprising at least one bus resistance, power supply module, at least one
Switch state module and the port AD;
Set gradually between the power supply module and the port AD at least one described bus resistance and it is described at least one
Switch state module;
The power supply module, for being provided respectively to switch state module described in each by least one described bus resistance
Voltage;
Switch state module described in each of at least one described switch state module, for receiving external triggering
When input switch signal, and change the electric current by least one bus resistance transmission using the switching signal;
The port AD, for acquiring at least one described switch state module both ends at least according to preset detection duration
One level signal, and the corresponding input state of each described switching signal is determined according at least one described level signal.
2. circuit according to claim 1, which is characterized in that
The port AD, for storing 2nA switch state detection voltage value corresponding with switch state described in each;Continuously adopt
Collect at least three level signals, is obtained according to the quantity of the corresponding level value of level signal described in each and the level signal
Average level value;Close voltage corresponding with the average level value is determined from each described detection voltage value of storage
Value;According to the corresponding switch state of the close voltage value, the corresponding input state of each described switching signal is determined;
Wherein, n characterizes the quantity of the switch state module, the difference of the close voltage value and the average level value it is absolute
Value is less than or equal to preset value range.
3. circuit according to claim 2, which is characterized in that
The port AD for each described level signal to be converted to corresponding digital signal, and removes the number letter
Abnormal signal in number;It will be added that obtain level value total by the corresponding level value of each described digital signal after removal abnormal signal
With, and average level value is obtained divided by the quantity of the digital signal using the level value summation;
Wherein, the abnormal signal, comprising: the highest digital signal of numerical value and the minimum digital signal of numerical value.
4. circuit according to claim 1, which is characterized in that
The switch state module, comprising: switch and at least one switch resistance;
At least one described switch resistance is connected at least one described bus resistance;
At least one described switch resistance connects the switch far from one end of at least one bus resistance;
One end ground connection of each described switch far from least one switch resistance.
5. circuit according to claim 1, which is characterized in that further comprise: filter;
The filter is arranged between at least one described switch state module and the port AD;
The filter, the interference signal in electric current for being filtered through at least one switch state module transfer;
The port AD, for acquiring at least one level signal after the filters filter interference signal.
6. circuit according to claim 5, which is characterized in that
The filter, comprising: at least one filter resistance and at least one filter capacitor;
At least one described filter resistance is arranged between at least one described switch state module and the port AD;
One end of at least one filter capacitor is connected at least one described filter resistance, other end ground connection.
7. according to claim 1 to any circuit in 6, which is characterized in that further comprise: display module;
The display module, the corresponding input shape of each described switching signal for being determined according to the port AD
State determines the corresponding connection status of each described switch state module, and exports each described connection status.
8. the detection method of any switch signal detection circuit in a kind of claim 1 to 6 characterized by comprising
Pass through at least one described bus resistance using the power supply module and provides electricity at least one switch state module respectively
Pressure;
Using at least one described switch state module, the input switch signal when receiving external triggering, and described in utilization
Switching signal changes the electric current by least one bus resistance transmission;
Using the port AD according to preset detection duration, at least the one of at least one switch state module both ends is acquired
A level signal, and the corresponding input state of each described switching signal is determined according at least one described level signal.
9. according to the method described in claim 8, it is characterized in that,
Before at least one level signal at least one switch state module both ends described in the acquisition, further comprise:
Pass through the interference signal in the electric current of at least one switch state module transfer using filters filter;
At least one level signal at least one switch state module both ends described in the acquisition, comprising:
At least one level signal after acquiring the filters filter interference signal.
10. method according to claim 8 or claim 9, which is characterized in that
After described at least one level signal according to determines the corresponding input state of each described switching signal, into
One step includes:
The corresponding input state of each described switching signal determined using display module according to the port AD, is determined
The corresponding connection status of each described switch state module, and export each described connection status.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810763201.5A CN108931720A (en) | 2018-07-12 | 2018-07-12 | A kind of switch signal detection circuit and detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810763201.5A CN108931720A (en) | 2018-07-12 | 2018-07-12 | A kind of switch signal detection circuit and detection method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108931720A true CN108931720A (en) | 2018-12-04 |
Family
ID=64447455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810763201.5A Pending CN108931720A (en) | 2018-07-12 | 2018-07-12 | A kind of switch signal detection circuit and detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108931720A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109932647A (en) * | 2019-03-29 | 2019-06-25 | 四川虹美智能科技有限公司 | A kind of toggle switch state detection circuit, method and device |
CN109975638A (en) * | 2019-04-23 | 2019-07-05 | 成都绎码科技有限公司 | A kind of on-off model monitoring device and method based on wireless transmission |
CN111157586A (en) * | 2020-01-03 | 2020-05-15 | 江苏太湖云计算信息技术股份有限公司 | Water quality monitoring method, device and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203301459U (en) * | 2013-05-22 | 2013-11-20 | 欧姆龙(上海)有限公司 | Analog quantity key acquisition circuit |
CN104251971A (en) * | 2013-06-28 | 2014-12-31 | 深圳富泰宏精密工业有限公司 | Button detection circuit |
CN104811178A (en) * | 2015-04-27 | 2015-07-29 | 航天科技控股集团股份有限公司 | Multi-path switching value collection device based on AD sampling circuit and collecting method thereof |
CN105444364A (en) * | 2015-12-30 | 2016-03-30 | 珠海格力电器股份有限公司 | Dry combustion protection control method and device for humidifier and humidifier |
CN106603064A (en) * | 2017-03-01 | 2017-04-26 | 顺德职业技术学院 | Functional circuit for achieving multi-way switch detection by virtue of single-channel ADC |
CN107703553A (en) * | 2017-08-17 | 2018-02-16 | 广州隽智智能科技有限公司 | A kind of behavior monitoring method and system in place |
CN207216333U (en) * | 2017-06-23 | 2018-04-10 | 九阳股份有限公司 | A kind of identification circuit and cooking apparatus of knob driving switch |
-
2018
- 2018-07-12 CN CN201810763201.5A patent/CN108931720A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203301459U (en) * | 2013-05-22 | 2013-11-20 | 欧姆龙(上海)有限公司 | Analog quantity key acquisition circuit |
CN104251971A (en) * | 2013-06-28 | 2014-12-31 | 深圳富泰宏精密工业有限公司 | Button detection circuit |
CN104811178A (en) * | 2015-04-27 | 2015-07-29 | 航天科技控股集团股份有限公司 | Multi-path switching value collection device based on AD sampling circuit and collecting method thereof |
CN105444364A (en) * | 2015-12-30 | 2016-03-30 | 珠海格力电器股份有限公司 | Dry combustion protection control method and device for humidifier and humidifier |
CN106603064A (en) * | 2017-03-01 | 2017-04-26 | 顺德职业技术学院 | Functional circuit for achieving multi-way switch detection by virtue of single-channel ADC |
CN207216333U (en) * | 2017-06-23 | 2018-04-10 | 九阳股份有限公司 | A kind of identification circuit and cooking apparatus of knob driving switch |
CN107703553A (en) * | 2017-08-17 | 2018-02-16 | 广州隽智智能科技有限公司 | A kind of behavior monitoring method and system in place |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109932647A (en) * | 2019-03-29 | 2019-06-25 | 四川虹美智能科技有限公司 | A kind of toggle switch state detection circuit, method and device |
CN109975638A (en) * | 2019-04-23 | 2019-07-05 | 成都绎码科技有限公司 | A kind of on-off model monitoring device and method based on wireless transmission |
CN109975638B (en) * | 2019-04-23 | 2021-01-15 | 成都绎码科技有限公司 | Switching value signal monitoring device and method based on wireless transmission |
CN111157586A (en) * | 2020-01-03 | 2020-05-15 | 江苏太湖云计算信息技术股份有限公司 | Water quality monitoring method, device and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108931720A (en) | A kind of switch signal detection circuit and detection method | |
CN104569597A (en) | Method and device for detecting insulation resistance of power battery | |
CN101819261B (en) | Three-phase source phase failure and power failure detection circuit | |
CN103916116A (en) | Interface level switch device | |
CN205861762U (en) | A kind of direct current bus voltage detecting circuit | |
CN112986708A (en) | Method and device for judging whether bus capacitor needs to be overhauled or replaced | |
CN109298985A (en) | A kind of connection detection circuit | |
CN213069012U (en) | High voltage wire harness insulation testing device based on direct current | |
CN203772944U (en) | True effective value AC/DC voltage measuring device capable of automatically identifying type of signal | |
CN102751975B (en) | PWM and AI multiplexing port and controller | |
CN115656638B (en) | MLCC capacitance test positive and negative signal acquisition circuit and method | |
CN102901906B (en) | A kind of detection system based on universal product plug and method | |
CN108808841A (en) | Power supply switching system and intelligent electric energy meter | |
CN105067884A (en) | Three-phase alternating-current supply phase detection circuit | |
CN210720628U (en) | Direct current insulation monitoring circuit | |
CN211402533U (en) | Automatic module and system of patrolling and examining of multichannel voltage | |
CN101093238A (en) | Circuit for detecting lack of phase of three-phase voltage | |
CN107677876A (en) | The dynamic measurement method and device of a kind of bipolar signal | |
CN206041472U (en) | Protection circuit of bidirectional converter and power utilization system with electricity storage function | |
CN213843412U (en) | Trap circuit and trap ware based on fill charger soon | |
CN110542787A (en) | voltage acquisition device for DC bus of three-level motor driver | |
CN218481576U (en) | Current sampling circuit | |
CN112731259B (en) | Open-short circuit detection method for current transformer | |
CN219417609U (en) | Open-phase detection circuit, driving device and electric tool | |
CN210199209U (en) | Three-phase power phase sequence detection circuit compatible with zero-line-free three-phase power |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181204 |
|
RJ01 | Rejection of invention patent application after publication |