CN118112409A - Switch state detection method, circuit and electronic equipment - Google Patents

Switch state detection method, circuit and electronic equipment Download PDF

Info

Publication number
CN118112409A
CN118112409A CN202410502049.0A CN202410502049A CN118112409A CN 118112409 A CN118112409 A CN 118112409A CN 202410502049 A CN202410502049 A CN 202410502049A CN 118112409 A CN118112409 A CN 118112409A
Authority
CN
China
Prior art keywords
detection module
switch
coupled
processor
input end
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.)
Granted
Application number
CN202410502049.0A
Other languages
Chinese (zh)
Other versions
CN118112409B (en
Inventor
宋明权
苏华
李栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Megmeet Electrical Co Ltd
Original Assignee
Shenzhen Megmeet Electrical Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Megmeet Electrical Co Ltd filed Critical Shenzhen Megmeet Electrical Co Ltd
Priority to CN202410502049.0A priority Critical patent/CN118112409B/en
Publication of CN118112409A publication Critical patent/CN118112409A/en
Application granted granted Critical
Publication of CN118112409B publication Critical patent/CN118112409B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/327Testing of circuit interrupters, switches or circuit-breakers
    • G01R31/3277Testing of circuit interrupters, switches or circuit-breakers of low voltage devices, e.g. domestic or industrial devices, such as motor protections, relays, rotation switches
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R1/00Details of instruments or arrangements of the types included in groups G01R5/00 - G01R13/00 and G01R31/00
    • G01R1/20Modifications of basic electric elements for use in electric measuring instruments; Structural combinations of such elements with such instruments
    • G01R1/203Resistors used for electric measuring, e.g. decade resistors standards, resistors for comparators, series resistors, shunts
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R15/00Details of measuring arrangements of the types provided for in groups G01R17/00 - G01R29/00, G01R33/00 - G01R33/26 or G01R35/00
    • G01R15/14Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks
    • G01R15/146Measuring arrangements for current not covered by other subgroups of G01R15/14, e.g. using current dividers, shunts, or measuring a voltage drop

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electronic Switches (AREA)

Abstract

The application discloses a switch state detection method, a circuit and electronic equipment. The switch state detection circuit includes: a processor; the input end of each main detection module is coupled with a switch to be detected, and the output end of each main detection module is coupled with the processor; the control end of the auxiliary detection module is coupled with the processor, the first input end of the auxiliary detection module is coupled with the input end of the main detection module, and the second input end of the auxiliary detection module is coupled with the voltage dividing node of the main detection module; the voltage dividing node is positioned behind the input end of the main detection module; the auxiliary detection module responds to a first control signal of the processor, the switch to be detected is in a conducting state, a load resistor in the auxiliary detection module is connected to the main detection module, and current flowing through the switch to be detected is increased, so that the processor can detect the switch state. By the mode, the accuracy of the processor in detecting the switch state is improved, and the false detection phenomenon is reduced.

Description

Switch state detection method, circuit and electronic equipment
Technical Field
The present application relates to the field of switch state detection technologies, and in particular, to a switch state detection method, a circuit, and an electronic device.
Background
The state (on or off) of the switch is used as a common input signal of the control system, and needs to be reliably detected by a control core such as a processor, so that a corresponding switch signal processing circuit and a software detection algorithm need to be designed.
The related detection method is that the input voltage of the switch is input to a corresponding control unit (such as a photoelectric isolator) after being divided, and the on and off of the switch corresponds to the high and low level output by the control unit by setting proper on and off threshold values, and the high and low level is input to a processor for detecting the state of the switch.
Disclosure of Invention
The application provides a switch state detection method, a circuit and electronic equipment, which can improve the accuracy of a processor in detecting the switch state and reduce the false detection phenomenon.
In a first aspect, the present application provides a switch state detection circuit comprising: a processor; the input end of each main detection module is coupled with a switch to be detected, and the output end of each main detection module is coupled with the processor; the control end of the auxiliary detection module is coupled with the processor, the first input end of the auxiliary detection module is coupled with the input end of the main detection module, and the second input end of the auxiliary detection module is coupled with the voltage dividing node of the main detection module; the voltage dividing node is positioned behind the input end of the main detection module; the auxiliary detection module responds to a first control signal of the processor, the switch to be detected is in a conducting state, a load resistor in the auxiliary detection module is connected to the main detection module, and current flowing through the switch to be detected is increased, so that the processor can detect the switch state.
Wherein, auxiliary detection module includes: at least one first input end, each first input end is coupled with an input end of a main detection module respectively; at least one second input end, each second input end is coupled with a voltage dividing node of the main detection module respectively; the first end of the first control unit is coupled with the working power supply end, the second end of the first control unit is used as the control end of the auxiliary detection module to be coupled with the processor, and the third end of the first control unit is coupled with at least one second input end; the control end of the switch unit is coupled with the fourth end of the first control unit, the first end of the switch unit is coupled with at least one first input end through a load resistor, and the second end of the switch unit is grounded; the second end of the first control unit responds to a first control signal of the processor, and the third end and the fourth end of the control end are conducted; and the switch unit is connected to the load resistor to the main detection module in response to the switch to be detected being in a conducting state, and increases the current flowing through the switch to be detected so as to enable the processor to detect the switch state.
Each load resistor is coupled with the first end of the switch unit through a diode; the anode of the diode is coupled with the load resistor, and the cathode of the diode is coupled with the first end of the switch unit.
Each second input end is coupled with the third end of the control unit through a diode respectively; the positive electrode of the diode is coupled with the second input end, and the negative electrode of the diode is coupled with the third end of the control unit.
Wherein, auxiliary detection module still includes: the first voltage division unit is connected with the fourth end of the control unit in a coupling mode, the second end of the first voltage division unit is connected with the control end of the switch unit in a coupling mode, and the third end of the first voltage division unit is grounded.
Wherein each main detection module comprises: the first end of the second voltage division unit is used as the input end of the main detection module and is coupled with the first input end of the auxiliary detection module and the switch to be detected, and the voltage division node of the second voltage division unit is coupled with the second input end of the auxiliary detection module; the first end of the second control unit is coupled with the second end of the second voltage division unit, the second end of the second control unit is coupled with the power supply negative electrode, the third end of the second control unit is grounded, and the fourth end of the second control unit is used as the output end of the main detection module to be coupled with the processor.
The processor responds to the first power-on detection of the switch state detection circuit, outputs a low-level first control signal of preset time, and the auxiliary detection module responds to the low-level first control signal, accesses the load resistor to the main detection module, increases the current flowing through the switch to be detected, and is used for breaking down the metal oxide layer on the corresponding contact of the switch to be detected.
The processor responds to the completion of the first power-on detection and outputs a first control signal in a PWM mode.
In a second aspect, the present application provides an electronic device comprising a switch state detection circuit as provided in the first aspect.
In a third aspect, the present application provides a switch state detection method, applied to a switch state detection circuit, the switch state detection circuit comprising: a processor; the input end of each main detection module is coupled with a switch to be detected, and the output end of each main detection module is coupled with the processor; the control end of the auxiliary detection module is coupled with the processor, the first input end of the auxiliary detection module is coupled with the input end of the main detection module, and the second input end of the auxiliary detection module is coupled with the voltage dividing node of the main detection module; the voltage dividing node is positioned behind the input end of the main detection module; the method comprises the following steps: the auxiliary detection module responds to a first control signal sent by the processor, the switch to be detected is in a conducting state, and a load resistor in the auxiliary detection module is connected to the main detection module, so that the current flowing through the switch to be detected is increased, and the processor is enabled to detect the switch state.
The beneficial effects of the application are as follows: compared with the prior art, the switch state detection method, the circuit and the electronic equipment provided by the application have the advantages that the auxiliary detection module is utilized to dynamically increase the load resistance in the detection loop, so that the current flowing through the switch to be detected is increased, the metal oxide layer on the contact of the switch to be detected can be broken down, the accuracy of the processor in detecting the switch state is improved, and the false detection phenomenon is reduced. Furthermore, by using the mode that the auxiliary detection module is dynamically connected with the load resistor, the addition of a constant resistor in the main detection module is avoided, so that the power consumption of the whole switch state detection circuit is reduced, for example, the load resistor is disconnected after the detection is finished, and the total power consumption can be greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
FIG. 1 is a schematic diagram of a switch state detection circuit according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the detection timing corresponding to FIG. 1;
FIG. 3 is a schematic diagram of an embodiment of a switch state detection circuit according to the present application;
FIG. 4 is a schematic diagram illustrating an embodiment of a main detection module in a switch status detection circuit according to the present application;
FIG. 5 is a schematic diagram illustrating an embodiment of an auxiliary detecting module in a switch state detecting circuit according to the present application;
FIG. 6 is a schematic diagram of the detection timing sequence corresponding to FIG. 4 and FIG. 5 according to the present application;
Fig. 7 is a schematic structural diagram of an embodiment of an electronic device provided by the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present application are shown in the drawings. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The state (on or off) of the switch is used as a common input signal of the control system, and needs to be reliably detected by a control core such as a processor, so that a corresponding switch signal processing circuit and a software detection algorithm need to be designed.
The related detection method is that the input voltage of the switch is input to a corresponding control unit (such as a photoelectric isolator) after being divided, and the on and off of the switch corresponds to the high and low level output by the control unit by setting a proper on and off threshold value, and the high and low level is input to the processor 10 for detecting the state of the switch.
As shown in fig. 1 and 2, after the switch K1 is turned on, current passes through K1 from the positive electrode (vin+) of the power supply, then passes through the current-limiting resistor R1, and enters the photo-isolator P1, the photo-isolator P1 is turned on, after the secondary triode is turned on, the 4 pin of the photo-isolator P1 is at a low level, the signal is filtered by the resistor R3 and then sent to the I/O pin (OIN 1) of the processor for detection, wherein the 3 pin of the photo-isolator P1 is coupled to the digital ground DGND, one end of the resistor R4 is coupled to the 4 pin of the photo-isolator P1, the other end of the resistor R4 is coupled to the positive digital power supply voltage DVCC3_3, one end of the resistor R2 is coupled to one end of the current-limiting resistor R1 away from the switch K1, and the other end of the resistor R2 is coupled to the negative electrode (Vin-).
The applicant has long studied to find that common switches, such as contactor contacts, are affected by oxide layers on the surface of the contacts, and require that the current flowing through the contacts is greater than a threshold value (e.g. 10 mA) to conduct reliably, otherwise, even if the contactor contacts are in a mechanically contacted state, the oxide layers on the surface of the contacts cannot be broken down due to too small a loop current, the current cannot reliably pass through the contacts, and the processor cannot detect the closed state of the contactor contacts, resulting in false detection.
If the resistance of the current limiting resistor R1 in fig. 1 is adjusted according to the input voltage, so that the current flowing through R1 is greater than the threshold (10 mA), after the switch is closed, the input voltage continuously passes through the current limiting resistor R1 and the primary side of the optocoupler and generates power consumption, and when the input voltage is higher, for example, 110Vdc and 220Vac, larger power consumption is generated in the input circuit and serious heating of internal devices of the product is caused. The problem is more remarkable in the occasion that the product is provided with a multi-channel input circuit, some products such as PLCs (programmable logic controllers) are usually provided with 10 or even tens of switch input detection channels, if the current larger than the threshold value continuously passes through the input circuit, the power consumption of each channel is larger than 1W or 2W, and extra heat dissipation measures are required to be added for heating the multi-input channel circuit, so that the problems of increasing the volume of the product, reducing the reliability, increasing the cost and the like are caused.
Based on the method, the auxiliary detection module is utilized to dynamically increase the load resistance in the detection loop, so that the current flowing through the switch to be detected is increased, a metal oxide layer on a contact of the switch to be detected can be broken down, the accuracy of the processor in detecting the state of the switch is improved, and the false detection phenomenon is reduced. Furthermore, by using the mode of dynamically connecting the auxiliary detection module to the load resistor, the addition of a constant resistor in the main detection module is avoided, so that the power consumption of the whole switch state detection circuit is reduced, for example, the load resistor is disconnected after the detection is finished, the total power consumption can be greatly reduced, and at least one technical problem is solved. See in particular the examples below.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of a switch state detection circuit provided by the present application. The switch state detection circuit 100 includes: a processor 10, an auxiliary detection module 20 and at least one main detection module 30.
The input end of each main detection module 30 is coupled to a switch to be detected, and the output end of each main detection module 30 is coupled to the processor 10. I.e. the number of main detection modules 30 may correspond to the number of switches to be detected. If the number of switches to be detected is N, the number of main detection modules 30 is also N. The output of each main detection module 30 is coupled to a different pin of the processor 10, so that the processor 10 can clearly know whether the corresponding switch to be detected is turned on or off.
The control end of the auxiliary detection module 20 is coupled to the processor 10, the first input end of the auxiliary detection module 20 is coupled to the input end of the main detection module 30, and the second input end of the auxiliary detection module 20 is coupled to the voltage dividing node of the main detection module 30; wherein the voltage dividing node is located after the input of the main detection module 30. In the present embodiment, the number of the first input terminals of the auxiliary detecting modules 20 corresponds to the number of the main detecting modules 30. That is, the auxiliary detecting module 20 may include a plurality of first inputs, each of which is coupled to an input of a main detecting module 30. In the present embodiment, the number of second input terminals of the auxiliary detection modules 20 corresponds to the number of main detection modules 30. That is, the auxiliary detecting module 20 may include a plurality of second inputs, each of which is coupled to a voltage dividing node of the main detecting module 30. It will be appreciated that the first input and the second input correspond, i.e. the same set of first and second inputs are coupled to the same main detection module 30.
In this embodiment, the auxiliary detection module 20 includes a load resistor therein. The auxiliary detection module 20 responds to the first control signal of the processor 10, and the switch to be detected is in a conducting state, and the load resistor in the auxiliary detection module 20 is connected to the main detection module 30, so that the current flowing through the switch to be detected is increased, and the processor 10 is enabled to detect the switch state. In this embodiment, if the switch to be detected is in the off state, even if the auxiliary detection module 20 receives the first control signal of the processor 10, the load resistor in the auxiliary detection module 20 is not connected to the main detection module 30 to participate in the switch state detection, and at this time, the processor 10 may determine that the switch to be detected is in the off state through the main detection module 30.
In this embodiment, the auxiliary detection module 20 dynamically increases the load resistance in the detection loop, so as to increase the current flowing through the switch to be detected, break down the metal oxide layer on the contact of the switch to be detected, improve the accuracy of the processor 10 in detecting the switch state, and reduce the false detection phenomenon. Further, by dynamically switching in the auxiliary detection module 20 to the load resistor, the addition of a constant resistor to the main detection module 30 is avoided, so as to reduce the power consumption of the overall switch state detection circuit, such as switching off the load resistor after the detection is completed, so that the overall power consumption can be greatly reduced.
In some embodiments, the auxiliary detection module 20 includes: at least one first input, at least one second input, a first control unit and a switching unit. The number of the first input end and the second input end can be determined according to the number of the switches to be detected.
Each of the first input terminals is coupled to an input terminal of a main detection module 30.
Each of the second input terminals is coupled to a voltage dividing node of the main detection module 30.
The first control unit has a first end coupled to the working power source end, a second end coupled to the processor 10 as a control end of the auxiliary detection module 20, and a third end coupled to at least one second input end.
The control end of the switch unit is coupled with the fourth end of the first control unit, the first end of the switch unit is coupled with at least one first input end through a load resistor, and the second end of the switch unit is grounded. In some embodiments, each of the first input terminals is coupled to a first terminal of the switching unit through a load resistor.
Wherein the second end of the first control unit is responsive to the first control signal of the processor 10, and the third end and the fourth end of the control end are turned on; the switching unit switches in the load resistor to the main detection module 30 in response to the switch to be detected being in the on state, and increases the current flowing through the switch to be detected, so that the processor 10 performs the switch state detection. In some embodiments, the first control unit may be a photo-isolator.
Further, the switching unit does not switch in the load resistor to the main detection module 30 in response to the switch to be detected being in the off state, and the processor 10 detects that the switch to be detected is in the off state only through the main detection module 30. In some embodiments, the switching unit may be formed of a switching element such as a MOS transistor.
In this embodiment, the second end of the first control unit is responsive to the first control signal of the processor 10, the third end and the fourth end of the control end are turned on, when the switch to be detected is in a turned-on state, a high level flows into the control end of the switch unit through the first control unit to turn on the switch unit, and the load resistor is connected to the main detection module 30, so that the current flowing through the switch to be detected is increased, the processor 10 performs the detection of the switch state, the accuracy of the processor 10 on the detection of the switch state is improved, and the false detection phenomenon is reduced.
Further, each load resistor is coupled to the first end of the switch unit through a diode; the anode of the diode is coupled with the load resistor, and the cathode of the diode is coupled with the first end of the switch unit.
Each second input end is coupled with the third end of the control unit through a diode respectively; the positive electrode of the diode is coupled with the second input end, and the negative electrode of the diode is coupled with the third end of the control unit, so that the detection channels are isolated from each other.
Further, the auxiliary detection module 20 further includes: the first voltage division unit is connected with the fourth end of the control unit in a coupling mode, the second end of the first voltage division unit is connected with the control end of the switch unit in a coupling mode, and the third end of the first voltage division unit is grounded.
Further, each of the main detection modules 30 includes: the second voltage division unit and the second control unit.
The first end of the second voltage division unit is used as an input end of the main detection module 30 and is coupled with the first input end of the auxiliary detection module 20 and the switch to be detected, and the voltage division node of the second voltage division unit is coupled with the second input end of the auxiliary detection module 20.
The first end of the second control unit is coupled to the second end of the second voltage division unit, the second end of the second control unit is coupled to the power negative electrode, the third end of the second control unit is grounded, and the fourth end of the second control unit is coupled to the processor 10 as an output end of the main detection module 30.
In an application scenario, the processor 10 responds to the first power-on detection of the switch state detection circuit, outputs a low-level first control signal for a preset time, and the auxiliary detection module 20 responds to the low-level first control signal, accesses the load resistor to the main detection module 30, increases the current flowing through the switch to be detected, and is used for breaking down the metal oxide layer on the corresponding contact of the switch to be detected.
Further, the processor 10 outputs the first control signal in a PWM manner in response to the completion of the first power-on detection. Because the metal oxide layer on the corresponding contact of the switch to be detected breaks down during the first detection, continuous control signals are not needed in the follow-up process, and therefore the first control signals can be output in a PWM mode, and power consumption is saved.
In an application scenario, the following is described with reference to fig. 4, 5 and 6:
As fig. 4 provides 8 main detection modules, it will be appreciated that only the first main detection module and the eighth main detection module are shown in fig. 4, and the remaining main detection modules have been omitted. Wherein, R10 and R11 in the first path main detection module can form the second voltage division unit. The photo-isolator P10 may be the second control unit described above. After the switch K10 is turned on, current passes through K10 from the positive electrode (vin+) of the power supply, then passes through resistors R10 and R11, and enters the photo-isolator P10, the photo-isolator P10 is turned on, after the secondary triode is turned on, the 4 pin of the photo-isolator P10 is at a low level, the signal is filtered by a resistor R14 and then sent to the I/O pin (OIN 10) of the processor for detection, wherein the 3 pin of the photo-isolator P10 is coupled to a digital ground DGND, one end of a resistor R13 is coupled to the 4 pin of the photo-isolator P10, the other end of the resistor R13 is coupled to a positive digital power supply voltage dvcc3_3, one end of a resistor R12 is coupled to one end of the resistor R11 far away from the switch K10, and the other end of the resistor R12 is coupled to the negative electrode (Vin-). After the switch K17 is turned on, current passes through K17 from the positive electrode (vin+) of the power supply, then passes through resistors R36 and R37, and enters the photo-isolator P17, the photo-isolator P17 is turned on, after the secondary triode is turned on, the 4 pin of the photo-isolator P17 is at a low level, the signal is filtered by a resistor R40 and then sent to the I/O pin (OIN 17) of the processor for detection, wherein the 3 pin of the photo-isolator P17 is coupled to a digital ground DGND, one end of a resistor R39 is coupled to the 4 pin of the photo-isolator P17, the other end of the resistor R39 is coupled to a positive digital power supply voltage DVCC3_3, one end of a resistor R38 is coupled to one end of the resistor R37 far away from the switch K17, and the other end of the resistor R38 is coupled to the negative electrode (Vin-).
An auxiliary detection module having 8 first inputs and a second input is provided as in fig. 5. The switching tube Q1 may be the switching unit described above as in fig. 5. The photo-isolator P50 may be the first control unit described above. R50 and R49 in fig. 5 constitute the first voltage dividing unit described above.
As described with reference to fig. 4,5 and 6, at time T1 after the product is reset and initialized, the processor pulls down the control signal di_pwm for a duration Td, the primary side of the photo-isolator P50 is turned on, and in the 8-channel input circuit, as long as any one of the switches K10 to K17 in fig. 4 is turned on, one of the nodes corresponding to RIN10 to RIN17 will obtain a suitable high level through resistor voltage division, and the high level changes pin 3 of the photo-isolator P50 into a high level through one of the diodes D9 to D16, drives the switch tube Q1 to be turned on through the voltage division of R50 and R49, and connects the load resistors R41 to R49 of each input channel to the corresponding channel. Such as load resistor R41, is coupled between resistor R10 and switch K10 via node IN 11. Such as load resistor R48, is coupled between resistor R36 and switch K17 through node IN 17. The processor samples the 8-channel switching state at the time T2, and the processor turns off the switching tube Q1 after the 8-channel switching state is judged so as to reduce the power consumption.
If the 8-way switch is off, the 4-pin of the photo-isolator P50 is low, the switching tube Q1 will not be turned on, and the 8-way resistive load will not be connected to the circuit of fig. 4. However, at this time, since the switch state is off, the switch state judgment of the processor is not affected by the fact that no fixed resistance load is connected.
When the power-on detection is performed for the first time, the control of the switch tube Q1 does not adopt a PWM mode, but is continuously conducted for Td time, because the oxide layer on the surface of the switch is formed due to the fact that the oxide layer is not operated for a long time, when the power-on detection is performed for the first time, the oxide layer is broken down by continuous high current, and then the high current is not required to be conducted every time.
In order to reduce occupation of processor pin resources, 8-channel input is controlled by a switching tube, and mutual isolation of 8 channels can be ensured by D1-D8 and D9-D16.
In the subsequent switch state detection moment, the switching tube Q1 adopts a PWM driving mode, so that the instantaneous large current can be ensured, the average power consumption of the load resistor in the input period can be greatly reduced, and the power consumption and the heating of the resistor load are further reduced. Before the processor detects the switch state, the switch tube Q1 is turned on, and after the detection is completed, the switch tube Q1 is turned off.
In the application scenario, in order to increase the current flowing through the switch contact when the switch is turned on, besides the current passing through the current limiting resistor and the current flowing through the photoelectric isolator (the primary side current of the photoelectric isolator is 1mA, namely, the photoelectric isolator can be reliably conducted), a fixed load resistor is added to each channel at the input circuit port, and a proper resistance value is selected according to the input voltage, so that the current flowing through the resistor load is about 10mA, and when the switch is turned on, the current flowing through the contact is the sum of the optocoupler current and the fixed resistance load current.
In order to reduce circuit power consumption, the load resistor is connected to the circuit at a proper time by a control algorithm and driven in a PWM (Pulse Width Modulation ) mode, and the load resistor is closed after detection is completed, so that the overall power consumption can be greatly reduced.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the application, and the electronic device 200 includes a switch state detecting circuit 100. The switch state detection circuit 100 is the same as the switch state detection circuit 100 of any one of the above embodiments.
The application also provides a switch state detection method. The switching state detection circuit is applied to a switching state detection circuit, such as a switching state detection circuit. The method comprises the following steps: the auxiliary detection module 20 responds to the first control signal sent by the processor 10, and the switch to be detected is in a conducting state, and the load resistor in the auxiliary detection module 20 is connected to the main detection module 30, so that the current flowing through the switch to be detected is increased, and the processor 10 is enabled to detect the switch state.
In summary, according to the switch state detection method, circuit and electronic device provided by the application, the auxiliary detection module 20 is utilized to dynamically increase the load resistance in the detection loop, so as to increase the current flowing through the switch to be detected, break down the metal oxide layer on the contact of the switch to be detected, improve the accuracy of the processor 10 in detecting the switch state, and reduce the false detection phenomenon. Further, by dynamically switching in the auxiliary detection module 20 to the load resistor, the addition of a constant resistor to the main detection module 30 is avoided, so as to reduce the power consumption of the overall switch state detection circuit, such as switching off the load resistor after the detection is completed, so that the overall power consumption can be greatly reduced. The technical scheme of the application can realize reliable detection of the input state of the multichannel switch under the condition that the newly-added power consumption is almost negligible.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The integrated units of the other embodiments described above may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as stand alone products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor 10 (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of embodiments of the present application, and is not intended to limit the scope of the application, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present application or directly or indirectly applied to other related technical fields are included in the scope of the present application.

Claims (10)

1. A switch state detection circuit, the switch state detection circuit comprising:
A processor;
the input end of each main detection module is coupled with a switch to be detected, and the output end of each main detection module is coupled with the processor;
The control end of the auxiliary detection module is coupled with the processor, the first input end of the auxiliary detection module is coupled with the input end of the main detection module, and the second input end of the auxiliary detection module is coupled with the voltage dividing node of the main detection module; the voltage dividing node is positioned behind the input end of the main detection module;
The auxiliary detection module responds to a first control signal of the processor, the switch to be detected is in a conducting state, a load resistor in the auxiliary detection module is connected to the main detection module, and current flowing through the switch to be detected is increased, so that the processor can detect the switch state.
2. The switch-state detection circuit of claim 1, wherein the auxiliary detection module comprises:
at least one first input end, each of which is coupled with an input end of the main detection module;
at least one second input end, each second input end is coupled with a voltage division node of the main detection module respectively;
the first end of the first control unit is coupled with the working power supply end, the second end of the first control unit is used as the control end of the auxiliary detection module and is coupled with the processor, and the third end of the first control unit is coupled with the at least one second input end;
The control end of the switch unit is coupled with the fourth end of the first control unit, the first end of the switch unit is coupled with the at least one first input end through the load resistor, and the second end of the switch unit is grounded;
The second end of the first control unit responds to a first control signal of the processor, and the third end and the fourth end of the control end are conducted; and the switch unit responds to the switch to be detected to be in a conducting state, and the load resistor is connected to the main detection module, so that the current flowing through the switch to be detected is increased, and the processor is enabled to detect the switch state.
3. The switch state detection circuit of claim 2, wherein each of the load resistors is coupled to a first terminal of the switch unit through a diode; the positive electrode of the diode is coupled with the load resistor, and the negative electrode of the diode is coupled with the first end of the switch unit.
4. The switch state detection circuit of claim 2, wherein each of the second input terminals is coupled to a third terminal of the control unit via a diode, respectively; the positive electrode of the diode is coupled with the second input end, and the negative electrode of the diode is coupled with the third end of the control unit.
5. The switch-state detection circuit of claim 2, wherein the auxiliary detection module further comprises:
The first end of the first voltage division unit is coupled with the fourth end of the control unit, the second end of the first voltage division unit is coupled with the control end of the switch unit, and the third end of the first voltage division unit is grounded.
6. The switch-state detection circuit of claim 1, wherein each of the primary detection modules comprises:
The first end of the second voltage division unit is used as the input end of the main detection module and is coupled with the first input end of the auxiliary detection module and the switch to be detected, and the voltage division node of the second voltage division unit is coupled with the second input end of the auxiliary detection module;
The first end of the second control unit is coupled with the second end of the second voltage division unit, the second end of the second control unit is coupled with the power negative electrode, the third end of the second control unit is grounded, and the fourth end of the second control unit is used as the output end of the main detection module and is coupled with the processor.
7. The switch state detection circuit of claim 1, wherein the processor outputs a low level first control signal for a preset time in response to a first power-up detection of the switch state detection circuit, and the auxiliary detection module accesses the load resistor to the main detection module in response to the low level first control signal to increase a current flowing through the switch to be detected for breaking through a metal oxide layer on a corresponding contact of the switch to be detected.
8. The switch state detection circuit of claim 7, wherein the processor outputs the first control signal in a PWM manner in response to a first power-up detection being completed.
9. An electronic device comprising a switch state detection circuit as claimed in any one of claims 1-8.
10. A switching state detection method, characterized in that it is applied to a switching state detection circuit, the switching state detection circuit comprising: a processor; the input end of each main detection module is coupled with a switch to be detected, and the output end of each main detection module is coupled with the processor; the control end of the auxiliary detection module is coupled with the processor, the first input end of the auxiliary detection module is coupled with the input end of the main detection module, and the second input end of the auxiliary detection module is coupled with the voltage dividing node of the main detection module; the voltage dividing node is positioned behind the input end of the main detection module; the method comprises the following steps:
The auxiliary detection module responds to a first control signal sent by the processor, the switch to be detected is in a conducting state, and a load resistor in the auxiliary detection module is connected to the main detection module, so that the current flowing through the switch to be detected is increased, and the processor is enabled to detect the switch state.
CN202410502049.0A 2024-04-25 2024-04-25 Switch state detection method, circuit and electronic equipment Active CN118112409B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410502049.0A CN118112409B (en) 2024-04-25 2024-04-25 Switch state detection method, circuit and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410502049.0A CN118112409B (en) 2024-04-25 2024-04-25 Switch state detection method, circuit and electronic equipment

Publications (2)

Publication Number Publication Date
CN118112409A true CN118112409A (en) 2024-05-31
CN118112409B CN118112409B (en) 2024-08-27

Family

ID=91209063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410502049.0A Active CN118112409B (en) 2024-04-25 2024-04-25 Switch state detection method, circuit and electronic equipment

Country Status (1)

Country Link
CN (1) CN118112409B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110311237A1 (en) * 2010-06-18 2011-12-22 Canon Kabushiki Kaisha Method for detecting opening/closed state of an interlock switch provided in an electronic device
WO2016136422A1 (en) * 2015-02-26 2016-09-01 株式会社オートネットワーク技術研究所 Power supply device
CN109917280A (en) * 2019-02-21 2019-06-21 东软睿驰汽车技术(沈阳)有限公司 A kind of circuit state detection system and its detection method and a kind of high tension loop
CN213122210U (en) * 2020-09-29 2021-05-04 蜂巢能源科技有限公司 Detection device and system for control switch
CN220709309U (en) * 2023-08-24 2024-04-02 深圳市拓湃新能源科技有限公司 Switch detection circuit and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110311237A1 (en) * 2010-06-18 2011-12-22 Canon Kabushiki Kaisha Method for detecting opening/closed state of an interlock switch provided in an electronic device
WO2016136422A1 (en) * 2015-02-26 2016-09-01 株式会社オートネットワーク技術研究所 Power supply device
CN109917280A (en) * 2019-02-21 2019-06-21 东软睿驰汽车技术(沈阳)有限公司 A kind of circuit state detection system and its detection method and a kind of high tension loop
CN213122210U (en) * 2020-09-29 2021-05-04 蜂巢能源科技有限公司 Detection device and system for control switch
CN220709309U (en) * 2023-08-24 2024-04-02 深圳市拓湃新能源科技有限公司 Switch detection circuit and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘晔 等: "装甲车车载设备绝缘电阻与开关导通状态测试仪的研发", 《中国测试》, vol. 39, no. 4, 31 July 2013 (2013-07-31), pages 69 - 72 *

Also Published As

Publication number Publication date
CN118112409B (en) 2024-08-27

Similar Documents

Publication Publication Date Title
US8954628B2 (en) Portable device and peripheral extension dock
CN111917163A (en) Multi-port charging control circuit and method, charging chip and power supply equipment
CN105577152B (en) Protection circuit in load switch
CN101452049A (en) Circuit failure testing method, apparatus and single board
CN111584959A (en) Lithium battery passivation detection and activation circuit, method and device
CN110649694A (en) NCSI network card power supply system
CN106611981A (en) Battery management system and method
CN114815946A (en) Current output equipment, method, device, system and medium
CN111146928A (en) Regulating circuit and BUCK circuit
CN118112409B (en) Switch state detection method, circuit and electronic equipment
CN109193834B (en) Overvoltage protection device, method and system
CN105703021B (en) The battery management system and battery management system awakening method of low-power consumption standby
CN104503560A (en) Server with power source protection system and power source protection method
US10819123B2 (en) Voltage collection circuit and circuit control method
CN109633426B (en) Switch detection method
CN107508355B (en) A kind of voltage control method and charging equipment
CN113156244B (en) Method and device for testing charging device, electronic device and storage medium
CN105097356A (en) Control method and device
CN116417982A (en) Intelligent stable power supply system
CN115296285A (en) Power protection circuit, method, device and computer storage medium
CN109839529A (en) The test device and test method of chip operating voltage
CN108896902B (en) BMS single acquisition circuit fault diagnosis circuit, system and method
CN114498861A (en) Control method, device, equipment and storage medium of battery management system
CN112564267B (en) Power supply switching circuit applied to multiple groups of power supplies
CN107995000B (en) Power supply detection method and equipment

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
GR01 Patent grant
GR01 Patent grant