CN103107812A - Alternating signal sampling device and implementation method thereof - Google Patents

Alternating signal sampling device and implementation method thereof Download PDF

Info

Publication number
CN103107812A
CN103107812A CN2013100156138A CN201310015613A CN103107812A CN 103107812 A CN103107812 A CN 103107812A CN 2013100156138 A CN2013100156138 A CN 2013100156138A CN 201310015613 A CN201310015613 A CN 201310015613A CN 103107812 A CN103107812 A CN 103107812A
Authority
CN
China
Prior art keywords
signal
comparator
rectifier bridge
adc module
sampling
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
Application number
CN2013100156138A
Other languages
Chinese (zh)
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.)
Aerospace Science and Industry Shenzhen Group Co Ltd
Original Assignee
Aerospace Science and Industry Shenzhen Group 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 Aerospace Science and Industry Shenzhen Group Co Ltd filed Critical Aerospace Science and Industry Shenzhen Group Co Ltd
Priority to CN2013100156138A priority Critical patent/CN103107812A/en
Publication of CN103107812A publication Critical patent/CN103107812A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Analogue/Digital Conversion (AREA)

Abstract

The invention discloses an alternating signal sampling device and an implementation method of the alternating signal sampling device. The alternating signal sampling device comprises a rectifier bridge and a processor, wherein the rectifier bridge is connected with an input alternating signal, and the processor is connected with the alternating signal and the rectifier bridge. The processor comprises an analog-to-digital converter (ADC) module, a comparator and a central processing unit (CPU), wherein the ADC module is connected with the rectifier bridge, the comparator is connected with the alternating signal, and the CPU is connected with the ADC module and the comparator. The rectifier bridge is used for rectifying the alternating signal into a full-wave rectified signal containing positive voltage. The comparator is used for outputting corresponding high level and low level according to the positive voltage and the negative voltage of the alternating signal. The ADC module is used for converting the full-wave rectified signal into a digital quantity full-wave rectified signal and sampling the digital quantity full-wave rectified signal to generate a corresponding sampling value. The CPU is used for conducting sign bit processing on the sampling value according to the high level and the low level to obtain the original alternating signal. Through the rectifier bridge and the comparator in the processor, the purpose of collecting alternating signals is achieved, and power consumption and cost are lowered.

Description

A kind of AC signal sampling apparatus and its implementation
Technical field
The present invention relates to AC signal sampling field, relate in particular to a kind of AC signal sampling apparatus and its implementation.
Background technology
Analogue-to-digital converters, the English ADC that is called for short is a very important equipment in modern digital circuits, it is responsible for analog signal conversion is digital signal.At present nearly all processor all chip internal integrated ADC.The power dissipation ratio of the MSP430 chip that TI company produces is lower, can work under battery powered condition several years even several moons, has splendid power dissipation ratio of performance.And, an integrated ADC module of optimizing for low-power consumption in the MSP430 chip, different according to model, the ADC specification is also different, but basically all has the resolution of 10 to 12, the highest sampling rate of hundreds of ksps, a plurality of single-ended input channels.But it has an inherent shortcoming, there is no exactly the difference input channel, can't detect the AC signal with generating positive and negative voltage.
Analog quantity of difference input is that the voltage difference by two pins decides, and it is positive or negative that the difference input allows the voltage difference of two pins.Analog quantity of single-ended input is to be decided by input pin voltage difference over the ground, can only gather positive voltage.
The ADC of MSP430 only has single-ended input, just means to gather positive voltage, can't gather negative voltage.Usually take the way that is biased on signal for the collection of AC signal, by adding an enough voltage to AC signal, whole AC signal is all positive voltage, and like this, the peak of AC signal becomes original 2 times.So just can solve the drawback that single-ended input can not gather negative voltage.As shown in Figure 1, biasing circuit is generally to be made of operational amplifier, add AC signal at the Vin place, the V+ place adds the maximum V+ of AC signal, and output signal is a signal that there is no negative voltage, and the current drain of operational amplifier needs several milliamperes at least, this will offset the advantage of MSP430 super low-power consumption and power saving, general battery only has thousands of MAHs, if used operational amplifier, battery life will shorten greatly.
Summary of the invention
The technical problem to be solved in the present invention is, use biasing circuit to gather the defective that AC signal has been offset the advantage of the low in energy consumption and power saving of MSP430 family chip for prior art, a kind of AC signal sampling apparatus and its implementation that reduces power consumption and cost is provided.
The technical solution adopted for the present invention to solve the technical problems is: a kind of AC signal sampling apparatus is provided, it comprise the rectifier bridge that is connected with the AC signal of inputting and respectively with described AC signal be connected the processor that rectifier bridge is connected, described processor comprise the ADC module that is connected with described rectifier bridge, the comparator that is connected with described AC signal and respectively with described ADC module be connected the CPU that comparator is connected, wherein:
Described rectifier bridge, being used for is the full wave rectified signal that comprises positive voltage with described AC signal rectification;
Described comparator is used for positive voltage and corresponding high level and the low level of negative voltage output according to described AC signal;
Described ADC module be used for described full wave rectified signal is converted to the full wave rectified signal of digital quantity, and the full wave rectified signal of the described digital quantity of sampling generates corresponding sampled value;
Described CPU be used for according to described high level and described low level, described sampled value being carried out the sign bit processing, and reduction obtains original described AC signal.
Preferably, according to described high level and described low level, described sampled value being carried out sign bit processes and is specially:
If described comparator output high level, the corresponding sign bit of described sampled value is for just;
If described comparator output low level, the corresponding sign bit of described sampled value is for negative.
Preferably, described rectifier bridge is comprised of diode D1, the diode D2, diode D3 and the diode D4 that connect in turn.
Preferably, connect by described AC signal between the positive pole of described comparator and negative pole.
Preferably, described processor is comprised of chip MSP430F5310, and wherein, described chip MSP430F5310 comprises the first pin A0, the second pin A1 and the 3rd pin A2.
Preferably, described the first pin A0 connects described full wave rectified signal.
Preferably, connect by described AC signal between described the second pin A1 and described the 3rd pin A2.
The present invention also provides a kind of implementation method of AC signal sampling apparatus, and described device is above-mentioned device, said method comprising the steps of:
The S1.ADC module begins sampling, and CPU begins to read the output valve of comparator simultaneously;
S2. wait for that described ADC module completes sampling in Preset Time;
The sampled value of S3. according to the output valve of comparator, the ADC module being sampled is carried out sign bit and is processed.
Preferably, further comprising the steps of before described step S1:
S0. the hardware of described device carried out initialization, and open the reference voltage of comparator.
Preferably, if the output valve of comparator greater than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for just;
If the output valve of comparator is less than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for negative.
Implement technical scheme of the present invention, have following beneficial effect: by the comparator of rectifier bridge and processor inside, reached the ability that gathers AC signal, only increased the current drain of several microamperes, reduced simultaneously cost.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in accompanying drawing:
Fig. 1 be prior art AC signal sampling apparatus structural representation;
Fig. 2 is the structural representation of AC signal sampling apparatus of the present invention;
Fig. 3 is the connection diagram of rectifier bridge of the present invention and chip MSP430F5310;
Fig. 4 is the circuit diagram of comparator of the present invention;
Fig. 5 is the flow chart of the implementation method of AC signal sampling apparatus of the present invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
see also Fig. 2, Fig. 2 is the structural representation of AC signal sampling apparatus of the present invention, as shown in Figure 2, this device comprise the rectifier bridge 100 that is connected with the AC signal Vin that inputs and respectively with described AC signal Vin be connected the processor 200 that rectifier bridge 100 is connected, described processor 200 comprises the ADC module 201 that is connected with described rectifier bridge 100, the comparator 202 that is connected with described AC signal Vin and respectively with described ADC module 201 be connected the CPU203 that comparator 202 is connected, that is to say, the interior integrated ADC module 201 of this processor 200, the functional modules such as comparator 202 and CPU203.
Lower mask body is introduced the effect of various piece:
Described rectifier bridge 100, be used for described AC signal Vin rectification for only comprising the full wave rectified signal of positive voltage, what should explain is, AC signal Vin generally comprises positive voltage and negative voltage, the amplitude of supposing the positive voltage of AC signal Vin is V, the amplitude of negative voltage is V, and this AC signal Vin is the full wave rectified signal of 2V by the amplitude that the rear output of rectifier bridge 100 only comprises positive voltage.
please in conjunction with consulting Fig. 3, described rectifier bridge 100 is by the diode D1 that connects in turn, diode D2, diode D3 and diode D4 form, it is worth mentioning that, described processor 200 is comprised of chip MSP430F5310, should be noted that, processor 200 can be comprised of other chips of MSP430 series, in the present embodiment, described chip MSP430F5310 comprises the first pin A0, the second pin A1 and the 3rd pin A2, wherein, described the first pin A0 connects described full wave rectified signal, connect by described AC signal Vin between described the second pin A1 and described the 3rd pin A2.
Described comparator 202 is used for positive voltage and corresponding high level and the low level of negative voltage output according to described AC signal Vin.The circuit of comparator 202 connects by described AC signal Vin between the positive pole of described comparator 202 and negative pole as shown in Figure 4.
Should be noted that, the operation principle of comparator 202 these components and parts is: comparator 202 is used for relatively its two corresponding levels of pin inputting, suppose that these two corresponding level of pin are respectively V+ and V-, if V+ is during greater than V-, the output valve Vout of comparator 202 is high level; During less than V-, the output valve Vout of comparator 202 is low level as V+.That is to say, in the present embodiment, when AC signal Vin was positive voltage, the output valve Vout of comparator 202 was high level.When AC signal Vin was negative voltage, the output valve Vout of comparator 202 was low level, and like this, the AC signal Vin that just can input by the output valve Vout judgement of comparator 202 is positive voltage or negative voltage.
Described ADC module 201 be used for described full wave rectified signal is converted to the full wave rectified signal of digital quantity, and the full wave rectified signal of the described digital quantity of sampling generates corresponding sampled value.
Described CPU203, be used for according to described high level and described low level, described sampled value being carried out the sign bit processing, and then the sampled value reduction of the digital quantity that will process through symbol obtains the described AC signal of original analog quantity, thereby the processor that has solved prior art MSP430 series can't directly gather the problem of AC signal, also solves simultaneously to add operational amplifier and consist of biasing circuit and cause problem for the shorter battery life of the processor power supply of MSP430 series.
In the present embodiment, according to described high level and described low level, described sampled value being carried out sign bit processes and is specially:
If described comparator 202 output high level, the corresponding sign bit of described sampled value is for just;
If described comparator 202 output low levels, the corresponding sign bit of described sampled value is for negative.
See also Fig. 5, Fig. 5 is the flow chart of the implementation method of AC signal sampling apparatus of the present invention, as shown in Figure 5, said method comprising the steps of:
In step S0, the hardware of described device is carried out initialization, and opens the reference voltage of comparator, the reference voltage here be for the output valve of follow-up comparator as a reference, those skilled in the art should understand, and does not repeat them here.
In step S1, the ADC module begins sampling, and simultaneously CPU begins to read the output valve of comparator, can guarantee like this value that the ADC module the samples sign bit corresponding with its value corresponding be the AC signal of putting at the same time.
In step S2, wait for that described ADC module completes sampling in Preset Time.After the ADC module is completed sampling, can't distinguish the generating positive and negative voltage of original AC signal Vin, so need execution in step S3.
In step S3, the sampled value of the ADC module being sampled according to the output valve of comparator is carried out sign bit and is processed, in the present embodiment, if the output valve of comparator greater than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for just; If the output valve of comparator is less than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for negative.
Should be noted that the value that the ADC module is sampled is that a unsigned number step S 3 changes it into signed number by following false code.
False code is:
int sign_add(void)
{
int output;
if(COMP_RESULT > 0) { (71)
output = ADC_RESULT; (72)
}
else { (73)
output = 0 - (int)ADC_RESULT; (74)
}
return output;
}
Wherein COMP_RESULT is the output valve of comparator 202, and ADC_RESULT is the value that the ADC module is sampled.In above-mentioned code, when the output valve of COMP_RESULT is that the AC signal that 1 interval scale is inputted is positive voltage, output valve is that 0 interval scale AC signal is negative voltage.Therefore use a judgement (71) to process respectively the both positive and negative situation, when being in positive voltage, the value ADC_RESULT that the ADC module is sampled need not to add negative sign (72), and when being in negative voltage (73), need to add negative sign (74) for the value that module is sampled, so just reduce the symbol of original AC signal, thereby reached the purpose that gathers AC signal.
The invention solves the problem that processor can't directly gather AC signal, abandoned the scheme that operational amplifier consists of biasing circuit that adds, the comparator by rectifier bridge and processor inside has reached the ability that gathers AC signal, only increase the current drain of several microamperes, reduced simultaneously cost.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the various embodiments described above method is to come the relevant hardware of instruction to complete by program, corresponding program can be stored in a computer read/write memory medium, described storage medium is as ROM/RAM, disk or CD etc.
The above is only the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in claim scope of the present invention.

Claims (10)

1. AC signal sampling apparatus, it is characterized in that, it comprise the rectifier bridge that is connected with the AC signal of inputting and respectively with described AC signal be connected the processor that rectifier bridge is connected, described processor comprise the ADC module that is connected with described rectifier bridge, the comparator that is connected with described AC signal and respectively with described ADC module be connected the CPU that comparator is connected, wherein:
Described rectifier bridge is used for described AC signal rectification for only comprising the full wave rectified signal of positive voltage;
Described comparator is used for positive voltage and corresponding high level and the low level of negative voltage output according to described AC signal;
Described ADC module be used for described full wave rectified signal is converted to the full wave rectified signal of digital quantity, and the full wave rectified signal of the described digital quantity of sampling generates corresponding sampled value;
Described CPU be used for according to described high level and described low level, described sampled value being carried out the sign bit processing, and reduction obtains original described AC signal.
2. device according to claim 1, is characterized in that, according to described high level and described low level, described sampled value carried out sign bit and process and be specially:
If described comparator output high level, the corresponding sign bit of described sampled value is for just;
If described comparator output low level, the corresponding sign bit of described sampled value is for negative.
3. device according to claim 1, is characterized in that, described rectifier bridge is comprised of the diode (D1), diode (D2), diode (D3) and the diode (D4) that connect in turn.
4. device according to claim 1, is characterized in that, connects by described AC signal between the positive pole of described comparator and negative pole.
5. device according to claim 1, is characterized in that, described processor is comprised of chip MSP430F5310, and wherein, described chip MSP430F5310 comprises the first pin A0, the second pin A1 and the 3rd pin A2.
6. device according to claim 5, is characterized in that, described the first pin A0 connects described full wave rectified signal.
7. device according to claim 5, is characterized in that, connects by described AC signal between described the second pin A1 and described the 3rd pin A2.
8. the implementation method of an AC signal sampling apparatus, is characterized in that, described device is the claims 1 to the 7 described devices of any one, said method comprising the steps of:
The S1.ADC module begins sampling, and CPU begins to read the output valve of comparator simultaneously;
S2. wait for that described ADC module completes sampling in Preset Time;
The sampled value of S3. according to the output valve of comparator, the ADC module being sampled is carried out sign bit and is processed.
9. method according to claim 8, is characterized in that, and is further comprising the steps of before described step S1:
S0. the hardware of described device carried out initialization, and open the reference voltage of comparator.
10. method according to claim 9, is characterized in that, if the output valve of comparator greater than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for just;
If the output valve of comparator is less than described reference voltage, the ADC module corresponding sign bit of sampled value of sampling is for negative.
CN2013100156138A 2013-01-16 2013-01-16 Alternating signal sampling device and implementation method thereof Pending CN103107812A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013100156138A CN103107812A (en) 2013-01-16 2013-01-16 Alternating signal sampling device and implementation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013100156138A CN103107812A (en) 2013-01-16 2013-01-16 Alternating signal sampling device and implementation method thereof

Publications (1)

Publication Number Publication Date
CN103107812A true CN103107812A (en) 2013-05-15

Family

ID=48315415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013100156138A Pending CN103107812A (en) 2013-01-16 2013-01-16 Alternating signal sampling device and implementation method thereof

Country Status (1)

Country Link
CN (1) CN103107812A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113866488A (en) * 2021-10-21 2021-12-31 重庆华虹仪表有限公司 Method and device for calculating true effective value

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0760514A2 (en) * 1995-08-31 1997-03-05 Hewlett-Packard Company Analog to digital converter, decimation and storage system
CN202282788U (en) * 2011-11-17 2012-06-20 成都可为科技发展有限公司 AC IRIG-B demodulation system
CN102707127A (en) * 2012-05-29 2012-10-03 长沙奥托自动化技术有限公司 Simplified type alternating-current zero-crossing detecting and amplitude value sampling unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0760514A2 (en) * 1995-08-31 1997-03-05 Hewlett-Packard Company Analog to digital converter, decimation and storage system
CN202282788U (en) * 2011-11-17 2012-06-20 成都可为科技发展有限公司 AC IRIG-B demodulation system
CN102707127A (en) * 2012-05-29 2012-10-03 长沙奥托自动化技术有限公司 Simplified type alternating-current zero-crossing detecting and amplitude value sampling unit

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: "求助:负电压信号的AD采集实现", 《HTTP://BBS.CSDN.NET/TOPICS/310052123》, 2 June 2009 (2009-06-02), pages 1 - 7 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113866488A (en) * 2021-10-21 2021-12-31 重庆华虹仪表有限公司 Method and device for calculating true effective value

Similar Documents

Publication Publication Date Title
CN103744467B (en) For solar cell maximum power tracing device and the control method thereof of miniature satellite power system
CN104935072B (en) Stand-by power supply method for handover control and device
CN106209066B (en) Chip pin multiplexing method and chip
CN105827112A (en) BUCK converter having low power consumption characteristic
CN104283559A (en) Built-in-self-test for an analog-to-digital converter
CN106911254A (en) Electronic device
CN205123711U (en) Analog -to -digital conversion chip volume production test circuit
CN104050973A (en) Low power audio trigger via intermittent sampling
KR20140111342A (en) Power supply device, method for managing power supply thereof and wireless communication terminal
CN103384152A (en) Analog-digital converter, analog-digital conversion method and integrated circuit chip
CN105092937A (en) Full-cycle current detection circuit
CN105376070A (en) Method and system of power chip for adaptively supplying operating voltage to Ethernet packet switching chip
CN104122967B (en) A kind of power on and off reset control circuit and computer
CN103107812A (en) Alternating signal sampling device and implementation method thereof
CN104919703B (en) Single-ended comparators circuit with high voltage input capability
CN203535119U (en) Capacitance detection circuit
CN205608152U (en) Parameter acquisition circuit that three -phase asynchronous motor used
CN203838301U (en) Automatic testing device for pre-amplifier
CN204761416U (en) AD converting circuit for test system is moved to microbit
CN104090153A (en) Detection system and detection method of liquid crystal module multi-channel power supply
TWI727450B (en) Power supplier circuit and operation method
CN203414549U (en) Ultra-low power test power meter
CN113098391A (en) Group cascade DC arc fault detection device and method
CN207339648U (en) A kind of voltage conversion circuit for Internet of Things single-site data acquisition
CN112885339A (en) Voice awakening system and voice recognition system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130515