A DESIGN OF WIRELESS LOW POWER STRAIN MEASUREMENT BASED ON IOT TECHNOLOGY

Strain measurement is widely implemented in the civilization, mechanical, electrical and material industrial and research field. The traditional strain measurement devices are tremendous in dimension and power consumption. Most of them connect with computers with wire communication such as RS232, USB, etc. With the rapid development of the Internet of Things, many devices have been connected in wireless communication which enables long-range and low-power measurement in the industry. This thesis is focused on the design and development of a low-power strain measurement system based on LoRa IoT technology, which requires accuracy strain gauge measurement, low-power consumption, and long-range wireless communication. Special contributions to the presented system include high-accuracy strain sensing circuit, low-power design, and long-range wireless communication. Additionally, a Graphic User Interface software is designed and developed on the computer to receive, plot the real-time strain data transfer from devices, and save to files. To verify the accuracy and effectiveness of the system, a comparative test is performed with the manufactured strain measurement device. Finally, the optimization of the system in the future is suggested. The hardware schematic, PCB files, firmware, and software are also listed in the appendix.

Chapter 2 investigates the state-of-art ways to measure the strain in the industry and the lab which includes strain gauge, optical fiber sensor, and digital image correction. In the end, it gives the choice of this design and reason.
Chapter 3 shows the detailed design of the hardware, firmware, and software of the system. It includes power system design, strain gauge sensing circuit, analog to digital conversion, microcontroller, and wireless communication. Some of the system diagrams, schematics, and PCB layouts are shown in this chapter. Firmware and software of the system are also shown in this chapter. The configuration and parameter of the peripherals such as ADC, multiplexer, wireless chip are given and the flow chart of the software is illustrated in detail.
Chapter 4 concludes the evaluation and verification of the design. It shows the power performance, temperature compensation, and performance comparison with the manufactured device.
Chapter 5 gives several optimization options for design in the future.
Finally, in the appendix, the schematics, PCB layouts, and the code of the system are illustrated in detail.

HIGH ACCURATE STRAIN MEASUREMENT
There are several kinds of technologies to measure the strain of the object: electrical and optical. The most commonly used instruments to measure strain are electrical strain gauge. There also optical methods to measure the strain which are mainly Fiber Bragg Gating sensors and digital image correlation.

Strain gauge measurement
The strain gauge is invented by Edward E. Simmons and Arthur C. Ruge in 1938, the most common structure of strain gauge consists of an insulating flexible backing which supports a metallic foil pattern. The gauge can be stuck to the object to be measured by a specific adhesive.
In the elastic deformation range of materials, the methods of calculating the material stresses from the measured strains are based on the Hooke's Law of which the simple form is: (  where K is defined as the gauge factor of the strain gauge, ΔR is the resistance change due to strain and R is the initial resistance, and ε is the strain to which the measurement is subjected.  Digital image correlation strain measurement also has some advantages and disadvantages. The great advantage of digital image correlation strain measurement is simple measurement setup and specimen preparation which only a fixed CCD camera is needed for recording. But the disadvantages are also obvious that the measurement heavily depends on the quality of the CCD imaging system.

Strain measurement in the design
This design is to develop a wireless strain measurement network in low power and low price. To minimize the device size and the price, this device uses the strain gauge to measure the strain of the system.

SYSTEM DESIGN
This chapter presents the detailed design of the system which contains hardware, firmware, and software. The first section discusses the overview of the design. The second section shows the hardware design which includes power design, sensing design, analog conversion design, microcontroller design, and communication design.
The next one states the firmware design for all the hardware functions which includes analog to digital conversion, low power design, wireless communication design.
Finally, the design of Graphic User Interface software which receives, plots and saves data from MCU is discussed in the software design section.

Overview of the design
This design is a system that contains the whole architecture of the wireless data sampling system in the industrial field and the schematic is showed in Fig 3.1.
The system has eight-channel signal input which contains an 8 to 1 channel multiplexer. Because the signal is generated by the strain gauge sensor and the measurement is to detect the change of the resistance of the sensor. The change of resistance is so small that a Wheatstone bridge is implemented to enlarge the sensitivity and change the resistance signal to the voltage signal for the next sampling.
To acquire the voltage signal, an ADC is used for converting the voltage signal into the digital signal. The digital signal is transferred to the MCU by the SPI port and processed inside the MCU. The MCU is the core part of the hardware system and in charge of data sampling and calculating. After calculation, the MCU transfers the strain data to the desktop or laptop through wireless modules.
Same as other digital systems, the power system is also critical to the whole design. LDO power chips are used to supply all the parts' power.

Power design
The power supply module is one of the important parts of the embedded system.
Except for the power supply function, the quality of the power supply also has a great influence on the performance of the system. Inappropriate power supply design will bring lots of noise to the whole system and downgrade the performance of the system, especially of the analog signal data acquisition subsystem.
In embedded system power design, there are two kinds of power supplies one is the switch-mode power supply and the other is the low-dropout linear regulator.
Switch-mode power supplies(SMPS) are the most popular power supply because of their high efficiency. The defining feather of SMPSs is that they store energy in a capacitor or inductor, and repetitively switches its transistor on and off. SMPSs' main benefit is the extremely high efficiency and low heat level and the efficiency level typically is above 80%. While the main disadvantages of SMPS are complexity, cost, and the high levels of noise and ripple which dramatically decrease the accuracy of the output voltage.
LDOs are simply regulators compared with SMPSs and don't have the inductor, capacitor, or switcher. LDOs drop excess input voltage across a transistor which operates in the active region and creates a power supply with very simple regulation.
The advantage of LDO is very little noise and requires no inductor for operation. They create highly accurate and low noise output voltage which are often used in the lowpower application.
Base on the advantage and disadvantage between LDOs and SMPSs, the design choose the LT3042 made by Analog Device Inc. to be the power regulator for the system. LT3042 is a high-performance low dropout linear regulator feathering ultralow noise and ultrahigh PSRR for powering noise-sensitive RF applications. The schematic of the typical application for LT3042 is shown in Fig3.2.  Transients are short duration spikes in voltage or current that could damage the circuit in many ways. In this design, to suppress the transients, The Transient Voltage Suppressor(TVS) is used to suppress transients. The TVS is ACPDQC3V3T-HF and manufactured by Comchip. The working peak reverse voltage is 3.3V and the typical breakdown voltage is 4.1V.

Sensing design
Sensing design is the most important part of the analog signal design which contains strain gauge selection and analog signal detection circuit design.
The various strain measurements are discussed in detail in chapter 2. To meet the requirement the design of and lower the cost, the strain gauge is chosen to be the sensor to measure the strain. For the signal of strain gauge is very small, Wheatstone bridge is used to detect the strain gauge signal which is suitable for weak signal detection.

Strain gauge
In this design, precision the strain gauge SGD-3/350-LY11 manufactured by OMEGA Engineering Inc. is chosen to be the sensor. The rugged construction and flexibility of the OMEGA strain gauge make them suitable for highly accurate static and dynamic measurements. The tolerance of the gauge is ±0.30% and the resistance is 350 ohms. The typical installation of the strain gauge installation is shown in is the voltage from P1 to P2, is the voltage of the supply.
So the unknown , resistance to being measured can be calculated by the equation below: (2.2) To simplify the calculate, the design chooses = = =360 ohm. Because the resistance of strain gauge is 350 ohms, the output voltage can be positive which keeps in the best linear range of the ADC.

Resistors model ERA-3AEB361V manufactured by Panasonic Electronic
Components are used in the bridge and their ±0.1% tolerance can minimize the error of the measurement.

Multiplexer
To acquire the multi-channel signal, the multiplexer is designed to connect 8 channels signals from a sensing bridge and sample the signal in the loop. ADG707 which contains low-voltage, CMOS analog multiplexer comprising eight differential channels is suitable for the design. The low-power consumption and operating supply make ADG707 ideal for battery-powered and low-power instruments. The ADG707 switches one of eight differential inputs to a common differential by the 3-bit binary address lines A0, A1, and A2. An EN input on the chip is used to enable or disenable the device. ADC is the core part of the data sampling circuit. There many kinds of ADC available for data conversion. Due to the properties of the signal generated by the Wheatstone bridge, which frequency is not high, but amplitude is low, the sigma-delta ADC is the best choice for strain gauge signal conversion.
AD7799 made by Analog Device Inc. is chosen as the conversion chip in which the functional block diagram is shown in Fig 3.10. The AD7799 contains a low noise, 24-bit Σ-Δ ADC with three differential analog inputs. The on-chip, low-noise instrumentation amplifier enables the ADC to directly interface the ultra-small signal. The Wheatstone bridge always consumes power whenever the sampling takes place. So, another advantage of AD7799 is there is a low-side power switch inside the chip which can save power when the sampling system is idling. In this design, the cold side of the Wheatstone bridge is connected in series to the low-side power switch pin (PSW). In normal operation, the switch is closed to measure the output of the bridge, while in idling or standby mode the switch can be opened to significantly reduce the power consumed.
The digital port of AD7799 to the microcontroller is SPI port and connected to the microcontroller.
AVDD and DVDD are connected to analog power and digital power separately.

Microcontroller design
The microcontroller is the core part of the embedded system and controls the data sample, calculation, transfer through the system. In a low-power design, a powerful microcontroller is needed but the low-power performance is critical.
In this design, the STM32L073 manufactured by ST Microelectronics is selected to be the microcontroller of the system. The STM32L073 is based on the ARM Cortex-M0+ core and provide an ultra-low-power platform.  Clock management is a very important part of microcontroller design which has an impact on performance and power consumption. Three different clock sources can be used to drive the master clock SYSCLK. To enable the ultra-low-power clock source, a 32.768kHz low-speed external crystal serves as the master clock source. The clock configuration of the STM32L073 in this design is shown in Fig 3.12.  In this design, the SX1272 manufactured by Semtech inc. is the main part of the LoRa wireless communication design. The SX1272 can achieve a sensitivity of over -137dBm using a low-cost crystal and bill of materials with Semtech's patent. The high sensitivity combined with the integrated +20dBm power amplifier yields industrial optimal range and robustness. The low RX current of 10mA and 100nA register retention enables the low power consumption ability. Except for the LoRa module, SX1272 also supports high-performance FSK modes for the system including WMBus, IEEE802.15.4g. The block diagram of SX1272 is shown in Fig 3.14.    The configuration of STM32 is very critical in hardware coding. Be careful to configure the GPIO port, especially the Debug port. Multiple ports configuration may cause malfunction of the STM32.

Multi-channel Sampling
In this design, it is important to sample 8 channel strain gauge signals to the sensing circuit in a loop. As mentioned before, a multiplexer ADG707 which contains 8 differential channels is designed to sample different channels. The truth table of ADG707 is shown in Table 3.1.  To control the ADG707, the STM32 is configured the PA8, PA9, PA10, PA11 pins as push-pull output GPIO pins. The operation frequency of the PA port is configured to the low frequency which is 2.097 MHz At the beginning of the firmware, there is an initialization method that includes GPIO initialization. The relative GPIO ports are configured as push-pull output function and the operation frequency is configured as low frequency. The main function of the firmware is considered as an infinite loop that contains the data sampling, calculation, and transfer to the laptop. At the beginning of the data sampling, change the channel connected to strain gauges, and start analog to digital conversion.
The firmware code is shown in the appendix.

Analog to Digital Data Conversion
Analog to digital data conversion is based on the AD7799 and communication between AD7799 and STM32L073. AD7799 communicates with STM32 in SPI protocol which is very popular in embedded system peripheral communication.
The diagram of the AD7799 read and write cycle timing diagram is shown in  As Fig 3.18 shows, when data transfer between AD7799 and STM32, the MSB is transferred in the first and the data will be lathed on the rising edge of the SCLK signal. To enable multiple ADC operation, the CS signal must pull down during the transfer. The timing of the write and read operation must follow the timing characteristics shown in Table 3.3, otherwise, the operation of AD7799 may be failed. To match the SPI communication protocol of AD7799, the configuration of the SPI2 port on STM32 is shown in Table 3.5. At the beginning of the firmware beginning, SPI2 port will be initialized as the configuration shown in Table 3.5. When the STM32 boots up, all of the parts in the STM32 are initialized including SPI2 port. After initializing the SPI2 port following the configuration in Table 3.5, the AD7799 will be initialized to be ready for the data sample.
AD7799 initialization function includes two parts, one is a self-checking method and the other one is the registers' initialization method. To check if the SPI communication is correct, the self-checking method is to read some of the registers after the SPI initialization method and their default values are shown in Table 3.6. In the self-checking method, STM32 will read the value in the registers of AD7799 and compare it with the default values, if the values match the default ones, the firmware will run to the next step. While the values don't match the default ones, the error exception will be thrown out and firmware will reset.
When the initialization is method complete, the AD7799 will be configured as Table 3.7 below. Channel Select AIN1 After configuration for the AD7799, the data can be sampled in an infinite loop between all the 8 channel signals which connected to different strain gauges. Because the system will sample all the 8 channel data by the multiplexer to AD7799, the data conversion mode should be configured as the single conversion and, the mode register will be configured before each sample. The timing diagram of the single conversion is shown in Fig3.20.

Low Power Design
Low power design is an important part of the system design which enables the system to work under low power consumption and for a long time. There are three main parts of low power design which include ADC, STM32 and LoRa chip parts .   Fig 3.9 shows that there is a low-side power switch in AD7799 which is connected to the cold side of the Wheatstone bridge. It can significantly reduce the power consumption when the switch opens when the system is idling.
In the Mode register, MR12 bit is Power Switch Control Bit. MR12 can be cleared to open the power switch to save power consumption. There also MR15 to MR13 bits to set the AD7799 operation mode. When the data sampling is idling, MR15 and MR13 could set 010 to configure AD7799 in idle mode.
There are seven low-power modes in STM32L073 provided to achieve the best compromise between low power consumption, short start time, and system performance. The low-power modes of STM32L073 are listed in Table 3.8. Stop mode without RTC Achieves the lowest power consumption while retaining the RAM and register contents. All clocks are stopped.
Standby mode with RTC Achieve the lowest power consumption and real-time clock.
Standby mode without RTC Achieve the lowest power consumption.
The system is designed to work as a low-power run mode because the sampling and transferring data processes are always running.
When the low-power run mode is running, the frequency of STM32L073 will be limited in 131kHz.

Wireless Communication Design
The main part of LoRa communication is to control the SX1272 LoRa chip through SPI1 port and GPIO pins of STM32L073. The pin connection between STM32L073 and SX1272 is shown in Fig 3.   The LoRa modulation is performed by representing each bit of payload information by multiple chips of information. The rate at which the spread information is sent is referred to as the symbol rate (Rs), the ratio between the nominal symbol rate and chip rate is the spreading factor and represents the number of symbols sent per bit of information. The ranges of values accessible with the LoRa modem are shown in Table 3.11. To further improve the robustness of the link the LoRa modem employs cyclic error coding to perform forward error detection and correction. The error coding brings up a transmission overhead and the resultant additional data overhead per transmission is shown in Table 3.12.  The LoRa symbol rate can be determined by the equation below: ( 3.1) where BW is the programmed bandwidth and SF is the spreading factor. The transmitted signal is a constant envelope signal.
The LoRa modem employs two types of the packet format, explicit and implicit.
The explicit includes a short header that contains information about the number of bytes, coding rate, and whether a CRC is used in the packet. The packet format is shown in Fig 3. Table 3.14 shows the operation mode and functionality of LoRa.  The STM32 can access the configuration register of the LoRa modem through the SPI interface via a synchronous full-duplex protocol corresponding as shown in Table 3.9. There are three modes to access the registers are provided: SINGLE access: an address byte followed by a data byte is sent for write access whereas an address byte is sent and a read byte is received for the read access. The NSS pin goes low at the beginning of the frame and goes high after the data byte.
BURST access: the address byte is followed by several data bytes. The address is automatically increased internally between each data byte. This mode is available for both read and writes accesses. The NSS pin goes low at the beginning of the frame and stays low between each byte. It goes high only after the last byte transfer.
FIFO access: if the address byte corresponds to the address of the FIFO, then succeeding data byte will address the FIFO. The address is not automatically incremented but is memorized and does not need to be sent between each data byte.
The NSS pin goes low at the beginning of the frame and stays low between each byte.
It goes high only after the last byte transfer.

EVALUATION
This chapter presents the evaluation of the system. The evaluation includes two main parts, one is the stain gauge measurement performance evaluation and the system performance evaluation.
In strain gauge measurement performance evaluation, the temperature compensation will be discussed because of the influence of the environment temperature change. In the next, a serious comparison testing will be implemented to verify the system performance of our system. We will discuss system performance evaluation. The noise performance of the power system influences the system noise dramatically. The power noise performance will be presented. At last, low power performance will be discussed and presented. To remove the error caused by the temperature drift, one strain gauge of the system is used to be the temperature compensation channel. This strain gauge will not be adherence to the surface of the test object but near it. This strain gauge we call it the compensation sensor.
To compensate for the temperature drift, the resistant change of the compensation sensor will be calculated and present the temperature coefficient on the strain gauge sensors. Then the coefficient will be considered in the calculation of other channels which shows below:   Table 4.1.  Because the strain gauge on the object surface cannot be connected to two measurement systems simultaneously, performance testing will implement the same force sequence on the object separately for two measurement systems. The profile of the force sequence of the test platform is shown in Fig 4.5. The force on the object is from 0kN to 7kN and the step is 1kN. On each different force, the testing system will keep the force for 60 seconds.  To evaluate the performance of power noise, the Picoscope is 5244D made by pico technology is used to measure the frequency spectrum of the output of the power system. The configuration of 5244D is shown in Table 4.2. The frequency spectrum of the output of the power systems is shown in Fig 4.7. Spectrum range 16MHz Coupling mode DC The spectrum of digital power output The spectrum of analog power output   To test the performance of the system, a variety of experiments have been implemented. The comparative testing with P3, which manufactured by VISHAY, is shown that the performance of the design is the same as the commercial devices. It presents that this design is successful and can be implemented in the industry. In the next step, the microcontroller integrated wireless function may be selected to be the MCU of the system. This will lower the power consumption and decrease the dimension of the system largely. AD7799_Reset(); AD7799_ID = AD7799_ReadReg(ADC_REG_ID); if ((AD7799_ID & 0xff00) != 0x4900) return 1; AD7799_ID = AD7799_ReadReg(ADC_REG_CONFIG); AD7799_ID = 0x071f; AD7799_WriteReg(ADC_REG_CONFIG, AD7799_ID); AD7799_ID = 0x0000; AD7799_ID = AD7799_ReadReg(ADC_REG_CONFIG); AD7799_Reset(); AD7799_ID = AD7799_ReadReg(ADC_REG_CONFIG); AD7799_Calibration(chn1, Gain32); AD7799_Val = 0x0610; //Bipolar, gain=64, REF_DET DISABLE, BUF Enable, AIN1 Channel AD7799_WriteReg(ADC_REG_CONFIG, AD7799_Val); AD7799_Temp = AD7799_ReadReg(ADC_REG_CONFIG); AD7799_Val = 0x300f; //single convert, PSW enable frequecy of adc is 4.17Hz AD7799_WriteReg(ADC_REG_MODE, AD7799_Val); AD7799_Temp = AD7799_ReadReg(ADC_REG_MODE); return 0; }