Application Note AN8000.11 XE8000 Wireless Gas Sensor AN8000.11 Application Note Wireless Gas Sensor Rev 1 February 2006 www.semtech.com 1 Application Note AN8000.11 XE8000 Wireless Gas Sensor Abstract This application note describes a wireless gas sensor module. The application is based on an 8 bit micro controller with a 16+10 bit ZoomingADC™ on chip and a 433MHz transceiver. The sensor is a semi-conducting metal oxide layer gas sensor. The system consists of two modules; one mobile station with the sensor and one base station for the communication with a PC. As the mobile station is battery powered ultra low power consumption is required. Therefore, the low power micro controller and the low power transceiver used in this application are perfectly suitable. © Semtech 2006 www.semtech.com 2 Application Note AN8000.11 XE8000 Wireless Gas Sensor Table of contents 1 INTRODUCTION ......................................................................................................................................5 2 GENERAL DESCRIPTION.......................................................................................................................5 2.1 BLOCK DESCRIPTION .............................................................................................................................5 2.2 FUNCTIONAL DESCRIPTION .....................................................................................................................6 2.3 COMPONENTS DESCRIPTION ...................................................................................................................6 2.3.1 Gas Sensor ................................................................................................................................6 2.3.2 XE8805/05A micro-controller......................................................................................................6 2.3.3 XE1201A Transceiver (300 - 500 MHz) ......................................................................................6 3 SENSOR INTERFACE .............................................................................................................................7 3.1 MSGS3000 CHARACTERISTICS ..............................................................................................................7 3.1.1 Sensor Supply Voltages .............................................................................................................8 3.2 XE8805/05A DAC CHARACTERISTICS ....................................................................................................9 3.2.1 Implementation of the DAC_bias function..................................................................................9 3.3 XE8805/05A ZOOMINGADCTM CHARACTERISTICS .................................................................................10 3.3.1 Configuration of the ZoomingADCTM for Gas Sensor Application .............................................10 3.4 HARDWARE INTERFACE ........................................................................................................................12 3.5 SOFTWARE DESCRIPTION .....................................................................................................................13 3.5.1 Mobile sensor system...............................................................................................................13 3.5.2 Base System Flowchart ............................................................................................................14 3.6 RF TRANSCEIVER INTERFACE ...............................................................................................................15 3.7 PROTOCOL DESCRIPTION .....................................................................................................................15 3.8 HARDWARE INTERFACE ........................................................................................................................16 3.8.1 XE1201A - XE8805/05A interface ............................................................................................16 © Semtech 2006 www.semtech.com 3 Application Note AN8000.11 XE8000 Wireless Gas Sensor Table of Figures FIGURE 1: GLOBAL DESCRIPTION ................................................................................................5 FIGURE 2: MSGS3000 SCHEMATIC .............................................................................................7 FIGURE 3 BELOW SHOWS THE SENSOR TRANSFER FUNCTION FOR ALCOHOL. ..................................7 FIGURE 3: MSGS3000 TRANSFER FUNCTION FOR ALCOHOL ........................................................7 FIGURE 4: VH AND VS VOLTAGE PATTERN ...................................................................................8 FIGURE 5: GENERAL BLOCK DIAGRAM .........................................................................................9 FIGURE 7: ZOOMINGADCTM BLOCK DIAGRAM .............................................................................10 FIGURE 8: ZOOMINGADCTM DECIMAL OUTPUT VERSUS VOLTAGE INPUT ........................................11 FIGURE 9: HARDWARE INTERFACE BETWEEN XE88LC05 AND MSGS3000 GAS SENSOR .............12 FIGURE 10: FLOWCHARTS OF MOBILE SENSOR APPLICATION ........................................................13 FIGURE 11: FLOWCHART FOR BASE SYSTEM APPLICATION ...........................................................14 FIGURE 12: RF FRAME CONTENTS ............................................................................................15 FIGURE 13: XE1201A PIN OUT AND DESCRIPTION ......................................................................16 FIGURE 14: XE1201A – XE88LC05 INTERFACE .......................................................................17 © Semtech 2006 www.semtech.com 4 Application Note AN8000.11 XE8000 Wireless Gas Sensor 1 Introduction The purpose of this application note is to explain the different steps needed, to build a wireless gas sensor based on XE8805/05A capabilities. This application note demonstrates XE8805/05A performances as both sensing machine and RF communication driver. To implement the gas sensor function, we used a semi-conductor gas sensor. For the RF communication the XE1201A (UHF) radio transceiver is used. The system can be built with two XE8805/05A ProStart modules and two XE1201A RF modules from Semtech and the MSG3000 gas sensor from Microsens. 2 General Description 2.1 Block Description Figure 1 shows a wireless gas sensing machine. This system is composed of two different parts: - The mobile station which includes the gas sensor The base station which is connected to a PC The mobile system includes the MSGS3000 gas sensor, a XE1201A transceiver and a XE8805/05A microcontroller. The base system includes a transceiver XE1201A, a XE88LC05 micro-controller and a PC. GAS SENSOR PB0 ANTENNA 2 DAB XE1201 ZoomingADC MSGS3000 8 XE88LC05 MOBILE SYSTEM XE88LC05 ANTENNA 2 RS 232 XE1201 UART Tx UART Rx 8 PC station BASE SYSTEM Figure 1: Global Description © Semtech 2006 www.semtech.com 5 Application Note AN8000.11 XE8000 Wireless Gas Sensor 2.2 Functional Description The mobile system micro-controller activates the gas sensor every five seconds. After the gas sensor has been stimulated, it measures the relevant gas quantities. As soon as the measurement is finished, the value is captured by the micro-controller’s ZoomingADC™. Finally, the data is sent to the base system via the XE1201A transceiver. The RF unit at the base system is waiting for a matching data frame. The arriving data will then be send to the PC com port via a UART connection. The PC application calculates and displays the data using the following equation: Signal = Offset + Gain * Code + Gain2 * (Code) 2 Code is the digital value coming from the ZoomingADC. The user can customise the Offset, Gain and Gain2 parameters on the PC. 2.3 Components description 2.3.1 Gas Sensor A semi-conducting metal oxide layer characterises the low power MSG3000 sensor. The measurements of specific oxidising or reducing gases are based on reversible conductivity change of the sensing element at an appropriate working temperature. For more information about this product, consult http://www.microsens.ch , the microsens web site. 2.3.2 XE8805/05A micro-controller The XE8805/05A is an ultra low-power micro-controller unit, associated with a versatile analog-to-digital converter including programmable offset and gain pre-amplifier. This acquisition chain, the ZoomingADCTM also includes an analog multiplexer (AMUX) allowing selection of four differential inputs channels or seven common referenced signal paths. As the XE88LC05 has several sources of interrupts and events, it can directly read the XE1201A data output and synchronised clock. 2.3.3 XE1201A Transceiver (300 - 500 MHz) The XE1201A is a half-duplex FSK transceiver for operation in the 433 MHz ISM band (optimised) and in the 300-500 MHz band. The range of the XE1201A is between 200 and 300 meters. The modulation used is the Continuous Phase, 2 level Frequency Shift Keying (CPFSK). The direct conversion (zero-IF) receiver architecture enables on-chip channel filtering. The XE1201A includes a bit synchroniser so that glitch free data with synchronised clock can directly be read by a low cost / low complexity micro-controller. The transmitted power level can also be controlled via the bus. For more information on XE8000 micro-controller series and XE1200 RF transceiver series, please consult the Semtech website. © Semtech 2006 www.semtech.com 6 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3 Sensor Interface 3.1 MSGS3000 characteristics The MSGS3000 contains two main parts. One part is the sensitive element, which consists of a semi-conducting metal oxide layer. The other part is an integrated heater where the thin sensitive metal oxide layer is deposited. The gas selectivity of the sensor is determined by superficial or bulk doping of the semi-conducting metal oxide with metal catalysts. Different types of gases can be detected by adjusting the working temperature of the sensor. Figure 2 below shows the schematic of the gas sensor, with the heating and sensing parts. VH Heating Sensing VS Figure 2: MSGS3000 schematic Figure 3 below shows the Sensor transfer function for Alcohol. Alcohol: 0.4mg/l Air at 34°C Saturated with Water 3 2 Air at 34°C Saturated with Water 1 0 0 10 20 30 40 50 60 Figure 3: MSGS3000 Transfer Function for Alcohol © Semtech 2006 www.semtech.com 7 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.1.1 Sensor Supply Voltages An appropriate working temperature has to be achieved in order to measure specific oxidising or reducing gases. This particular working temperature is achieved with the voltage VH connected to the heater of the sensor. Figure 4 below, shows the pattern of a specific heating voltage VH to measure the alcohol concentration in air. To create this voltage pattern the DAC function of the XE8805/05A is used. The power supply voltage VS for the sensor is generated by the digital output pin PB0. See figure 4 below. VH[V] DAC Bias 2.10 0.68 300 100 t[ms] VS[V] 3.0 PortB0 450 t[ms] Figure 4: VH and VS voltage pattern © Semtech 2006 www.semtech.com 8 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.2 XE8805/05A DAC characteristics The XE8805/05A has two digital to analog converters (DAC)s: a signal DAC able to pass a 4KHz signal with 10bits precision, and a bias DAC, able to output 10mA to bias a resistive bridge sensor. Both are DACs formed from a generic DAC and an amplifier. This makes current and voltage drive possible and gives the user freedom to choose the preferred filtering scheme. For more details on the DAC performances, consult the TN8000.03 on the Semtech website. 3.2.1 Implementation of the DAC_bias function The DAC peripheral is used together with the onboard amplifier in order to deliver the current required by the integrated heater of the MSG3000. The figure below shows the block diagram of the peripheral. It consists of a control block that manages all communication with the CPU, sets the configuration of the peripheral and implements the different test modes. The DAC converts the digital data in an analog output signal with an amplifier that can output up to 10mA. C O N T R O L DAB_R_P DAB_OUT D DAB_R_M A DAB_A1_P DAB_AO_P + Amp DAB_AO_M XE8805/05A DAB_A1_M Figure 5: General block diagram © Semtech 2006 www.semtech.com 9 Application Note AN8000.11 XE8000 Wireless Gas Sensor XE8805/05A ZoomingADCTM characteristics 3.3 XE8805/05A ZoomingADCTM is appropriate for this type of measurement, thanks to its offset compensation capabilities. See below Figure 5 that shows XE88LC05 ZoomingADCTM block diagram. Figure 7: ZoomingADCTM block diagram In our case, the output of the sensor is connected to the first (AC_A0–AC_A1) input channel of ZoomingADCTM and all PGAs are enabled. The AD converter is used to convert the differential input signal into a 16 bits 2’s complement output format. For more details on ZoomingADCTM performances, see AN8000.05 on the Semtech website. 3.3.1 Configuration of the ZoomingADCTM for Gas Sensor Application The following parameters have to be known in order to be able to calculate the configuration of the acquisition chain. • Power supply of sensor Vsupply = 3 V • Reference voltage of ZoomingADC Vref = 3V • Full scale span of sensor output Vout = 0.7V Calculation of the necessary gain to cover ADC full scale: 1.5V Vref/2 Gain = | Vout (max) | = ≅ 4.29 0.35V © Semtech 2006 www.semtech.com 10 Application Note AN8000.11 XE8000 Wireless Gas Sensor Calculation of the offset compensation ZoomingADC output code (decimal) The output of the sensor is 0V if the air is not saturated with alcohol and 0.7V when the air is saturated with alcohol. In order to obtain the full scale output range of the ZoomingADC™ an offset has to be applied so that an input voltage of 0V equals to an output code of –32768 and an input voltage of 0.7V equals to an output of 32767. 40000 30000 20000 10000 0 -10000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 -20000 -30000 -40000 Sensor output voltage (V) Figure 8: ZoomingADCTM decimal output versus voltage input The graphic above is shifted to Vout/2 = 0.35V. Therefore, an offset has to be calculated to remove this shift. VinADC = GD1 * GD 2 * GD3 * Vin − (Goff 3 + Goff 2 * GD3) * Vref This formula gives the voltage at the input of the ADC. The offset is given at the input of the acquisition chain. The gain has to be multiplied by the input voltage. Therefore VinADC = 0V because the offset has to be corrected when Vin equals 0.35V Vin * Gain = (Goff 3 + Goff 2 * GD3) * Vref This formula equals Vin * Gain = Goff 3 * Vref with Goff2 = 0 since the offset of the PGA2 is not enabled. Goff 3 = Vin * Gain 0.35V * 4.29 ≅ ≅ 0.5 Vref 3V Goff 3 = 0.5 ⇒ Goff 3 = PGA3 _ off (5 : 0) 12 ⇒ PGA3 _ off = 6 = 0 x06 H 0x06H is the value which has to be written into the “RegACCfg4” register © Semtech 2006 www.semtech.com 11 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.4 Hardware Interface Figure 4 below shows the hardware interface between the MSGS3000 gas sensor and the XE8805/05A microcontroller. The sensor voltage Vs is generated by the digital output PB0. To fulfil the current requirements of the sensors heating element, the DAC output DAC DAB_OUT has to be connected to the amplifier input DAB_A1_P. The amplified DACoutput DAB_A0_M is connected directly to the sensors heating element. The gas sensor output voltage VO is captured by the ZoomingADC™ input AC_A1. XE8805/05A 680kΩ VSS 3 3nF VDDA_1 AC_R0 AC_R1 3 AC_A0 4 MSGS3000 V0 AC_A1 2 VS PB0 1 VH DAB_OUT DAB_A1_P DAB_A0_P 1nF-10nF DAB_A0_M DAB_A1_M DAB_R_P DAB_R_M Figure 9: Hardware Interface between XE8805/05A and MSGS3000 Gas Sensor © Semtech 2006 www.semtech.com 12 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.5 Software description 3.5.1 Mobile sensor system Condition 1 : SendData = TRUE Initialisations Condition 2 : Measure = TRUE Condition 3 : Counter = 5 Condition 1 Yes No Transceiver activation transmission Condition 2 Yes No Gas sensor SendData and data = FALSE Measure = FALSE aquisition SendData = TRUE Measure = FALSE HALT 1 Hz IRQ Counter++ Condition 3 Yes No SendData = FALSE Measure = TRUE SendData = FALSE Measure = FALSE RETI Figure 10: Flowcharts of mobile sensor application © Semtech 2006 www.semtech.com 13 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.5.2 Base System Flowchart Condition 1 : ReceiveData = TRUE Sensing Machine 2 Software Microcontroller Initialisation Condition 1 Yes No Put received Data on UART Figure 11: Flowchart for base system application © Semtech 2006 www.semtech.com 14 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.6 RF Transceiver Interface The RF link is achieved with the Semtech RF transceiver XE1201A. The programming interface between the micro controller and the XE1201A is established via a 3-wire bus. In our case, XE1201A (300–500 MHz band) is used to handle RF link depending on the frequency and on the range one wants to use for RF communication. 3.7 Protocol Description Figure 12 below describes RF frame contents. Preamble (16 to 32 bits) Start word DATA (8 bits) (16 bits) bits(15:8) Stop word (8 bits) bits(7:0) Figure 12: RF Frame contents Preamble is a sequence of “0” and “1” use to synchronise data and clock at transceiver output. Start word defines the beginning of RF transmission. Data 16 bit value from the ZoomingADC™ Stop word defines the end of RF transmission. © Semtech 2006 www.semtech.com 15 Application Note AN8000.11 XE8000 Wireless Gas Sensor 3.8 Hardware Interface 3.8.1 XE1201A - XE8805/05A interface Figure 13 below shows XE1201A pins characteristics. Figure 13: XE1201A pin out and description The XE1201A has separated pins for received data (RXD) and transmitted data (TXD) and a chip enable pin (EN). RXD is connected to PA[0] to wake up the micro-controller when data is received (event generation). CLKD is connected to PA[1] for event generation on each rising edge, of the received clock. © Semtech 2006 www.semtech.com 16 Application Note AN8000.11 XE8000 Wireless Gas Sensor Figure 14 below shows XE1201A – XE8805/05A interface. RF TL VDD B TL A EN RF RF RF OU GN B T D RF A Q0 DE DVDD AVDD TPA TPB XTAL XE1201A AGND SC LO SD GN TK D A IO TK B TK C S W A S W B RX TX XTAL PC[5] DGND PC[2] RXD PA[0] CLKD PA[1] VRTXD EF PC[7] XE8805/05A PC[6] PC[0] PC[1] For more visibility, the power supply is not illustrated Figure 14: XE1201A – XE8805/05A interface Note: RF transceivers need specific design rules. That’s why in this application, we used the RF module XE1201 which is an existing product. These modules respect some RF design rules in order to ensure RF transceiver expected behaviour. You can find a XE1201A reference design on the Semtech web site: http://www.semtech.com © Semtech 2006 www.semtech.com 17 Application Note AN8000.11 XE8000 Wireless Gas Sensor © Semtech 2006 All rights reserved. Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license under patent or other industrial or intellectual property rights. Semtech. assumes no responsibility or liability whatsoever for any failure or unexpected operation resulting from misuse, neglect improper installation, repair or improper handling or unusual physical or electrical stress including, but not limited to, exposure to parameters beyond the specified maximum ratings or operation outside the specified range. SEMTECH PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. INCLUSION OF SEMTECH PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE UNDERTAKEN SOLELY AT THE CUSTOMER’S OWN RISK. Should a customer purchase or use Semtech products for any such unauthorized application, the customer shall indemnify and hold Semtech and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs damages and attorney fees which could arise. Contact Information Semtech Corporation Wireless and Sensing Products Division 200 Flynn Road, Camarillo, CA 93012 Phone (805) 498-2111 Fax : (805) 498-3804 © Semtech 2006 www.semtech.com 18