The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

In the digital measurement and control system, because the single-bus micro-grid only uses one wire for bidirectional data transmission, and provides power for remote devices at the same time, it not only reduces the hardware cost of the measurement and control system, but also improves the reliability of the system. Fieldbus technology with wide application prospects.

1 Overview

In the digital measurement and control system, because the single-bus micro-grid only uses one wire for bidirectional data transmission, and provides power for remote devices at the same time, it not only reduces the hardware cost of the measurement and control system, but also improves the reliability of the system. Fieldbus technology with wide application prospects. However, since the single-bus micro-grid needs to transmit data on the one hand, and supply power to the single-bus devices on the other hand, this will inevitably cause fluctuations in the power supply Voltage on the single-bus; and the sensor elements used in the measurement and control system, the output value of the It is not only proportional to the measured value, but also often related to the voltage value of the power supply. Therefore,

In order to ensure the measurement accuracy of the forensic sensor, the corresponding voltage correction must be carried out. In addition, the output value of the sensor is often affected by the ambient temperature, and corresponding temperature compensation must also be performed.

If the above problems are solved by common A/D conversion devices based on a single bus, the corresponding hardware circuits and software programming will be too complicated. Here, the single-bus device DS2438 of Dallas Company is used to solve the above-mentioned problems ingeniously. The following first introduces the device, and focuses on the functions related to the device and the measurement and control system.

DS2438 is an intelligent battery monitor launched by Dallas. This device is launched to solve the real-time monitoring of the battery working state of portable Electronic products. The main performance characteristics are as follows:

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

①Single bus device, only one port line is needed to realize power supply and bidirectional data transmission;

② On-chip 13-bit precision temperature sensor, minimum resolution 0.031 25 ℃;

③On-chip 10-bit two-channel voltage A/D converter, the minimum resolution is 10mV;

④On-chip 10-bit current A/D converter;

⑤ On-chip 40-byte non-volatile user memory;

⑥In-chip elapsed time counter to complete charging and discharging time timing;

⑦Single power supply operation, low power consumption characteristics;

⑧The working temperature range is -40℃~+80℃.

DS2438 adopts SOIC surface mount package, its shape and pin arrangement are shown in Figure 1, and the pin function description is shown in Table 1.

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

2. Working principle

The block diagram of the internal structure of DS2438 is shown in Figure 2.

As can be seen from Figure 2, DS2438 consists of single bus interface, voltage A/D converter, current A/D converter, temperature sensor, clock circuit, 40-byte E2PROM and registers related to the above hardware. The input of the voltage A/D converter can be programmed to be input from the VDD power supply terminal or the VAD input terminal to meet the measurement requirements of the VDD power supply terminal and the external input analog VAD.

2.1 Device memory cells

DS2438 memory types include volatile SRAM and non-volatile E2PROM. The internal memory of DS2438 is a memory with a total capacity of 64 bytes. The memory is divided into 8 pages, each page is 8 bytes, and the page addresses are 00~07H. The 00th page is the most frequently accessed page, and the structure of this page is listed in Table 2.

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

Page 1 is the current accumulator, elapsed time counter and current compensation unit; every 2 pages includes non-volatile time and charging time stamp; pages 3 to 7 are 40 bytes of E2PROM provided to the user, which can be used to save User data.

2.2 Register

All the registers of DS2438 are mapped to the above-mentioned memory, and the operation of DS2438 is carried out through registers.

 The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

(1) Status register

The status register is located in the 0th byte of the memory page 00. This register is used for the function control of the DS2438. The default value of each bit is 1, and the meaning is as follows:

*IAD is the current A/D control bit. IAD=1, current A/D and ICA are enabled, and current is measured at 32Hz; IAD=0, current A/D and ICA are disabled.

*CA is the current accumulator configuration bit. CA=1, enable CCA/DCA to store data and can restore data from page 7; CA=0, disable CCA/DCA, page 7 can be used for normal E2PROM storage.

*EE is the hidden current accumulator bit. EE=1, the CCA/DCA counter data will be hidden to the E2PROM, and the current counter will increase by 1 every time the power increases by 0.32C; EE=0, the CCA/DCA counter data will not be hidden to the E2PROM.

*AD is the voltage A/D input selection bit. AD=1, the voltage A/D selection is input from the VDD terminal; AD=0, the voltage A/D selection is input from the VAD terminal.

*TB is the temperature conversion busy flag. TB=1, the temperature conversion is in progress; TB=0, the temperature conversion is over.

*NVB is the non-volatile storage busy flag. NVB=1, in the process of copying from the erasable area to E2PROM; NVB=0, non-volatile storage idle state. One E2PROM storage takes 2 to 10ms.

*ADB is the A/D conversion flag bit, ADB=1, the voltage A/D conversion is in progress; ADB=0, the conversion is over or there is no measurement. One A/D conversion takes about 10ms.

*X means no positioning.

(2) Temperature register

The DS2438 can measure the temperature value with a resolution of 0.031 25°C in the range of -55 to +125°C, and the code form with the temperature value of 2 is output through a 2-byte temperature register. The sign bit S indicates that the temperature value is positive or negative; S=0, the temperature value is positive; S=1, the temperature value is negative.

(3) Voltage register

The voltage input range of DS2438 is 0~10V, and the input of the voltage ADC can be selected from VDD or VAD through the AD bit of the state/structure register. The result of the voltage A/D conversion is placed in the 2-byte voltage register, and the unit is mV.

(4) Current register

The DS2438 indirectly measures the current flowing through the battery by measuring the voltage across the current-sampling resistor RSENS. Using a 10-bit ADC with a resolution of 0.005C, the result of the current measurement value is placed in a 2-byte current register where the current measurement sign bit S is used to indicate charging or discharging.

2.3 Single bus protocol

The DS2438 is a single-bus-based device from Dallas. The operation of this device completely follows the single bus protocol, and its ROM command has 4.

①Read ROM[33H];

② Match ROM[55H];

③ Skip ROM[F0H].

Before the host can operate the DS2348, it must first send one of the above four ROM commands. After the DS2438 successfully executes the above command, the host can use the following memory commands to operate the DS2438.

Since the memory of DS2438 is divided into 7 pages, its memory operation commands are slightly different from other single-bus devices. The memory operation commands of DS2438 are as follows:

①Write the high-speed temporary memory[4EHXXH];

②Read the cache memory[BEHXXH];

③Read system high-speed temporary storage memory[48HXX];

④Restore memory[B8HXXH];

⑤Temperature conversion command[44H];

⑥ Voltage conversion command[B4H].

The XXH in the above memory command is the page address of the high-speed temporary storage memory, and the valid page number address is 00~07H.

In the operation of DS2438 to the high-speed temporary memory, in addition to the basic commands, the page address of the high-speed temporary memory must be sent out. The DS2438 allows one read/write of all 8 bytes within a page, and byte read and write operations can be terminated at any instant using a reset command.

It is worth noting that after the temperature conversion command and voltage conversion command of DS2438 are issued, the host needs to wait 10-20ms to make the DS2438 complete the temperature and voltage conversion; at the same time, if the parasitic power supply is used, the bus should be pulled high to ensure sufficient energy supply.

3. Application of DS2438 in single-bus microgrid

A specific example of applying the DS2438 to a single-bus microgrid is given below: Design of a single-bus temperature sensor. Temperature measurement is widely used in warehouse inspection, manufacturing and daily life, but humidity measurement is more difficult. The reason is that most of the temperature sensors are analog small signal outputs, and they are not satisfactory in terms of linearity, repeatability, and consistency. If the existing analog humidity sensor can be used to design a digital humidity sensor based on a single bus, a fully digital multi-point temperature and humidity measurement system can be formed with the single bus micro-grid technology, such as digital grain condition detection, digital storage detection system Wait. It can reduce the cost of system wiring and improve system performance, so it has very irregular significance. Here, using the analog large-signal relative humidity sensor and cooperating with DS2438, a humidity sensor that fully conforms to the single bus protocol is designed (see Figure 4 for the circuit).

3.1 Humidity sensor Since the single-bus micro-grid uses the method of registering the power supply to supply power to the single-bus device, it is required that the devices connected to the single-bus micro-grid must meet the requirements of low power consumption. Here, the analog large-signal humidity sensor HIH-3610 with low power consumption is selected. HIH-3610 is a relative humidity sensor produced by Honeywell Company in the United States. The transmitter adopts a thermosetting polyester capacitive sensor head and integrates a signal processing function circuit inside. Therefore, the relative humidity value can be converted into a capacitance value, and then the capacitance can be converted into a linear voltage output. At the same time, the sensor also has the advantages of high accuracy, fast response, high stability, low temperature drift, strong chemical corrosion resistance and good interchangeability. Its performance indicators are listed in Table 3, and the relationship between output voltage and relative humidity is shown in the figure 3 shown.

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

Table 3 HIH-3610 Humidity Sensor Performance Index

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

From the performance index and the relationship between output voltage and relative humidity, the following conclusions can be drawn.

①When the power supply voltage of HIH-3610 is 5V, its current consumption is only 200μA, which can fully meet the low power consumption requirements of single bus microgrid.

②HIH-3610 output voltage is

Vout=Vsupply[0.0062(sensor%RH)+0.16]

That is, the output voltage Vout is not only proportional to the humidity measurement value, but also related to the power supply voltage value Vsupply. If Vsupply is fixed at 5V, its value is only determined by the relative humidity value, but since the power supply voltage value on the single bus is variable, it is required to measure the value of the power supply voltage Vsupply while performing humidity measurement.

③The humidity value output by HIH-3610 is also related to the ambient temperature, so temperature compensation should be performed. The compensation formula is:

RH=(sensor%RH)/1.0546-0.0216t

Therefore, in order to obtain an accurate humidity measurement value, the ambient humidity and the single-bus power supply voltage value should also be measured at the same time as the humidity measurement.

3.2 DS2438 and sensor interface

In this system, DS2438 is used to simultaneously complete the measurement of the ambient temperature, the measurement of the single bus power supply voltage and the measurement of the output voltage value of the humidity sensor. It can be seen from Figure 4 that in order to meet the requirements of the parasitic power supply, a corresponding power supply circuit is designed for the sensor. The power supply circuit consists of VD1, VD2 and capacitor C1. Among them, diode VD2 and capacitor C1 constitute a half-wave rectifier circuit, which supplies power to DS2438 and HIH-3610 when the bus is idle. The potential of the 5-pin VDD terminal of DS2438 is the power supply voltage of HIH-3610. By programming the “AD” bit of the state/structure register inside the DS2438, the input of the two-channel voltage A/D converter is selected as the VDD end, and the power supply voltage measurement function of the HIH-3610 can be completed. By programming the “AD” bit of the status/structure register, the input of the two-channel voltage A/D converter is selected as the VAD terminal, that is, the humidity voltage value output terminal of the HIH-3610 can complete the humidity value measurement function, and the measurement of the ambient temperature can be performed by The humidity sensor inside the DS2438 is completed. Therefore, the measurement of the humidity value can be completed by using one piece of DS2438, and the correction of the power supply voltage and the compensation of the ambient temperature can be realized by the corresponding software algorithm.

The Characteristics of Single-Bus Device DS2438 and the Design of Realizing Micro-grid Measurement and Control System

3.3 Interface between microcontroller and sensor

The one-chip computer selects AT89C52 one-chip computer. Here, the P1.0 port line of the microcontroller is used as a single bus interface; the single bus humidity sensor adopts the registered power supply mode; a 4.7kΩ pull-up resistor is connected to the P1.0 port line, which can provide energy to the humidity sensor when the bus is idle.

3.4 Software programming

In the supplementary version of the network, the data acquisition program related to the single bus humidity sensor is given, including the reading humidity measurement value, the reading single bus power supply voltage value and the reading humidity value subroutine.

4. Conclusion

The single-bus digital humidity sensor composed of DS2438 has simple hardware circuit structure and simple connection with single-bus micro-grid; it can easily form a multi-point digital humidity and temperature monitoring system, so DS2438 is used in similar single-bus micro-grid measurement and control systems. has broad application prospects.

The Links:   1DI200ZP-120 LQ064V3DG07

micohuang