1_wire is different from most standard serial data communication methods such as SPI, UC and Micorwire. It uses a signal line to transmit both clock and data, and the data transmission is bidirectional. A single host system on the bus can control one or more slave devices. When only one slave is on the bus, the system can operate as a single-node system, and when multiple slaves are on the bus, the system operates as a multi-node system.
First, the small-scale weather station system host travel management Small weather station system uses DS2423, DS2450, DS18B20 OALLAS semiconductor company three 1-wire device to measure the wind speed, wind direction and ambient temperature in the environment. The basic working principle of a small weather station is shown in Figure 1.

Figure 1 Environmental monitoring hardware system
The temperature sensor OS18B20 measures the ambient temperature. After the ambient temperature is measured, it is used by a l/O port of the processor to read out data on a wire bus timing. Counter 052423 is used to measure the speed of rotation of the wind speed disk. The wind speed dial is connected to a rotor with a magnet, records the speed of rotation of the outer wind speed dial and passes it to the counter. Whenever the wind speed turns to the position of the reed switch used to capture the on-off signal, both of these dry tubes are closed and the dry tube is disconnected when the point is turned. At this point, a positive phase pulse can be generated, so that the counter is automatically incremented. The counter records the number of times that the dry approval channel is turned off per unit time. The size of the wind speed can then be calculated by calculation.
052450 is used to measure the ambient wind direction. When the wind blows the wind vane, the magnets installed on the rotor will close one or two dry tubes, while the other reed tubes will be disconnected. When one or two dry tubes are closed, the resistance is divided. The 052450 voltage applied to each pin will change. There are two cases in which the dry pipe is closed at the same time. It can be measured that the magnet is in the middle of the two dry pipes, so the eight dry pipes can measure six kinds of wind direction.
This system uses a l/O port of the microcontroller MSP430F133 to simulate the 1_wire timing and communicate directly with the 1_wire bus. It uses the continent's power supply voltage, has the advantages of low voltage, low power consumption, low cost, etc., and then the microcontroller through the serial port and the upper position Machine communication.
Second, small weather station software system
1. The overall structure of the software system After the completion of the hardware system, there must be a reasonable software system support, software structure as shown below:

Figure 2 Environmental detection software system structure
2. 1_wire timing The 1_wire device has its own special communication timing. Reading, writing data and power supply are all done through one data line. There are two types of fast and slow timing. The system is mainly slow. Its read and write timing is shown in Figure 2 (unit, s).

Loop 2 1 -wire timing diagram
The microcontroller uses the SM crystal to generate the SM's main system clock. So use the loop statement directly to generate this timing.
3. Twisting velvet method Each piece of lee 叻咐 state clears the unique registration code, which is stored in read-only memory (ROM). In the 1_wire network, the registration code is used by the 1_wire master to address the slave devices one by one. If, the ROM code of the device in the 1_wire network is unknown. This code can be found by a search algorithm to determine the identity of the device. After the search command is issued via broadcast, the actual search process starts. After the bus is reset, the host issues a command. All 1_wire devices respond to the host at the same time. All devices on the bus simultaneously send the first bit of the ROM code. This corresponds to all the data bits sent by the ANO. The complement of this bit, the data bit read from twice can make several judgments to the first bit of the ROM code; Then the host sends a specified bit back to the device on the bus. If the value of this bit of the device ROM code Matching this data bit will continue the search process. If there is no match, wait state will be entered until the next reset signal arrives. The search for the remaining 63 bits of ROM code is also done in this way. According to this search algorithm, all devices except one device will enter the wait state, and the ROM code of the device can be obtained.
The search algorithm uses a binary tree structure. The search process is performed along each sub-node until the ROM code of the device is found; subsequent search operations are performed along other paths on the pink node, in the same way until all device codes on the bus are found.
4. Write bare for a single public object. After the search is completed, write the select character 0x55 to select the device to be excluded. Take the temperature sensor as an example to implement this algorithm. Write 05,820 to the old, 1_wire bus. At this time, there are only 05,820 jobs. The rest all stop working. Then the 05,820 operation is performed. Write data 0x44 for data conversion, maintain a high level of 25, and then reset, use the command oxBE to read the temporary register data in 051820, read the 0th and the 3rd bytes from this register, and then according to its binary number and temperature The correspondence. Convert it.
Third, the prospect and the exhibition girl line network as a new type of measurement and control network has a broad application prospects. In addition to measuring the wind speed and temperature, the micro-meteorological station can also be used specifically for measurements of humidity, UV intensity, etc., during the 1_wire period to make the content of the t-measurement of the weather station more comprehensive and the weather station. Low cost and simple design. It is suitable for the production and living of families and enterprises that have requirements for the environment.

Related recommendation: artificial climate room

Assistant Drilling Equipments

Assistant Drilling Equipments,Auxiliary Drilling Equipment,Drilling Equipment For Water Well,Core Drilling Equipment

JIANGSU XI TEC ENVIRONMENTAL&DRILLING EQUIPMENT COMPANY CO.LTD , https://www.xitecdrillingwx.com

Posted on