Disclosure of Invention
The invention provides a non-contact current detection type electric quantity measuring device for a pipeline detector, which is used for monitoring the electricity consumption condition and the residual electric quantity of a battery pack and solving the technical problems in the prior art.
The technical scheme adopted by the invention for solving the technical problems in the prior art is as follows: a non-contact current detection type electric quantity measuring device for a pipeline detector is connected with a battery pack and comprises a voltage detection circuit, a current detection circuit, a signal conditioning circuit, an AD conversion circuit, a single chip microcomputer and a display assembly;
the voltage detection circuit is connected with the positive electrode and the negative electrode of the battery pack and outputs a real-time voltage sampling value of the battery pack to the signal conditioning circuit;
the current detection circuit adopts a non-contact current detection mode and outputs a current sampling value of a main circuit of a battery pack power supply to the signal conditioning circuit;
the signal conditioning circuit is used for performing signal conditioning on the voltage sampling value and the current sampling value and outputting the voltage sampling value and the current sampling value to the AD conversion circuit;
the AD conversion circuit carries out analog-to-digital conversion and outputs digital voltage detection and current detection data to the single chip microcomputer;
the single chip microcomputer is connected with the display assembly; and the display component is used for sending the real-time electricity consumption and the residual electricity quantity data of the battery pack to the display component for displaying.
Further, the current detection circuit includes: hall current sensor ACS711, capacitor C1, and resistor R3; a pin 12 of the ACS711 is connected with a +5V power supply, and a pin 5 is grounded; the pins 1 and 2 are in short circuit, and after the pins 3 and 4 are in short circuit, the short circuit is connected to a main power supply circuit of the battery pack, so that the current of the main circuit flows in from the pins 1 and 2 and flows out from the pins 3 and 4; a pin 11 outputs a current sampling value; a resistor R3 is connected between the pin 12 and the pin 6, and a filter capacitor C1 is connected between the pin 12 and the ground.
The Hall effect is utilized to carry out current detection, so that the power consumption of the precision resistor connected in series with the main circuit of the battery pack power supply is avoided when the precision resistor is connected in series for carrying out current detection, and the problem that the normal work of the main circuit of the battery power supply is influenced when the precision resistor fails is avoided; even if the measuring device breaks down, the normal work of the power supply main loop is not influenced.
Further, the voltage detection circuit adopts a resistance voltage division measuring device, which comprises a resistor R1, a resistor R2 and a sampling switch SW 1; the sampling switch SW1, the resistor R1 and the resistor R2 are sequentially connected in series with the anode and the cathode of the battery pack.
The resistor R1 and the resistor R2 are resistors with large resistance values, voltage sampling is carried out through serial voltage division, the power consumption of the measuring device can be reduced, and the voltage detection circuit can be disconnected as required by serially connecting the switch SW 1.
Further, the signal conditioning circuit comprises a voltage signal conditioning circuit and a current signal conditioning circuit;
the voltage signal conditioning circuit performs signal filtering and isolation on the voltage sampling value and outputs the voltage sampling value to the AD conversion circuit;
and the current signal conditioning circuit performs signal filtering and differential amplification on the current sampling value and outputs the current sampling value to the AD conversion circuit.
By respectively carrying out signal conditioning on the voltage sampling value and the current sampling value, clutter signals are filtered, isolated and amplified, and the amplitude requirement of AD conversion is met.
Further, the signal conditioning circuit comprises a dual operational amplifier chip LM258, resistors R4, R5, R6, R7, R8 and capacitors C2 and C3;
the operational amplifier 1 of the LM258, the resistors R4 and R5 and the capacitor C2 form a voltage follower, and signal filtering and isolation are carried out on a voltage sampling value;
the operational amplifier 2 of the LM258, the resistors R6, R7, R8 and the capacitor C3 form a differential amplifier, and signal filtering and differential amplification are carried out on a current sampling value;
the specific connection comprises:
pin 1 of LM258, which is connected to pin 2 of LM258 through resistor R5, and is used to output the conditioned voltage detection signal to the AD conversion circuit;
pin 3 of LM258 is connected with the output end of the voltage detection circuit through a resistor R4 and is grounded through a capacitor C2;
pin 4 of LM258 is grounded;
pin 5 of LM258, connect with output end of the current detection circuit through the resistance R6, and grounded through the capacitor C3;
pin 6 of LM258, connect +2.5V power through resistance R7;
pin 7 of LM258, which is connected to pin 6 of LM258 through resistor R8, and is used to output the conditioned current detection signal to the AD conversion circuit;
pin 8 of LM258 is connected to +5V power supply.
Further, the single chip microcomputer is ATmega 128.
Further, the AD conversion circuit adopts an ADC module embedded in a singlechip ATmega 128.
Further, the display component is an OCMJ4X8C _3 type liquid crystal display screen or a three-digit nixie tube.
The device further comprises a voltage conversion circuit for supplying power to the voltage detection circuit, the current detection circuit, the signal conditioning circuit, the AD conversion circuit, the singlechip and the display component, wherein the voltage conversion circuit comprises a DC-DC module 1 and a DC-DC module 2;
the input end of the DC-DC module 1 is connected with the positive pole and the negative pole of the battery pack and outputs +5V to the current detection circuit, the signal conditioning circuit and the display component for power supply; meanwhile, the DC-DC module 1 outputs +5V to the DC-DC module 2; the DC-DC module 2 outputs +3.3V voltage to supply power to the singlechip; and outputting +2.5V voltage to the signal conditioning circuit as the reference voltage of the differential amplifying circuit.
Further, the DC-DC module 1 adopts a DC/DC chopper circuit to implement buck conversion; the DC-DC module 2 realizes voltage conversion from +5V to 3.3V, +5V to 2.5V through the AMS1117 and peripheral circuits.
The invention has the advantages and positive effects that: the real-time monitoring of the current and the voltage of the battery pack is realized, the real-time monitoring of the real-time power consumption and the residual electric quantity of the battery pack is realized through the single chip microcomputer, and the related information is displayed in real time through the display assembly, so that pipeline detection personnel can know the power consumption condition of the battery pack in real time when using the pipeline detector to perform pipeline detection, and the battery pack can be replaced in time when the electric quantity of the battery pack is exhausted. The Hall element is adopted for non-contact current detection, so that the power consumption of the precision resistor connected in series with the power supply main loop when the precision resistor is connected in series for current detection is avoided, and the problem that the normal work of the battery power supply main loop is influenced when the precision resistor fails is avoided; even if the measuring device breaks down, the normal work of the power supply main loop is not influenced. The invention has small volume, light weight, low cost and simple production process.
Detailed Description
In order to further understand the contents, features and effects of the present invention, the following embodiments are illustrated and described in detail with reference to the accompanying drawings:
referring to fig. 1 to 6, a non-contact current detection type electric quantity measuring device for a pipeline detector is connected to a battery pack, as shown in fig. 1, and includes a voltage detection circuit, a current detection circuit, a signal conditioning circuit, an AD conversion circuit, a single chip, a display module, and a voltage conversion circuit;
wherein,
the voltage detection circuit is connected with the positive electrode and the negative electrode of the battery pack and outputs a real-time voltage sampling value of the battery pack to the signal conditioning circuit;
the current detection circuit adopts a non-contact current detection mode and outputs a current sampling value of a main circuit of the power supply of the battery pack to the signal conditioning circuit;
the signal conditioning circuit is used for performing signal conditioning on the voltage sampling value and the current sampling value and outputting the signal conditioning to the AD conversion circuit;
the AD conversion circuit outputs digital voltage detection and current detection data to the single chip microcomputer after analog-to-digital conversion;
the single chip microcomputer is connected with the display assembly; and calculating the electricity consumption and the residual electricity data of the battery pack, and sending the data to a display component for displaying.
Specifically, the current detection circuit adopting a non-contact current detection mode utilizes the Hall effect to detect current, so that the power consumption of a precision resistor connected in series with a main circuit of a battery pack power supply is avoided when the precision resistor is connected in series to detect current, and the problem that the normal work of the main circuit of the battery power supply is influenced when the precision resistor fails is avoided; even if the measuring device breaks down, the normal work of the power supply main loop is not influenced.
As shown in fig. 2, the current detection circuit includes a hall current sensor ACS711, a capacitor C1, and a resistor R3; pins 1 and 2 of the ACS711 are in short circuit, and after pins 3 and 4 are in short circuit, the short circuit is connected to a main circuit of the battery pack, so that the current of the main circuit flows in from pins 1 and 2 and flows out from pins 3 and 4; pin 12 of ACS711 is connected to supply voltage VCC, pin 5 is grounded, and pin 11 outputs current detection signal U1; a resistor R3 is connected between the pin 12 and the pin 6, and a filter capacitor C1 is connected between the pin 12 and the ground.
The ACS711 converts the current flowing through the short circuit of the pins 1 and 2 and the current flowing through the pins 3 and 4 into corresponding voltage values according to the Hall effect and outputs the voltage values from the pin 11; when the input current is zero, the voltage output by the pin 11 is not zero, and half of the supply voltage VCC is output, and the VCC in this embodiment is 5V.
As shown in fig. 3, the voltage detection circuit employs a resistance-divided voltage measurement device including a resistor R1, a resistor R2, and a sampling switch SW 1; the sampling switch SW1, the resistor R1 and the resistor R2 are sequentially connected in series with the anode and the cathode of the battery pack, and a voltage detection signal U2 is led out from two ends of the resistor R2; specifically, the internal resistance of the battery is small, the battery has good load carrying capacity, the power consumption is small when the load resistor is large, in order to reduce the power consumption, a large resistor is selected for voltage division, a chip resistor with the resistance value of 100 kilohms is selected for R1, and a chip resistor with the resistance value of 10 kilohms is selected for R2; switch SW1 controls the operation of the voltage detection circuit.
Because errors and interferences can occur in the actual detection of the voltage and the current, a signal conditioning circuit is needed to preprocess the output voltage and current signals; in order to further improve the stability of voltage and current measurement and eliminate a large number of interference signals, a low-pass filter circuit is required to be added, and meanwhile, the voltage signal output by the Hall current sensor in measurement is too small and needs to be amplified through an integrated operational amplifier, so that an analog-to-digital converter (ADC) can conveniently perform analog-to-digital conversion on the voltage signal; because the voltage signal and the current signal need to be conditioned, the signal conditioning circuit selects a double operational amplifier chip LM 258; the LM258 and the peripheral circuit jointly form a voltage signal conditioning circuit and a current signal conditioning circuit.
As shown in fig. 4, the voltage signal conditioning circuit includes an operational amplifier 1 of LM258, resistors R4, R5, and a capacitor C2;
the resistor R4 and the capacitor C2 are connected in series between the voltage detection output end and the ground to form a low-pass filter, a pin 1 of the resistor R4 is connected with the voltage detection output end, and a pin 2 of the resistor R4 is connected with a pin 3 of the equidirectional input end of the operational amplifier 1; the resistance of R4 is 1K omega, the C2 is 0.47uF, and the cut-off frequency of the low-pass filter circuit is 338.6 Hz;
on one hand, an output end pin 1 of the operational amplifier 1 is connected with an inverted input end pin 2 of the operational amplifier 1 through a resistor R5, and on the other hand, the regulated voltage detection signal is output to an AD conversion circuit.
As shown in fig. 5, the voltage signal conditioning circuit includes an operational amplifier 2 of LM258, resistors R6, R7, R8, and a capacitor C3;
because the static output voltage of the Hall current sensor is 2.5V, in order to eliminate the influence of the 2.5V static voltage, the operational amplifier 2 is connected into a differential amplification circuit;
the 2.5V voltage is connected to a reverse input end pin 5 of the operational amplifier 2 through a resistor R7, an output end pin 7 of the operational amplifier 2 is connected with a reverse input end pin 6 of the operational amplifier 1 through a resistor R8 on one hand, and on the other hand, a conditioned current detection signal is output to an AD conversion circuit; the resistance of R7 is 1K omega, and the resistance of R8 is 5K omega;
the resistor R6 and the capacitor C3 are connected in series between the voltage detection output end and the ground to form a low-pass filter, a pin 1 of the resistor R6 is connected with the current detection output end, and a pin 2 of the resistor R6 is connected with a pin 3 of the equidirectional input end of the operational amplifier 2; r6 resistance was 1K Ω and C3 was 0.47 uF.
An AD conversion circuit for AD-converting the voltage detection signal and the current detection signal outputted from the signal conditioning circuit; the AD conversion circuit can be built by adopting an integrated circuit, and can also be carried out by utilizing an ADC module in a singlechip;
specifically, the ADC embedded in the single chip microcomputer is used for digital-to-analog conversion in this embodiment, so that the accuracy requirement can be met, the circuit can be simplified, and the size of the printed circuit board can be reduced.
The singlechip of the embodiment adopts ATmega 128. ATmega128 is the highest configured single chip microcomputer in 8-bit serial single chip microcomputers developed by ATMEL company, and has the characteristics of high stability and low power consumption. ATmega128 adopts RISC structure, has rich instruction set, most instructions can be completed in one cycle, ATmega128 has a programmable Flash in 128K byte system, has 10,000 write/erase cycles, and can realize read, modify and write operations. The chip is provided with a 4KB EEPROM, a 4KBSRAM, 4 flexible timers/counters with a comparison mode, a 10-bit ADC with 8-channel single-ended or differential input, can realize in-system programming through an ISP (internet service provider), has 6 selectable power saving modes, has a compatible JTAG (joint test action group) interface, and can be used for online simulation debugging.
The single chip microcomputer ATmega128 multiplies the power supply current and the power supply voltage of the battery pack to obtain power supply power, then the power supply power is accumulated according to power supply time to calculate the power consumption of the battery pack, and the power consumption is subtracted from the full power of the battery pack to obtain the residual power of the battery pack.
The singlechip transmits the measured data of power consumption, residual electricity and the like to the display component for display;
the display component can select a three-digit nixie tube or a liquid crystal display screen according to the specific working environment and condition;
optionally, the display component is an OCMJ4X8C _3 lcd. The pins of the OCMJ4X8C _3 type liquid crystal display screen are as follows:
pin 1 — VSS logic supply ground;
pin 2-logic supply + 5V;
pin 3-NC is not connected;
pin 4 — RS (CS) high: and (3) data is low: command (chip select for serial input);
pin 5-R/W (SID) high: reading low: write (serial data);
pin 6-E (SCLK) Enable (Serial clock);
pins 7-14-DB 0-DB7 parallel data terminal;
pin 15 — PSB high: parallel/low: serial connection;
pin 16-NC is not connected;
pin 17-RST system reset active low;
pin 18-NC is not connected;
pin 19 — LEDA backlight source + 5V;
pin 20-LEDK backlight supply 0V.
The voltage conversion circuit supplies power to a voltage detection circuit, a current detection circuit, a signal conditioning circuit, an AD conversion circuit, a single chip microcomputer and a display assembly in the measuring device, and specifically comprises a DC-DC module 1 and a DC-DC module 2 as shown in FIG. 6;
the input end of the DC-DC module 1 is connected with the positive electrode and the negative electrode of the battery pack and outputs 5V to the current detection circuit, the signal conditioning circuit and the display component for power supply through direct-current voltage conversion; meanwhile, 5V is output to the DC-DC module 2; the DC-DC module 1 adopts a DC/DC chopper circuit to realize voltage reduction conversion. The DC/DC chopper circuit has larger output current, high conversion efficiency and far smaller power consumption than a voltage stabilizing chip. And considering the problem of packaging size, an integrated DC/DC conversion chip is selected. The technical index requires that the measurement voltage range is 0-32V, under the actual condition, when the battery voltage is less than a certain value, the system stops working, and the actual measurement voltage range is 10-32V. Comprehensively considering, an LTM8025 converter produced by Linear Technology company is selected, the input voltage range is 3.6-36V, the output voltage is 0.8-24V, the output current is up to 3A, the working temperature is-40-125 ℃, and the output voltage is adjusted to 5V by adjusting a resistor.
The DC-DC module 2 carries out direct-current voltage conversion on the input 5V voltage to output 3.3V voltage to supply power to the single chip microcomputer, and outputs 2.5V voltage to the signal conditioning circuit to serve as reference voltage of the differential amplification circuit;
specifically, the DC-DC module 2 realizes voltage conversion from +5V to 3.3V, +5V to 2.5V through the AMS1117 and the peripheral circuit.
The voltage conversion circuit is not limited to only output the voltage value for power supply, and can output corresponding required voltage power supply when the current detection circuit, the signal conditioning circuit, the singlechip and the display component are changed.
In summary, the power consumption measuring device for the pipeline detector provided by the embodiment of the invention realizes real-time monitoring of the current and the voltage of the battery pack, realizes real-time power consumption and residual power of the battery pack through the single chip microcomputer, and displays relevant information in real time through the display assembly, so that pipeline detection personnel can know the power consumption condition of the battery pack in real time when using the pipeline detector to perform pipeline detection, and can replace the battery pack in time when the power of the battery pack is exhausted; the invention has small volume, light weight, low cost and simple production process.
The Hall element is adopted for non-contact current detection, so that the power consumption of the precision resistor connected in series with the power supply main loop when the precision resistor is connected in series for current detection is avoided, and the problem that the normal work of the battery power supply main loop is influenced when the precision resistor fails is avoided; even if the measuring device breaks down, the normal work of the power supply main loop is not influenced.
Although the preferred embodiments of the present invention have been described above with reference to the accompanying drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and those skilled in the art can make many modifications without departing from the spirit and scope of the present invention as defined in the appended claims.