Summary of the invention
Technical matters to be solved by this invention is to provide a kind of bottom-water temperature detection method, and this bottom-water temperature detection method is easy to implement, and temperature measurement accuracy is high, good in anti-interference performance.
The technical solution of invention is as follows:
A kind of bottom-water temperature detection method, the submarine temperatures sensor array comprising multiple numeric type temperature sensor is adopted to measure the ocean temperature of different depth, adopt main frame collect temperature data, and between main frame and submarine temperatures sensor array by bus communication with simplified wiring;
Each numeric type temperature sensor is arranged in the different depth of seawater;
Main frame adopts unibus three-wire system mode to be connected with submarine temperatures sensor array; Unibus three-wire system mode refers to that main frame and submarine temperatures sensor array adopt bus communication, and this ordinate has three wires, is data line DATA, power lead VDD and ground wire GND respectively; Numeric type temperature sensor obtains working power from the power lead VDD bus; Main frame adopts external Power supply;
Main frame is given an order by bus and is started submarine temperatures sensor and start thermometric, and reads by bus the temperature data that submarine temperatures sensor gathers, and realizes the bottom-water temperature detection of different depth.
Described submarine temperatures sensor array comprises 16 numeric type temperature sensor DS18B20, and each numeric type temperature sensor DS18B20 has unique sequence number; 16 numeric type temperature sensors are arranged in the section of 0 to 100 meter of depth of water successively; In front 50 meters of sections, every 5 meters arrange a submarine temperatures sensor, and at rear 50 meters of ends and hypomere, every 10 meters arrange a submarine temperatures sensor.
Described power supply is 5V dry cell, is integrated with STM32F103RC chip in described main frame.
The port of data line DATA connects STM32F103RC chip by 5.0K Ω pull-up resistor and exports 3.3V power supply, thus makes the DS18B20 quantity of carry on unibus can be more, and supply voltage can not be caused because of number of sensors problem not enough.
Bus adopts the cable being integrated with three wires, is provided with the steel wire as reinforcement in this cable; The skin of cable is layer of silica gel, to strengthen tensile property and the water resistance of cable.Use steel wire tension and swathe one deck shielding network and guarantee Signal transmissions, outside needs the silica gel line layer by cable cover last layer insulativity and good waterproof performance.
The data acquisition modes of main frame has two kinds:
(1) temperature data of single submarine temperatures sensor is gathered;
When main frame needs to operate some in numerous online submarine temperatures sensor, first coupling ROM order (55H) to be sent to 48 bit sequence number based on DS18B20 to this temperature sensor, carrying out afterwards for this DS18B20 operates, and comprises and starts DS18B20 from this DS18B20 reading temperature data;
(2) temperature data of all submarine temperatures sensors is gathered.
In the temp measuring system of DS18B20 composition, main frame send skip ROM order after send unified temperature transition again and start code 44H and just can realize the unified of all DS18B20 and change, again after 1s, read the temperature data that each DS18B20 exports one by one, thus obtain the temperature data of all DS18B20; Complete the measurement of different depth ocean temperature.
Main frame is connected with display, and display is used for display system current state, and the temperature data that display in real time gathers.
The present invention uses external connection battery to power, and uses low-power consumption micro-processing controls chip STM32 to carry digital temperature sensor DS18B20.The maximum required electric current of sensor only has 1mA.100 meters of long range propagation, in order to guarantee transmission, data skew is little must use digital temperature sensor.
STM32 minimum system is made up of STM32F103RC chip, JTAG power supply, pilot lamp, reset circuit and 5MHz crystal oscillator.
The present invention, based on STM32F103 series microcontroller chip, builds STM32 minimum system, the digital LCDs of collocation TFT3.0.External STM32GPIO mouth PA8 is DQ data receiver mouth, and by 5.0V strong pull-up 5.0K Ω resistance, guarantees unibus will cause electric current on data line not reach required minimum value 1mA because of DS18B20 carry count issue.Because need 100 meters of long distance signal transmission, the impact of complex environment under ocean condition in addition, so that select for sensor is numeric type temperature sensor DS18B20.DS18B20 temperature-measuring range is wide :-55 DEG C ~+125 DEG C, operating voltage is low: 3.0 ~ 5.5V/DC, and structure is simply in use without any need for peripheral cell, and the little measurement result of digital data transmission distortion error is with 9 ~ 12 bit digital quantity mode serial transfers.
Cable of the present invention uses unibus three-wire system mode, is respectively DATA, VDD, GND, makes multiple DS18B20 can realize digital data transmission by a bus.DS18B20 can take parasite power power supply mode and external power source.DS18B20 has negative pressure characteristic, and when electric power polarity connects inverse time, thermometer can not burn because of heating, but cisco unity malfunction.Under parasite power power supply mode, DS18B20 draws energy from single-wire signal line: to be between high period energy storage in internal capacitance at signal wire DQ, the electric energy work consumed between low period on electric capacity is in, until high level arrives again to parasite power (electric capacity) charging at signal wire.But this kind of method is when carry quantity is too much, this problem not enough of supply current on line can be made to become sharp-pointed.Therefore, the present invention uses outside 5.0V to power directly to unibus power input VDD, GND pin ground connection.Because impacts such as seabed hydraulic pressure, pH values, so require that cable must can sustain 1.5MPa pressure, good waterproof performance, corrosion resistivity is strong.Therefore use silica gel signal wire to be wrapped in outermost layer.Inner then need interpolation steel wire to guarantee the resistance to tension of cable, and swathe one deck shielding network and guarantee Signal transmissions.Reserve data at cable least significant end, power supply, ground wire connect for STM32 interface.In order to realize the requirement of low-power consumption, native system uses external+5.0V dry cell power supply.And by AMS1117 efficient linear voltage stabilizer, for exchange type power 5V to 3.3V linear voltage regulator.Thus, just both can be powered to STM32 by external power source+5.0V, power supply can be provided for DS18B20 temperature measuring cable again.Powered battery is fine ensure that low power consumption characteristic and the small size of system.
There is the ROM cell of 64 inside of DS18B20, and the temporary storage unit (i.e. temporary register) of 9 bytes.64 ROM contain, the sequence number (unique name) that DS18B20 is unique.Unique sequence numbers just because of its uniqueness makes single bus data transmit becomes possibility.Main frame must access DS18B20 one by one and with reading ROM (33H) order, this sequence number of 1820 read and logged in before entering running program.
When main frame needs to operate numerous online DS18B20 some, first coupling ROM order (55H) will be sent, and then main frame provides 64 bit sequences (comprising 48 bit sequence number of this DS18B20), and operation is afterwards for this DS18B20;
And what is called skips operation after namely ROM order represents to all DS18B20; First have in block diagram and skip ROM and start after all DS18B20 carry out temperature inversion to be read back seriatim again the temperature data of each DS18B20 by coupling ROM, in the temp measuring system of DS18B20 composition main frame send skip ROM order after send again unified temperature transition start code 44H just can realize all DS18B20 unify change, again after 1s, just can go with little time to read one by one.
If [instruction successfully makes DS18B20 complete temperature survey, and data are stored in the storer (i.e. temporary register) of DS18B20.Measurement result will be placed in DS18B20 internal memory, and can be read out by order.】
Several sequential of DS18B20 are as follows:
1, reset timing: single-chip microcomputer drags down bus 480us ~ 950us, then discharges bus (drawing high level).At this moment DS18B20 meeting degrade signal, about 60 ~ 240us represents response.DS18B20 draws between low level 60 ~ 240us, and single-chip microcomputer reads the level of bus, if low level, so represents and resets successfully.After DS18B20 drags down level 60 ~ 240us, bus can be discharged.
2, logical zero is write: single-chip microcomputer drags down the about 10 ~ 15us of level.Single-chip microcomputer continues the time dragging down the about 20 ~ 45us of level.Release bus.
3, logical one is write: single-chip microcomputer drags down the about 10 ~ 15us of level.The time of the about 20 ~ 45us of level drawn high by single-chip microcomputer.Release bus.
4, logical zero is read: single-chip microcomputer drags down the about 1us of level when reading.Single-chip microcomputer release bus, then reads bus level.At this time DS18B20 can drag down level.After reading level, postpone about 40 ~ 45 microseconds.
5, logical one is read: single-chip microcomputer drags down the about 1us of level when reading.Single-chip microcomputer release bus, then reads bus level.At this time DS18B20 can draw high level.After reading level, postpone about 40 ~ 45 microseconds.
DS18B20 temporary register distribution table
The temperature-measurement principle of DS18B20: determine a door cycle with the oscillator of a high-temperature coefficient, internal counter carries out counting to obtain temperature value to the pulse of the oscillator of a low-temperature coefficient within this cycle.Counter is preset to the value corresponding to-55 DEG C.If counter arrives 0 before door end cycle, then the value of temperature register (being preset to-55 DEG C equally) increases, and shows that measured temperature is greater than-55 DEG C.
Meanwhile, counter is reset to a value, and this value is determined by ramp type accumulator circuit, and ramp type accumulator circuit is used for compensating the parabolic characteristic of temperature-sensitive oscillator.Then counter starts again counting until 0, if the door cycle is not over yet, will repeat this process.Ramp type totalizer is used for compensating the non-linear of temperature-sensitive oscillator, to obtaining higher resolving power when thermometric.This be by change counter to temperature often increase once required counting value realize.Therefore, want the resolving power needed for obtaining, the value of counter at a given temperature and every count value once must be known simultaneously.
Beneficial effect:
Bottom-water temperature detection method of the present invention, have low-power consumption, underwater portion anti-pressure ability strong (1.5MPa), Signal transmissions strong interference immunity, can the advantage such as strong, the good waterproof performance of long range propagation (100M), cable corrosion resistivity.This detection system is low in energy consumption, and volume is little, with low cost, and measuring accuracy is higher, can work under complicated rugged environment.Temperature-measuring range is wide :-55 DEG C to+125 DEG C.DSDS18B20 is sent or the information of reception by a single bus interface, therefore between central microprocessor and DSDS18B20, only needs a bus.Can obtain from bus with the power supply of temperature transition for reading and writing.System is by three-wire system bus: data line, power and ground just can complete measurement task.Thus structure is simple, easy to implement,
Embodiment
Below with reference to the drawings and specific embodiments, the present invention is described in further details:
Embodiment 1:
Fig. 1 describes the structure composed of whole system.Mainly comprise minimum system with digital LCDs of DS18B20 temperature sensing cable, STM32 and external+5V battery supply.
Fig. 2 describes at the particular location of 0 to 100 meter of deep-sea floor, 16 DS18B20 carries on unibus.
A kind of bottom-water temperature detection method, the submarine temperatures sensor array comprising multiple numeric type temperature sensor is adopted to measure the ocean temperature of different depth, adopt main frame collect temperature data, and between main frame and submarine temperatures sensor array by bus communication with simplified wiring;
Each numeric type temperature sensor is arranged in the different depth of seawater;
Main frame adopts unibus three-wire system mode to be connected with submarine temperatures sensor array; Unibus three-wire system mode refers to that main frame and submarine temperatures sensor array adopt bus communication, and this ordinate has three wires, is data line DATA, power lead VDD and ground wire GND respectively; Numeric type temperature sensor obtains working power from the power lead VDD bus; Main frame adopts external Power supply;
Main frame is given an order by bus and is started submarine temperatures sensor and start thermometric, and reads by bus the temperature data that submarine temperatures sensor gathers, and realizes the bottom-water temperature detection of different depth.
Described submarine temperatures sensor array comprises 16 numeric type temperature sensor DS18B20, and each numeric type temperature sensor DS18B20 has unique sequence number; 16 numeric type temperature sensors are arranged in the section of 0 to 100 meter of depth of water successively; In front 50 meters of sections, every 5 meters arrange a submarine temperatures sensor, and at rear 50 meters of ends and hypomere, every 10 meters arrange a submarine temperatures sensor.
Described power supply is 5V dry cell, is integrated with STM32F103RC chip in described main frame.
The port of data line DATA connects STM32F103RC chip by 5.0K Ω pull-up resistor and exports 3.3V power supply, thus makes the DS18B20 quantity of carry on unibus can be more, and supply voltage can not be caused because of number of sensors problem not enough.
Bus adopts the cable being integrated with three wires, is provided with the steel wire as reinforcement in this cable; The skin of cable is layer of silica gel, to strengthen tensile property and the water resistance of cable.Use steel wire tension and swathe one deck shielding network and guarantee Signal transmissions, outside needs the silica gel line layer by cable cover last layer insulativity and good waterproof performance.
The data acquisition modes of main frame has two kinds:
(1) temperature data of single submarine temperatures sensor is gathered;
When main frame needs to operate some in numerous online submarine temperatures sensor, first coupling ROM order (55H) to be sent to 48 bit sequence number based on DS18B20 to this temperature sensor, carrying out afterwards for this DS18B20 operates, and comprises and starts DS18B20 from this DS18B20 reading temperature data;
(2) temperature data of all submarine temperatures sensors is gathered.
In the temp measuring system of DS18B20 composition, main frame send skip ROM order after send unified temperature transition again and start code 44H and just can realize the unified of all DS18B20 and change, again after 1s, read the temperature data that each DS18B20 exports one by one, thus obtain the temperature data of all DS18B20; Complete the measurement of different depth ocean temperature.
Main frame is connected with display, and display is used for display system current state, and the temperature data that display in real time gathers.
During use, first external+5.0V supplying cell is welded with external power supply power-feed section VCC, the GND on STM32 system board.Then the DATA data line of unibus end, VDD power lead, GND ground wire are welded with the PA8 strong pull-up GPIO mouth on STM32 system board, VDD5.0V mouth, GND mouth respectively, guarantee wire and STM32 system board firm welding.Then skin oil pipe is used by soldering opening to package insulation.Use a little capstan winch by folding and unfolding time good easy to use for detection cable dish.