• Inventory
  • Products
  • Technical Information
  • Circuit Diagram
  • Data Sheet
Technical Information
Home > Technical Information > Sensing Technology > Application of Energy Temperature Sensor Dsl8b20 in Multiple Temperature Measurement

Application of Energy Temperature Sensor Dsl8b20 in Multiple Temperature Measurement

Source:杨真人
Category:Sensing Technology
2023-04-07 18:28:45
25

Single-bus chips can make the hardware structure very simple, and are especially suitable for applications where there are many distant nodes, such as warehouse temperature detection, greenhouse temperature monitoring and so on. The design presented in this paper has good universality and can be easily ported to other applications.

Introduction to 1 Dsl8b20 Programming

Each single-bus chip has a unique 64b code inside it, which searches for the temperature of the path by matching the ROM code (1D) of each chip in multiple temperature measurements. Dsl8b20 has nine internal erasable registers called Note RAM. For all serial communication, reading and writing each bit bit data must be programmed strictly according to the time sequence logic of the device, as well as bus command sequence. For single-bus DSL8b20 chips, access to each device must follow the following command sequence: first, initialization; Then execute the ROM command; Is to execute a function command (ROM command and function command are given in tabular form after).

If the sequence is confused, the monobus device will not respond to the host. Of course, the search ROM command and the alarm search command, after executing either command, return to initialization.

All transmission processes on a single bus start with initialization, which consists of a reset pulse from the host and a response pulse from the slave. The response pulse lets the host know that there are slave devices on the bus and that they are ready.

After the host detects an answer pulse, it can issue a ROM command. These commands are related to the only 64 bROM code for each slave device. A ROM command is issued on the host to access a specified Dsl8620, then a function command supported by Dsl8620 can be issued. These commands allow the host to write or read Dsl8b20 note RAM and start temperature conversion. The software implementation of Dsl8b20 strictly follows the one-bus protocol:

(1) The host first sends a reset pulse, and all Dsl8620 devices on the signal line are reset.

(2) After the host sends ROM command, the program starts to read a single online chip ROM code and save it in the single-chip computer data memory, then dismounts the read out, hangs the unread encoded Dsl8620 on the bus one by one, and reads its ROM code until all the ROM codes of Dsl8620 that need to be used are read out offline, and saves all the ROM codes in a two-dimensional array, and the data is saved in X25043.

(3) When the system is working, hang all Dsl8b20 that have read the codes and need to be used on the bus. Send temperature conversion command, then bus reset.

(4) Then you can match the on-line temperature sensor one by one from the two-dimensional array just now, and then send a temperature reading command to get the corresponding temperature values of each way in turn. Read the temperature software flow diagram as shown in Figure 1.

During host initialization, the host generates a reset pulse by pulling down the unibus at least 480/us. The host then releases the bus and enters receive mode. When the bus is released, the pull-up resistance increases the single bus. After the rising edge is detected by the single bus device, the delay is 15-60/us, and then the response pulse is generated by pulling down the bus 60-240//s.

//Bus Reset Program
Bit dsl8b20_ Reset (void)


Write time slots start when the host pulls down the bus, resulting in a write 1 time slot: after the host pulls down the bus, it must then release the bus within 15uPs; Write generated. Time slot mode: After the host pulls down the bus, just keep the low level for the whole time slot (at least 60us).

When writing a bit bit in a syllable program, it is not written separately as usual. Time Series and Write 1 Sequence, but combine the two to write bit C to DO within 15US when the host drops down the bus: if C is high enough to release the bus within 15/is, if C is low enough, DO
= C This statement still drops the bus at a low level, completing a write time sequence (write time sequence 0 or write time sequence 1) with a delay of 58us.


Each read-time slot is initiated by the host, lowering the bus by at least 1US before the unibus device starts sending on the bus after the host initiates the read-time slot. Or 1. All read slots require at least 60us.

Although the above three subprograms were developed for Dsl8b20, in fact, the sequence of single bus chips is similar, so long as the above subprograms are modified slightly according to the sequence characteristics of other similar chips, they can be used as well. Below is the main program for multi-point temperature measurement. Enter the number where parameter x is the temperature measurement point.

For space limitation, there are no programs for reading the ROM numbers of a single Dsl8620 chip. Instead of using the ROM command 0FH to search all online temperature sensors, the multi-channel temperature measurement uses the ROM command 33H to read out each temperature sensor that needs to be used offline first. This simplifies the programming and wastes a lot of time waiting for the search to complete without searching ROM codes online one by one (on average, 1 s per 75 chip ROM codes searched). By reading out the ROM codes one by one offline, the temperature measurements can also be matched in advance in a two-dimensional array that stores these codes.

3 Application Instances

In temperature detection of concrete dams, real-time and accurate display of temperature changes is required, temperature sensors are buried in the places where temperature monitoring is needed, and temperature measurement chips are placed in each temperature measurement module where temperature monitoring is needed. Temperature measurement modules are widely distributed, so single-chip computer uses RS485 bus form to communicate with upper computer, which is slave, and communication interface uses RS485 chip MAXl487, which is verified. When the baud rate is selected to be 9 600 kb/s, the communication distance can work normally in the range of 2 km or so. The upper computer sends command wheel to read the lower computer temperature, and the lower computer does not transmit data. The lower computer receives the command from the upper computer, starts the temperature conversion of the temperature measuring point, transfers it to the upper computer after conversion, and displays it on the LED. The whole work is completed by the upper computer program and the lower computer serial port interruption coordination. The temperature measurement value of the system is stable.

4 Conclusion

This distributed temperature monitoring system has broad application prospects in a wide range of multi-point temperature measurement systems.



Source:Xiang Xueqin