A kind of TDS water quality testing meters
Technical field
It the utility model is related to field of environmental protection detection, more particularly to a kind of SCM Based TDS water quality testing meters.
Background technology
Water is Source of life, and the mankind be unable to do without water in production and living.With the development of social economy, the progress of science
With the raising of living standards of the people, environmental pollution is increasingly severe, wherein, water environment pollution is the most serious.In water resource increasingly
Today of shortage, quality problem, which receives, to be increasingly focused on, therefore carrying out test to water quality can make us preferably protect water to provide
Source, ensure qualified water quality, this has very important significance to normal production, guarantee product quality and health of people.
TDS is English total dissolved solids abbreviation, and Chinese is construed to total dissolved solid, also known as always contained
Salt amount, the total amount for containing various dissolubility mineral saltses in water is defined as, it includes the total amount of inorganic salts and organic matter, and measurement is single
Position is mg/litre (1mg/L=1ppm), and it shows in 1 liter of water dissolved with how many milligrams of total dissolved solids, in other words in 1 liter of water
Total ion concentration.Popular says, TDS values represent dissolved matter impurity content in water, and TDS values are bigger, and dissolved matter impurity is got in water
It is more, illustrate that the impurity content of electrically conductive material in water is big.For running water, TDS values are more high more show that water is impure and (do not consider
The premise of Organic Pollution).By detecting total dissolved solid (TDS), the total salinity of water can be analyzed.TDS water-quality tests
Instrument is exactly a kind of to reflect the instrument of water-mineralizing degree by measuring the electrical conductivity of water.The TDS water quality occurred in the market
Tester generally use complicated collecting unit, signal processing unit and control unit realize, bulky, cost is high,
It is unfavorable for the popularization and application of water quality testing meter.
Chinese patent literature CN 204270486U disclose a kind of water electric conductivity monitoring based on wireless sensor network
Node apparatus, including power supply, conductivity sensor probe, key control unit for power supply, and and key control unit
The data transmission unit being bi-directionally connected, the conductivity sensor probe are connected by signal condition unit and data acquisition unit
Connect, the key control unit uses STM32F407 chips, and the data transmission unit uses CC2530 chips.Water quality electricity
Conductance monitoring node device hardware circuit is simple, integrated level is high, cost is low, and the TDS of water quality is tested by the conductivity data of water
Value;But electrical conductivity is easily affected by temperature, and TDS values should be consistent to identical water quality at different temperature, work as temperature
When changing, the TDS values of the device to test have certain distortion.
Utility model content
The purpose of this utility model is overcome the deficiencies in the prior art, there is provided a kind of TDS water quality testing meters, with
STC89C52 chips are core, realize that conductivity measurement, temperature-compensating, the measurement of TDS values, button latch knot using singlechip technology
The functions such as fruit, display data;Conductivity signal is gathered by the probe in electrical conductivity measurement circuit, because temperature has to electrical conductivity
Very big influence, so temperature also influences the measurement of TDS values, in order to reduce influence of the temperature to final TDS measured values, introduce
Temperature measuring circuit;In temperature measuring circuit, using digital temperature sensor DS18B20 collecting temperature signal, compensate due to
Conductivity value measurement error caused by temperature change, finally by the result after compensation by the way that TDS values are calculated, and shown
On charactron, the accuracy of TDS values measurement is improved;Single-chip microcomputer passes through MAX232 level shifting circuits and PC simultaneously
RS232 interface connects, and is easy to the storage and analysis of data.
To achieve the above object, the technical solution adopted in the utility model is as follows:
A kind of TDS water quality testing meters, including the single-chip microcomputer being made up of single-chip microcomputer U1, clock circuit 2, reset circuit 3 are minimum
System, and be connected with single-chip microcomputer U1 electrical conductivity measurement circuit 4, display circuit 5, in addition to temperature measuring circuit 6, MAX232
Level shifting circuit 7 and PC, the temperature measuring circuit 6 are directly connected with single-chip microcomputer U1, and single-chip microcomputer U1 passes through MAX232
Level shifting circuit 7 is connected with PC, and the model STC89C52 chips of the single-chip microcomputer U1.
Specifically, the electrical conductivity measurement circuit 4 includes conductivity probe DBT1,555 timer U2, pliotron
Q2, the base stage of the pliotron Q2 are connected with 555 timer U2 the 3rd pin, pliotron Q2 base collector
It is connected with 555 timer U2 the 4th pin, pliotron Q2 emitter stage while the 7th pin, electricity with 555 timer U2
Conductance probe DBT1 pole connection, conductivity probe DBT1 another pole while the 2nd pin and the 6th with 555 timer U2
Pin is connected, and 555 timer U2 the 5th pin, the 6th pin are grounded by capacitor C4, capacitor C5 respectively, and the 1st pin is straight
Ground connection, 555 timer U2 the 3rd pin are connected with the 15th pin of STC89C52 chips, 555 timer U2 the 8th pin
Meet power supply VCC.
Further, the temperature measuring circuit 6 includes temperature sensor U3 and resistor R3, the temperature sensor U3
The 1st pin ground connection, the 3rd pin meets power supply VCC, and the 2nd pin is connected with the 7th pin of STC89C52 chips, resistance R3 connections
Between temperature sensor U3 the 2nd pin and the 3rd pin.
Yet further, the MAX232 level shifting circuits 7 include MAX232 chips U4 and are made up of some electric capacity
Peripheral circuit, the 11st pin of the MAX232 chips U4, the 12nd pin the 11st pin with STC89C52 chips, respectively
10 pins connect, and MAX232 chips U4 the 11st pin connects electricity by the light emitting diode D1 and resistance R24 that are sequentially connected simultaneously
Source VCC;The 6th pin with the RS232 interface of PC, the 7th pin connect MAX232 chips U4 the 13rd pin, the 14th pin respectively
Connect;Electric capacity C7, electricity are connected between MAX232 chips U4 the 1st pin and the 3rd pin, between the 4th pin and the 5th pin
Hold C8, MAX232 chips U4 the 6th pin, the 16th pin are grounded by electric capacity C9, electric capacity C10 respectively, and the 2nd pin passes through electric capacity
C6 meets power supply VCC, and the 16th pin connects power supply VCC simultaneously.
Further, the display circuit 5 includes charactron LED and pull-up exclusion RP1, charactron LED section selected control
39-32 pin of the A-G pins and DP pins at end processed respectively with STC89C52 chips is connected, charactron LED position selected control system
21-24 pin of the 1-4 pins respectively with STC89C52 chips is held to be connected, pull-up exclusion RP1 and charactron LED section selected control system
End connection.
Preferably, the charactron LED is four common anode charactrons.
Further, the TDS water quality testing meters also include the key circuit 8 being connected with STC89C52 chips, described
Key circuit 8 includes key switch K2 and resistance R4, key switch K2 one end is connected with the 8th pin of STC89C52 chips,
The other end is grounded, and key switch K2 and STC89C52 chips connection end meet power supply VCC by resistance R4.
Preferably, the model FZT651 of the conductivity probe DBT1.
Preferably, the model DS18B20 of the temperature sensor U3.
Compared with prior art, the beneficial effects of the utility model are:
(1) the utility model realizes that conductivity measurement, temperature are mended using STC89C52 chips as core using singlechip technology
Repay, the measurement of TDS values, the function such as button latch result, display data;Electrical conductivity measurement circuit measures the electrical conductivity of detected solution,
And by the temperature of temperature sensor measurement detected solution, STC89C52 chips enter trip temperature benefit to the electrical conductivity and temperature of measurement
Repay, TDS values are calculated by correlation formula, are shown on charactron, improve the accuracy of TDS values measurement;The letter of whole system structure
List, response quickly, automaticity are high, practicality is good and cost is cheap, are easy to widely popularize in life, production.
(2) electrical conductivity measurement circuit is made up of 555 timers, conductivity probe and its peripheral circuit in the utility model,
An electrode is formd after conductivity probe DBT1 two probes insertion detected solution, forms whole electrical conductivity measurement circuit
The multi-resonant oscillating circuit of closing, and frequency f relevant with detected solution electrical conductivity as caused by the multi-resonant oscillating circuit is determined by 555
When device the output of the 3rd pin, inputted to the 15th pin of STC89C52 chips, the equivalent resistance of electrode and detected solution is as one
The impedor of individual multi-resonant oscillating circuit, the change of detected solution electrical conductivity is changed into the output frequency of multi-resonant oscillating circuit,
This method cost is low, easily realizes.
(3) temperature measuring circuit uses digital temperature sensor DS18B20 collecting temperature signal in the utility model, numeral
Temperature sensor DS18B20 have small volume, precision are high, it is wide to be applicable voltage, can networking the advantages of, there is good measurement to imitate
Fruit, and there is water-proof function, it is adapted to measure solution temperature;When measuring the solution of arbitrary temp, can enter automatically
The conductivity value of solution when trip temperature compensates and shows compensation to 25 DEG C of fiducial temperature.Digital temperature sensor
The temperature data of DS18B20 collections is converted into corresponding data signal, then sends data signal to STC89C52 chips, leads to
Cross STC89C52 chips and make corresponding data processing and obtain temperature value, then trip temperature is entered by the programs of STC89C52 chips and mended
Repay.
(4) display circuit uses 4 common-anode charactron LED in the utility model, and using pull-up exclusion PR1 with
Charactron LED section selects control terminal to connect, and reduces input impedance, there is provided drain charge path, so as to improve the input of STC89C52 chips
The noise margin of signal, strengthen antijamming capability.
(5) STC89C52 chips of the present utility model are connected by the RS232 interface of MAX232 level shifting circuits and PC
Connect, realize man-machine interaction, be easy to the storage and processing of data.
Brief description of the drawings
Fig. 1 is overall system diagram of the present utility model.
Fig. 2 is the circuit diagram of minimum SCM system in the utility model.
Fig. 3 is the circuit diagram of electrical conductivity measurement circuit in the utility model.
Fig. 4 is the circuit diagram of temperature measuring circuit in the utility model.
Fig. 5 is the circuit diagram that MAX232 level shifting circuits are connected with single-chip microcomputer in the utility model.
Fig. 6 is integrated circuit figure of the present utility model.
Each module is entitled in accompanying drawing:
U1- single-chip microcomputers, U2-555 timers, U3- temperature sensors, U4-MAX232 chips, 2- clock circuits, 3- reset
Circuit, 4- electrical conductivity measurement circuits, 5- display circuits, 6- temperature measuring circuits, 7-MAX232 level shifting circuits, 8- buttons electricity
Road.
Embodiment
The utility model will be further described below in conjunction with the accompanying drawings.
As shown in figure 1, a kind of TDS water quality testing meters, including single-chip minimum system, electrical conductivity measurement circuit 4, display electricity
Road 5, temperature measuring circuit 6, MAX232 level shifting circuits 7.
Single-chip minimum system is made up of STC89C52 chips, clock circuit 2, reset circuit 3.Due to STC89C52 chips
Inside carries oscillating circuit, so 2 need of clock circuit include a crystal oscillator X1 and electric capacity C1, electric capacity C2, and according to Fig. 2
Mode connects, and electric capacity C1, electric capacity C2 capacitance, between 50pF, select 22pF electricity typically in 15pF in the present embodiment
Hold.The main task of clock circuit 2 is to provide a stable clock signal to the normal work of STC89C52 chips,
STC89C52 chips one by one execute instruction under the rhythm of this clock signal.In the present embodiment clock circuit 2 using
Internal clocking mode, from the anti-phase amplification of high-gain in 12M crystal oscillator X1 and two 22pF electric capacity and STC89C52 chips
Device forms a self-excited oscillator.
In order to ensure the reliable and stable work of the energy of the circuit in SCM system, reset circuit is an indispensable part.
STC89C52 chips reset for high level, as shown in Fig. 2 connecting an electric capacity on the reset pin RST of STC89C52 chips
C3 to power supply VCC, resistance R2 a to GND is reconnected, a RC charging and discharging circuit is consequently formed, can so ensure
The high level that STC89C52 chips have enough time when upper electric on RST pin is resetted, and is then being revert to low level and is being entered just
Normal working condition.Meanwhile the reset pin RST of STC89C52 chips also connects power supply by a SR K1 with resistance R1
VCC, when SCM system in operation, be interfered when there is program fleet, press after SR K1 in single-chip microcomputer
The program in portion performs from the beginning automatically.When working state of system is normal, after oscillator stabilization, if there is one on RST pins
High level and kept for 2 more than the machine cycle, then CPU cans response and by system reset.The reset circuit 3 of the present embodiment
Both hand-reset can be realized, automatic electrification reset can be realized again.
TDS values show dissolved with how many milligrams of total dissolved solids in 1 liter of water, the total ion concentration contained in other words in 1 liter of water.
TDS values in the utility model are drawn by measuring the Conductivity Calculation of detected solution.Electrical conductivity is to represent electric conductivity of matter
The physical index of energy.The electric conductivity of the bigger material of electrical conductivity is stronger, and corresponding resistance is with regard to smaller, otherwise substance conductance performance is got over
Small, resistance is bigger, and electrical conductivity is also smaller.
Free charge motion under electric field action of the conductive capability of conductor with conductor in itself is relevant, so its conductive energy
Power is relevant with the property of conductor and its length and cross-sectional area.Its relational expression is:
In formula (2.1), R is resistance, and L is conductor effective length, and S is that the effective cross section of conductor is accumulated, and ρ is resistivity.And
Conductance
OrderThen our K are referred to as electrical conductivity, are the inverses of resistivity.OrderSo
Electrical conductivity K unit is Siemens per cm, symbol Scm-1Electrical conductivity refers to that conductor length is 1cm, transversal
Area is 1cm2Possessed electric conductivity value, equivalent to 1cm for electrolytic conductor3Solution again at a distance of 1cm two electrodes between institute
The conductance having[8].Measure solution when, due to the determination of water quality tester so that the effective length L of measuring instrument probe and
Effective cross section product A is constant, and the volume can of water is fixed between probe, and electrical conductivity K is can obtain by formula (2.4).
K=GJ (2.4)
Due to significantly dependency relation between TDS and electrical conductivity be present, under the relation between dissolved solid and conductance can use
The empirical equation estimation in face:
TDS=(0.55~0.70) K (2.5)
In formula (2.5):TDS is dissolved solid (mg/L) in water;The electrical conductivity (S/m) of water when K is 25 DEG C.Above formula is simply thick
The quantitative relation reflected between total dissolved solid and electrical conductivity slightly, coefficient 0.55~0.70 is with the different and different of water quality.
As shown in figure 3, electrical conductivity measurement circuit 4 includes conductivity probe DBT1,555 timer U2, pliotron Q2,
Wherein, conductivity probe DBT1 model selects FZT651;Pliotron Q2 base stage and 555 timer U2 the 3rd pin
Connection, pliotron Q2 base collector are connected with 555 timer U2 the 4th pin, pliotron Q2 emitter stage
It is connected simultaneously with 555 timer U2 the 7th pin, a conductivity probe DBT1 pole, conductivity probe DBT1's is another extremely same
When be connected with 555 timer U2 the 2nd pin and the 6th pin, 555 timer U2 the 5th pin, the 6th pin pass through electricity respectively
Container C4, capacitor C5 are grounded, and the 1st pin is directly grounded, 555 timer U2 the 3rd pin and the 15th of STC89C52 chips the
Pin connects, and 555 timer U2 the 8th pin meets power supply VCC.When conductivity probe DBT1 two probes insert detected solution
After form an electrode, whole electrical conductivity measurement circuit 4 is formed the multi-resonant oscillating circuit of closing, and by multi-harmonic-oscillations electricity
The frequency f relevant with detected solution electrical conductivity caused by road is exported by the 3rd pin of 555 timers, to STC89C52 chips
Impedor of the equivalent resistance of the input of 15th pin, electrode and detected solution as a multi-resonant oscillating circuit, will be tested molten
The change of liquid electrical conductivity changes into the output frequency of multi-resonant oscillating circuit.
The concrete operating principle of electrical conductivity measurement circuit 4 is:Voltage when circuit just brings into operation on electric capacity C5 is 0, real
Border circuit is in SM set mode, and the pin 3 of 555 timers exports high level.Power supply VCC is charged by electrode to electric capacity C5, work(
Rate triode Q2 is turned on, and charging process is:Power supply VCC → pliotron Q2 → electrode → electric capacity C5.When charging to Vc >=2/
During 3VCC, the high limit comparator reversion of the pin inner portions of 555 timer the 6th, the 3rd pin output low level, Q2 sections of pliotron
Only, the open collector discharge tube conducting of the 7th pin inner portions, discharge process are:The 7th of the timer of electric capacity C5 → electrode → 555
Pin.When being discharged to Vc≤1/3VCC, the lower bound comparator of the pin inner portions of 555 timer the 2nd inverts, and the 3rd pin is defeated again
Go out high level, electric capacity C5 charges again.Such above procedure moves in circles to form vibration output frequency f.Drawn through circuit theory
Below equation:
In formula (2.6):G (t)=1/Rx, G (t) are the electric conductivity value of electrode actual measurement;K0=0.772/C5, K0For conductance-frequency
Conversion coefficient.Output frequency f is directly proportional to conductance G (t) it can be seen from above-mentioned formula, that is, vibrates output frequency f and electrical conductivity
It is linear.TDS can be derived from above-mentioned formula
In formula (2.7), the spacing L between two probes, probe immerses solution deep and the product S for cross-section lengths of popping one's head in,
Frequency f, electric capacity C5 capacitance are known parameters, you can calculate TDS values.
Because electrical conductivity of solution measurement is greatly influenced by temperature, the degree of ionization of electrolyte, solubility, ion motion speed etc.
All directly it is influenced by temperature, when solution temperature raises, ion heat operation is accelerated, conductive capability increase, electrical conductivity of solution increase.
Vice versa.And the utility model is to calculate solution TDS values according to detected solution electrical conductivity, so temperature directly affects solution
The precision of conductivity measurement, that is, directly affect the measurement accuracy of TDS values.When the temperature of detected solution is not fiducial temperature,
At i.e. 25 DEG C, temperature-compensating must be just carried out, that is to say, that need measurement result compensation to the numerical value under fiducial temperature, so as to
Exclude influence of the temperature to measured value.As shown in figure 4, temperature measuring circuit 6 of the present utility model uses DS18B20 digital temperatures
Sensor carries out temperature data acquisition, and DS18B20 digital temperature sensors support " single bus " interface, the scope of measurement temperature
For -55 DEG C~+125 DEG C, at -10~+85 DEG C, precision is ± 0.5 DEG C;Adapt to voltage range it is wide, voltage range be 3.0~
5.5V, by the way of external power source power supply.DS18B20 digital temperature sensors have three pins, and the 3rd pin VCC is external
Power supply input, the 2nd pin DQ is data signal input/output terminal and STC89C52 cores to the 1st pin GND for power supply
7th pin of piece connects, and in the circuit, an indirect pull-up resistor R3 for the 3rd pin and the 1st pin, its resistance is about 4.7K,
Circuit is set to be in high level when not working;The temperature data that DS18B20 is gathered is converted into corresponding numeral letter by sensor
Number, then send data signal to STC89C52 chips, temperature value obtained by the corresponding data processing of STC89C52 chips,
Temperature-compensating is carried out by the program of STC89C52 chips again.
For the ease of realizing man-machine interaction, STC89C52 chips can be by MAX232 level shifting circuits 7 directly and PC
RS232 interface connection, as shown in figure 5, MAX232 level shifting circuits 7 include MAX232 chips U4 and by some capacitance groups
Into peripheral circuit, the 11st pin of the MAX232 chips U4, the 12nd pin respectively the 11st pin with STC89C52 chips,
10th pin is connected, and MAX232 chips U4 the 11st pin is connect by the light emitting diode D1 and resistance R24 that are sequentially connected simultaneously
Power supply VCC;MAX232 chips U4 the 13rd pin, the 14th pin the 6th pin, the 7th pin with the RS232 interface of PC respectively
Connection;Be connected between MAX232 chips U4 the 1st pin and the 3rd pin, between the 4th pin and the 5th pin electric capacity C7,
Electric capacity C8, MAX232 chip U4 the 6th pin, the 16th pin is grounded by electric capacity C9, electric capacity C10 respectively, and the 2nd pin passes through electricity
Hold C6 and meet power supply VCC, and the 16th pin connects power supply VCC simultaneously.
As shown in fig. 6, display circuit 5 includes 4 common anode charactron LED and pull-up exclusion RP1,4 common anode charactron LED
Outside low level can just light corresponding internal body diodes, and 8 sections of charactron select control terminal pin A-G and DP to be connected to
On the 39-32 pins of STC89C52 chip P0 mouths, 4 position control terminal pin 1-4 are connected on STC89C52 chips P2.0- respectively
On the 21-24 pins of P2.3 mouths, it is selected corresponding charactron by P2.0-P2.3 mouths, then make correspondent section by P0 mouths
Digital sum pipe display numeral, the numeral that charactron LED is shown is TDS values;Meanwhile pull up exclusion RP1 pin successively with number
Pipe LED section selects control terminal pin to connect, and reduces input impedance, there is provided drain charge path, so as to improve the input of STC89C52 chips
The noise margin of signal, strengthen antijamming capability.
The utility model is additionally provided with key circuit 8, and the key circuit 8 includes key switch K2 and resistance R4, button
Switch K2 one end is connected with the 8th pin of STC89C52 chips, other end ground connection, and key switch K2 and STC89C52 chips
Connection end power supply VCC is connect by resistance R4;In circuit, when the 8th pin of STC89C52 chips is low level, circuit is led
Logical, key switch K2 is pressed for the first time, and key switch K2 buttons, program empties measured data.
The utility model selects control core of the STC89C52 chips as system, passes through the electricity in electrical conductivity measurement circuit
Conductance.Probe realizes the collection of conductivity signal, and carries out temperature survey using temperature sensor, is subtracted by temperature compensation
Influence of the small temperature to conductivity measurements, so as to the measurement accuracy for TDS values of increasing water quality, finally measured value is included in number
Guan Shang.
Above-described embodiment is only preferred embodiment of the present utility model, not to the limitation of scope of protection of the utility model,
In every case design principle of the present utility model, and the change for carrying out non-creativeness work on this basis and making are used, all should
Belong within the scope of protection of the utility model.