• Inventory
  • Products
  • Technical Information
  • Circuit Diagram
  • Data Sheet
Technical Information
Home > Technical Information > Sensing Technology > Design of low power intelligent sensor (Fig.)

Design of low power intelligent sensor (Fig.)

Source:mohanwei
Category:Sensing Technology
2023-05-22 00:02:20
23

In the process of industrial control, it is often necessary to measure some parameters, but the output signal of the general sensor is weak and not suitable for long-distance transmission. To reduce interference, a twisted-pair transmitter with current output of 4-20mA is usually used. Due to the complexity of the circuit, the transducer of signal analog processing has poor non-linear compensation effect. It is difficult to achieve temperature compensation in the full temperature range, so it can not meet the higher requirements. With low power consumption and high SCM, Σ-Δ ADC and Σ-Δ The increasing popularity of DAC provides a technical approach for the design of high intelligent transmitters.

The monolithic sensor signal interface design introduced in this paper uses a new multifunctional microcontroller MSP430F2013 introduced by TI, which integrates 16 bits internally. Σ-Δ ADC. With 2 kb program space and 128B data storage space, intelligent data collection can be completed and data transmission can be carried out by differential transmission. Data is transmitted by frame and error control is carried out by CRC test during transmission.

Structural features of MSP430F2013

MSP430F2013 is a micro-controller of TI's MSP430 series. It has the following structural features: 16-bit RISC CPU, 16-bit register and constant generator, which can achieve high code efficiency; Five low power modes can extend battery life in portable measurement applications. Digital Control Oscillator (DCO) switches from low power mode to normal mode with less than 1 μ S; A 16-bit timer; 10 I/O ports; Has synchronous communication protocol (SPI or I2C); A 16-bit Σ-Δ ADC.

A typical application of MSP430F2013 is that a sensor system captures analog signals, converts them to digital signals, and then uses the digital signals for screen display or transfers them to a host system for other processing.

System Introduction

Common analog-to-digital conversion circuits amplify analog signals, and generally design an interface circuit with single-chip computer. This system has a high degree of integration. A single chip can complete signal amplification, analog-to-digital conversion, software filtering, and a single-line protocol. It can directly communicate with the computer without designing an interface circuit with single-chip computer.

MSP430F2013 is a low-power device. The operating current of the system is 220 when running in a clock of 1 MHz. μ A, while in standby mode the operating current is only 0.5 μ A, the working current to maintain the power-saving mode of RAM is only 0.1 μ A, such low power consumption can be fully powered by batteries and is suitable for portable measurement.

This system uses MSP430F2013 for intelligent data collection. The data collected from the front-end sensor is amplified by a programmed gain amplifier, and then it enters the analog-to-digital converter for analog-to-digital conversion. After conversion, it is output in asynchronous serial mode. Figure 1 is a schematic diagram of the whole system.


Fig.1 System schematic diagram

In order to simplify the system and avoid the influence of external crystal oscillation on the system, the system uses internal DCO as the clock, and the system uses differential data transmission without data isolation. The application is configured with a transmission rate of 9600b/s, which can be received by setting a matching baud rate with a serial port.

Whether the system uses internal reference voltage or external reference voltage, the input voltage has a corresponding range, so the input of the front analogue must be limited by a regulator.

The system can adjust the conversion according to the size of the external signal. Simply increase P2.6 and adjust the analog value of the external input at the same time, the system will automatically adjust the PGA (Programmed Gain Amplifier).

Due to the use of half-duplex differential transmission, the system can be easily extended. The system can use multiple sensors to form a sensor network and collect data through bus-controlled sensors.

  1. Systems software

    The software flow chart of the system is shown in Figure 2.


    Figure 2 System software flowchart

  2. Initialization

    The initialization section mainly completes the following functions.

    Responsible for the initialization of the system clock, making the system work at the standard 8MHz clock specified for DCO.

    Configuring the ports of the system is especially important due to the pin-to-pin reuse. By setting SD16AE and SD16INCTL0, the working states of P1.0 and P1.1 are A0+, A0-, respectively. Set P2.6 and P2.7 as universal IO ports, where P2.6 is used as control signal for adjusting PGA and P2.7 is used as data transmission channel.

    Initialize the AD converter of the system, using the reference voltage inside the system. Since the input frequency can only be 1.1MHz at most, the main frequency of the system is 8-frequency input. The ADC in MSP430F2013 has no input cache and turns off the cache in the cache mode selection. The system measures continuously changing physical quantities and sets the system to a continuous conversion mode.
  3. measure

    Open the interrupt while measuring. When there is a measurement result, an interrupt occurs. The interrupt flag position is stored in the conversion result register. When the measurement result is read out from the conversion result register, the interrupt flag position is reset automatically. So when reading the conversion results, you only need to query the interrupt flag bits.

    Measurements are filtered using median average filter method. Each measurement value is sampled 10 times, the removal value and the minimum value are removed, and the remaining eight values are arithmetically averaged.



    This algorithm can effectively overcome the fluctuation interference caused by accidental factors, especially for physical quantities with slow changes in temperature, liquid level, etc.

    Internal reference voltage is used when measuring. The voltage input range of the measured signal is 0-500mV. When the input signal is full range input and the bit of the analog-to-digital conversion output is not 1, the signal can be amplified with a magnification of 32. When the magnification of the input signal is N, the range of the input signal will be reduced to 1/N. For example, when two times the amplification of PGA is chosen, the voltage input range of the measured signal is 0 to 250mV.

    The entire measurement process is represented as pseudocode below.

    Int measure (void)
    {
    Int i;
    If (SET==1)
    {
    Adjust gain;
    }
    For (i=0; i< 10; i++)
    {
    Waiting for conversion results to occur;
    Read and save the conversion results;
    }
    Cumulative conversion results;
    Find values and minimum values;
    Median mean filter;
    Return the measurement result;
    }
  4. data transmission

    Data transmission is sent by frame with the frame structure shown in Figure 3.


    Figure 3 Data frame structure


    Each frame of data includes synchronization codes, AD conversion results and check codes. Frame synchronization can be done with a specific synchronization code or gap synchronization, the second method is used here. When a data frame is sent, the data transmission line is first pulled up for 16 data bits, and the gap between the high level of the frame header is used for data frame synchronization.

    Parity check codes are simple as error detection codes, but the miss rate is too high. The most widely used error detection code in computer networks and data communications is a cyclic redundant code CRC with much lower miss rate and easy implementation. The higher the order of polynomial generated by CRC, the lower the probability of misjudgment. In this paper, CCITT-16 is used to generate a polynomial g(x)=x16+x15+x5+1. There are two general ways to implement CRC: direct calculation and table lookup. Since lookup requires at least 1 KB of space to store table values, a direct calculation method is used here.

    Single-line serial output is used for data transmission, analog serial transmission is used for port line, and data shown in Figure 4 is sent on the port line in turn when bytes are sent (lowering the port level when data is 0 and increasing the port level when data is 1). Bit duration is calculated according to the baud rate. The baud rate set in this application is 9600b/s. When no data is sent, a high level is maintained on the output port line.


    Figure 4 Sequence diagram of bytes sent


    Data transmission is isolated by optical couple, which isolates the output of field and data, and at the same time, the circuit can be simply changed according to the needs of the input of the back-level system.

Concluding remarks

After practical application, a single MSP430F2013 can measure the output level of small signal sensor, and the conversion time is less than 1 ms. It can also achieve low power consumption measurement, and the power consumption of the whole machine is not more than 6mW. The system is particularly suitable for implementing an intelligent sensor that can guarantee 16-bit A/D conversion resolution when the full radiance of the input signal is greater than 40 mV. Because of the half-duplex differential transmission, sensor networking can be easily achieved.





Source:Xiang Xueqin