CN105511362A - Analog quantity and switching quantity shared detection device and method - Google Patents

Analog quantity and switching quantity shared detection device and method Download PDF

Info

Publication number
CN105511362A
CN105511362A CN201610020756.1A CN201610020756A CN105511362A CN 105511362 A CN105511362 A CN 105511362A CN 201610020756 A CN201610020756 A CN 201610020756A CN 105511362 A CN105511362 A CN 105511362A
Authority
CN
China
Prior art keywords
resistance
analog
analog quantity
main control
control chip
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
CN201610020756.1A
Other languages
Chinese (zh)
Other versions
CN105511362B (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.)
Guangdong PHNIX Eco Energy Solution Ltd
Original Assignee
Guangdong PHNIX Eco Energy Solution 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 Guangdong PHNIX Eco Energy Solution Ltd filed Critical Guangdong PHNIX Eco Energy Solution Ltd
Priority to CN201610020756.1A priority Critical patent/CN105511362B/en
Publication of CN105511362A publication Critical patent/CN105511362A/en
Application granted granted Critical
Publication of CN105511362B publication Critical patent/CN105511362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/26Pc applications
    • G05B2219/2612Data acquisition interface

Abstract

The invention relates to an analog quantity and switching quantity shared detection device and method. The detection device comprises a main control chip, a first resistor and a second resistor, wherein an analog-to-digital conversion interface of the main control chip is connected with one end of the first resistor; the other end of the first resistor is connected with one end of the second resistor; the other end of the second resistor is connected to a power supply; one end, connected with the second resistor, of the first resistor is connected with an analog quantity input device or a switching quantity input device. No matter whether the quantity is the external switching quantity or the external analog quantity, the device can well convert analog signals (a resistance value change or switch-off or switch-on state) of an external circuit into a voltage signal and transmit the voltage signal to the main control chip to be judged; the analog quantity input detection and the switching quantity input detection are realized through the same circuit. The device and the method have the advantages that the cost can be greatly reduced; meanwhile, the application flexibility of a circuit board is enhanced.

Description

The common detection device of analog quantity and switching value and method
Technical field
The present invention relates to detection field, particularly relate to common detection device and the method for a kind of analog quantity and switching value.
Background technology
In the controls, analog quantity refers to continually varying amount within the specific limits, and such as temperature is from 0 to 100 degree Celsius, and pressure is from 0 to 10 MPa, and liquid level is from 1 to 5 meter, and the aperture of electrically operated valve is from 0 to 100% etc., and these controlled quentity controlled variables are all analog quantitys.And switching value only has two states, as the conducting of switch and disconnection, relay closed and open, solenoid valve logical and disconnected etc.
In the conventional technology, simulated measurement input circuit and switching value input circuit be independently, different circuit.Figure 1 shows that the switching value input circuit in conventional art, wherein DI01 outside connected switch amount, DIN01 connects single-chip microcomputer.When switch closes, the voltage of DIN01 is 0V, and when switch disconnects, the voltage of DIN01 is 5V.Figure 2 shows that the simulated measurement input circuit in conventional art, wherein the external analog quantity of T4, AI04 connects single-chip microcomputer, and when external analog quantity changes, the voltage of AI04 network also will change thereupon.
Traditional switching value input circuit can only detector switch amount, traditional simulated measurement input circuit can only detect analog quantity, but along with the variation of product, the compatibility of circuit board to multiple product is also put on the agenda, if single input circuit can only access a kind of signal, the compatibility of circuit board can be made not high, and the waste of mainboard when can cause secondary development, increase cost.
Summary of the invention
Based on this, for solving the problems of the prior art, the invention provides common detection device and the method for a kind of analog quantity and switching value, greatly can reduce cost, dirigibility during intensifier circuit plate application simultaneously.
For achieving the above object, the embodiment of the present invention is by the following technical solutions:
A common detection device for analog quantity and switching value, comprises main control chip, the first resistance and the second resistance;
The analog to digital conversion access port of described main control chip is connected with one end of described first resistance, and the other end of described first resistance is connected with one end of described second resistance;
The other end of described second resistance is connected to power supply;
One end that described first resistance is connected with described second resistance is connected with analog input device or switching value input device.
And a kind of detection method of the common detection device based on above analog quantity and switching value, comprise the following steps:
When one end connection mode analog quantity input media that described first resistance is connected with described second resistance, the voltage of described analog to digital conversion access port is carried out analog to digital conversion by described main control chip, obtain ADC value, and determine the analog quantity size that accesses according to the mapping table of this ADC value and preset ADC value and analog quantity;
When one end connecting valve amount input media that described first resistance is connected with described second resistance, described in described main control chip, the voltage of analog to digital conversion access port carries out analog to digital conversion, obtain ADC value, and determine the on-off state of access according to this ADC value.
Based on technique scheme, no matter be outside connected switch amount or connect analog quantity, the simulating signal of external circuits (change of resistance value or the disconnection of switch, closure state) can be changed into voltage signal and be delivered to main control chip and judge by the present invention well, is detected and On-off signal detects by same circuit realiration analog input.The present invention can reduce cost greatly, dirigibility during intensifier circuit plate application simultaneously, avoids practical application breaker in middle amount input circuit to have and has more than needed and the generation of the situation of simulated measurement input circuit deficiency.
Accompanying drawing explanation
Fig. 1 is the switching value input circuit schematic diagram in conventional art;
Fig. 2 is the simulated measurement input circuit schematic diagram in conventional art;
Fig. 3 is the common detection device electrical block diagram in one embodiment of analog quantity of the present invention and switching value;
Fig. 4 is the detection method schematic flow sheet in one embodiment of analog quantity of the present invention and switching value.
Embodiment
Below in conjunction with preferred embodiment and accompanying drawing, content of the present invention is described in further detail.Obviously, hereafter described embodiment is only for explaining the present invention, but not limitation of the invention.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.Should be understood that, although adopt term " first ", " second " etc. to describe various information hereinafter, these information should not be limited to these terms, and these terms are only used for the information of same type to be distinguished from each other out.Such as, without departing from the present invention, " first " information also can be called as " second " information, similar, and " second " information also can be called as " first " information.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not full content.
Fig. 3 is the common detection device electrical block diagram in one embodiment of analog quantity of the present invention and switching value.As shown in Figure 3, analog quantity in the present embodiment and the common detection device of switching value comprise main control chip 1, first resistance R1 and the second resistance R2, wherein the analog to digital conversion access port (AD mouth) of main control chip 1 is connected with one end of the first resistance R1, the other end of the first resistance R1 is connected with one end of the second resistance R2, and the other end of the second resistance R2 is connected to power supply.One end that first resistance R1 is connected with the second resistance R2 is connected with analog input device or switching value input device.
Preferably, in the present embodiment, main control chip 1 selects single-chip microcomputer, such as STM32 single-chip microcomputer.As shown in Figure 3, T1 node connects the AD mouth of the first resistance R1 and single-chip microcomputer respectively, and the effect of the first resistance R1 is the electric current of restriction from T1 node-flow to single-chip microcomputer pin (if electric current crosses senior general burn out single-chip microcomputer).
Further, the analog quantity in the present embodiment and the common detection device of switching value also comprise the first electric capacity C1, and one end of the first electric capacity C1 is connected with the AD mouth of main control chip 1, the other end ground connection of the first electric capacity C1.Preferably, also comprise the second electric capacity C2, one end that the first resistance R1 is connected with the second resistance R2, can clutter effectively in filtering circuit by the first electric capacity C1 and the second electric capacity C2 by the second electric capacity C2 ground connection, prevents the normal work of noise jamming main control chip 1.
Preferably, supply voltage adopts 3.3V, and consider common analog input device (such as thermistor temperature-sensing probe), based on impedance matching, the second resistance R2 can adopt 5100 ohm.
Below the principle of work of the common detection device of the analog quantity in the present embodiment and switching value is described.Concrete, as shown in Figure 3, when AIN1 place connection mode analog quantity input media, common detection device can realize detecting the input of analog quantity.Different analog input values, for AIN1 node, is equivalent to have accessed a different resistance value.For thermistor temperature-sensing probe, when thermistor temperature-sensing probe detected temperatures, the different temperatures detected corresponds to different resistance values.In Fig. 3, the voltage of T1 node equals the voltage of AIN1 node, when AIN1 node accesses different resistance values, such as external thermistor temperature-sensing probe Rt, now power supply, the second resistance R2, thermistor temperature-sensing probe Rt form loop, and now the effect of the second resistance R2 is dividing potential drop, when thermistor temperature-sensing probe Rt resistance changes, correspondence also changes by the voltage of AIN1 node, and corresponding T1 node has different magnitudes of voltage.The magnitude of voltage of T1 node inputs to main control chip 1 by the analog-converted access port (AD mouth) of main control chip 1, and main control chip 1, by AD conversion, can obtain different ADC value (AD value); Like this, with reference to the specifications of thermistor temperature-sensing probe, namely can know, different AD value that different temperature is corresponding, main control chip just can determine the analog quantity size (namely determining the temperature value that thermistor temperature-sensing probe detects) of input according to AD value.Concrete, suppose that the resistance of external analog input device is R, then the voltage computing formula of T1 node is: 3.3*R/ (R+R2).Therefore the maximum voltage that T1 node can reach is 3.3V, and suppose that main control chip 1 carries 12 AD conversion chip, then maximum AD value is: 2 12=4096, namely 3.3V can be divided into 4096 deciles, the magnitude of voltage that each decile is corresponding is: 3.3/4096=0.0008V, if the magnitude of voltage of T1 node is nV, so main control chip 1 is just n/0.0008 by the AD value that AD conversion obtains.According to surveying the temperature value of thermistor temperature-sensing probe and the mapping table of resistance that obtain, resistance signal is converted to voltage signal again in conjunction with the circuit in the present embodiment, the mapping table of thermistor temperature-sensing probe temperature value and voltage can be obtained, again according to the corresponding relation (AD value=n/0.0008) of voltage and AD value, the mapping table of AD value and thermistor temperature-sensing probe temperature value finally just can be obtained.Therefore, main control chip 1 just can determine by the mapping table of AD value and preset AD value and analog quantity the temperature value that current thermistor temperature-sensing probe detects, the input realizing analog quantity detects.
In addition, when AIN1 accesses analog quantity, if main control chip 1 judge that AIN1 node accesses by AD value be an infinitely-great resistance value or equal the resistance value of 0 ohm, so can judge that now common detection device is in malfunction.
When AIN1 node connecting valve amount input media, power supply, the second resistance R2, switching value input device form loop, and the now effect of the second resistance R2 is current limliting (when preventing switch from closing short circuit).Because switching value only has disconnection and closed two states, therefore when on-off state is off, be equivalent to AIN1 node and accessed an infinitely-great resistance, when on-off state is for time closed, be equivalent to the resistance that AIN1 node has accessed one 0 ohm.With reference to shown in Fig. 3, if switch closes, the voltage of AIN1 node is 0V, if switch disconnects, the voltage of AIN1 node is 3.3V.Equally, the AD mouth of the magnitude of voltage access main control chip 1 of T1 node, main control chip 1, by AD conversion, can obtain different AD values, by different AD values, main control chip can judge that switching value disconnects or closure state.
Comprehensive foregoing is known, no matter be outside connected switch amount or connect analog quantity, the simulating signal of external circuits (change of resistance value or the disconnection of switch, closure state) can be changed into voltage signal and be delivered to main control chip and judge by the pick-up unit of analog quantity of the present invention and switching value well, is detected and On-off signal detects by same circuit realiration analog input.The present invention can reduce cost greatly, dirigibility during intensifier circuit plate application simultaneously, avoids practical application breaker in middle amount input circuit to have and has more than needed and the generation of the situation of simulated measurement input circuit deficiency.
According to the analog quantity of the invention described above and the common detection device of switching value, the present invention also provides the detection method of a kind of corresponding analog quantity and switching value, is described this detection method below in conjunction with accompanying drawing and preferred embodiment.
Fig. 4 is the detection method schematic flow sheet in one embodiment of analog quantity of the present invention and switching value.As shown in Figure 4, the analog quantity in this embodiment and the detection method of switching value, comprise the following steps:
Step S100, judges that external input quantity is analog quantity or switching value; If analog quantity, then enter step S101, if switching value, then enter step S201;
Step S101, one end connection mode analog quantity input media that the first resistance is connected with the second resistance, the voltage of analog to digital conversion access port is carried out analog to digital conversion by main control chip, obtains ADC value, enters step S102;
Step S102, determines the analog quantity size accessed according to the mapping table of ADC value and preset ADC value and analog quantity;
Step S201, one end connecting valve amount input media that described first resistance is connected with described second resistance, the voltage of analog to digital conversion access port is carried out analog to digital conversion by main control chip, obtains ADC value, enters step S202;
Step S202, determines the on-off state accessed according to ADC value.
The detection method of analog quantity that the embodiment of the present invention provides and switching value is described in detail in detail in the embodiment of the common detection device of above-mentioned analog quantity and switching value, has no longer repeated herein.
Each technical characteristic of the above embodiment can combine arbitrarily, for making description succinct, the all possible combination of each technical characteristic in above-described embodiment is not all described, but, as long as the combination of these technical characteristics does not exist contradiction, be all considered to be the scope that this instructions is recorded.
The above embodiment only have expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be construed as limiting the scope of the patent.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (6)

1. a common detection device for analog quantity and switching value, is characterized in that, comprises main control chip, the first resistance and the second resistance;
The analog to digital conversion access port of described main control chip is connected with one end of described first resistance, and the other end of described first resistance is connected with one end of described second resistance;
The other end of described second resistance is connected to power supply;
One end that described first resistance is connected with described second resistance is connected with analog input device or switching value input device.
2. the common detection device of analog quantity according to claim 1 and switching value, is characterized in that, also comprises the first electric capacity; One end of described first electric capacity is connected with the analog to digital conversion access port of described main control chip, the other end ground connection of described first electric capacity.
3. the common detection device of analog quantity according to claim 2 and switching value, is characterized in that, also comprises the second electric capacity; One end that described first resistance is connected with described second resistance is by described second capacity earth.
4. the common detection device of analog quantity according to any one of claim 1 to 3 and switching value, is characterized in that, described main control chip is single-chip microcomputer.
5. the common detection device of analog quantity according to any one of claim 1 to 3 and switching value, described supply voltage is 3.3V, and described second resistance is 5100 ohm.
6., based on a detection method for the common detection device of the analog quantity according to any one of claim 1 to 5 and switching value, it is characterized in that, comprise the following steps:
When one end connection mode analog quantity input media that described first resistance is connected with described second resistance, the voltage of described analog to digital conversion access port is carried out analog to digital conversion by described main control chip, obtain ADC value, and determine the analog quantity size that accesses according to the mapping table of this ADC value and preset ADC value and analog quantity;
When one end connecting valve amount input media that described first resistance is connected with described second resistance, described in described main control chip, the voltage of analog to digital conversion access port carries out analog to digital conversion, obtain ADC value, and determine the on-off state of access according to this ADC value.
CN201610020756.1A 2016-01-12 2016-01-12 The common detection device and method of analog quantity and switching value Active CN105511362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610020756.1A CN105511362B (en) 2016-01-12 2016-01-12 The common detection device and method of analog quantity and switching value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610020756.1A CN105511362B (en) 2016-01-12 2016-01-12 The common detection device and method of analog quantity and switching value

Publications (2)

Publication Number Publication Date
CN105511362A true CN105511362A (en) 2016-04-20
CN105511362B CN105511362B (en) 2018-12-11

Family

ID=55719430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610020756.1A Active CN105511362B (en) 2016-01-12 2016-01-12 The common detection device and method of analog quantity and switching value

Country Status (1)

Country Link
CN (1) CN105511362B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1992017830A1 (en) * 1991-04-02 1992-10-15 Asea Brown Boveri Ab Analog interface unit
CN103713551A (en) * 2013-12-20 2014-04-09 中国北方车辆研究所 Switching amount, frequency amount and analog voltage amount multiplexing input port sampling apparatus
CN104270136A (en) * 2014-09-23 2015-01-07 中国北方车辆研究所 Circuit for achieving general switching value collection through AD channel
CN104467854A (en) * 2015-01-07 2015-03-25 苏州蓝博控制技术有限公司 Port state acquisition circuit and method
CN104811178A (en) * 2015-04-27 2015-07-29 航天科技控股集团股份有限公司 Multi-path switching value collection device based on AD sampling circuit and collecting method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1992017830A1 (en) * 1991-04-02 1992-10-15 Asea Brown Boveri Ab Analog interface unit
CN103713551A (en) * 2013-12-20 2014-04-09 中国北方车辆研究所 Switching amount, frequency amount and analog voltage amount multiplexing input port sampling apparatus
CN104270136A (en) * 2014-09-23 2015-01-07 中国北方车辆研究所 Circuit for achieving general switching value collection through AD channel
CN104467854A (en) * 2015-01-07 2015-03-25 苏州蓝博控制技术有限公司 Port state acquisition circuit and method
CN104811178A (en) * 2015-04-27 2015-07-29 航天科技控股集团股份有限公司 Multi-path switching value collection device based on AD sampling circuit and collecting method thereof

Also Published As

Publication number Publication date
CN105511362B (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN105745548A (en) Battery fuel gauges using fet segment control to increase low current measurement accuracy
CN106841749A (en) One kind realizes two-way high-side current detection circuit using single amplifier
CN105515787A (en) Network port and Ethernet device
CN102496909B (en) Simple leakage protector with multi-gear adjustable protection values and action time
CN213780337U (en) NTC detection circuit and power electronic device
CN101995519B (en) Device and method for testing common-mode input impedance of operation amplifier
CN203909201U (en) DC output electric leakage detection circuit
CN103018588A (en) Low-power-consumption anti-interference three-state input detection circuit
CN105511362A (en) Analog quantity and switching quantity shared detection device and method
CN204928079U (en) Current foldback circuit , power factor correction circuit and transducer air conditioning
CN109709373B (en) Signal self-adaptive acquisition circuit and acquisition method
CN106849002B (en) Voltage protection circuit and terminal device
US20220166248A1 (en) Apparatus and method for detection of line to neutral back-feed voltage
CN110098811A (en) A kind of operational amplifier and display device
CN204836131U (en) Effective switch input signal acquisition circuit of high level
CN205691645U (en) A kind of signal detection system
CN107181645A (en) A kind of intelligent household control terminal WiFi communication test system
CN106980037A (en) Two-way Vehicular charger alternating current detection circuit and electric automobile
CN203643498U (en) Voltage sampling circuit of double supply change-over switch
CN207251583U (en) Number bus isolates telecommunication circuit
CN103033669B (en) Limit peak point current-sensing circuit of switching power supply
CN207007980U (en) A kind of AC dump detects circuit
CN206683790U (en) Temperature sensor detects circuit and air conditioner
CN206948353U (en) A kind of intelligent household control terminal WiFi communication test system
CN206002585U (en) Perception for electric fire disaster monitoring and resistive load share signal processor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant