ZMOD44xx Programming Manual with ZMOD4410 Example
© 2018 Integrated Device Technology, Inc.
1
June 11, 2018
Contents
1.
Introduction ...................................................................................................................................................................................................2
2.
Hardware Setup for the ZMOD4410 .............................................................................................................................................................2
3.
General Program Flow for Setting up ZMOD44xx Gas Measurements ........................................................................................................3
4.
Description of the Programming Example Code ...........................................................................................................................................3
4.1
main Files ...........................................................................................................................................................................................3
4.2
Program Flow to Run the Sensor .......................................................................................................................................................4
5.
Using the Example on a Different Hardware Platform ..................................................................................................................................5
5.1
Adaptation for the Target System ......................................................................................................................................................5
5.2
Error Codes ........................................................................................................................................................................................5
6.
Revision History ............................................................................................................................................................................................6
List of Figures
Figure 1.
ZMOD4410 Evaluation Kit ...................................................................................................................................................................2
Figure 2.
File Overview for ZMOD44xx Gas Measurements ..............................................................................................................................3
Figure 3.
System Hierarchy ................................................................................................................................................................................5
List of Tables
Table 1.
Program Flow ......................................................................................................................................................................................4
Page 1: ...surements 3 4 Description of the Programming Example Code 3 4 1 main Files 3 4 2 Program Flow to Run the Sensor 4 5 Using the Example on a Different Hardware Platform 5 5 1 Adaptation for the Target S...
Page 2: ...e detection of total volatile organic compounds TVOC and provides an output for an estimated carbon dioxide level eCO2 and a rating for the indoor air quality IAQ Recommendation Read the datasheet for...
Page 3: ...ng Interface API Files zmod44xx c zmod44xx h zmod44xx_types h zmod44xx_config h Programming Example Files Documentation ZMOD44xx_API pdf Libraries Files eco2 h eco2 lib iaq h iaq lib r_cda h r_cda lib...
Page 4: ...atile memory NVM This step is necessary to choose the correct configuration for the sensor zmod44xx_read_sensor_info 3 Initial initialization This function must be called after every startup zmod44xx_...
Page 5: ...Windows as well as for ARM and MSP microcontrollers 5 1 Adaptation for the Target System IDT s ZMOD44xx C API is located between the application and the target hardware Figure 3 System Hierarchy Appl...
Page 6: ...t limited to the suitability of IDT s products for any particular purpose an implied warranty of merchantability or non infringement of the intellectual property rights of others This document is pres...
Page 7: ...ZMOD44xx API Documentation...
Page 8: ...5 Module Documentation 5 5 1 Gas sensor IDs 5 5 1 1 Detailed Description 5 5 2 Error codes 6 5 2 1 Detailed Description 6 5 2 2 Macro Definition Documentation 6 5 2 2 1 ERROR_CONFIG_MISSING 6 5 2 2 2...
Page 9: ...6 3 2 8 write 9 7 File Documentation 10 7 1 zmod44xx c File Reference 10 7 1 1 Detailed Description 10 7 1 2 Function Documentation 11 7 1 2 1 zmod44xx_init_measurement zmod44xx_dev_t dev 11 7 1 2 2 z...
Page 10: ...od44xx_read_sensor_info zmod44xx_dev_t dev 15 7 2 2 5 zmod44xx_read_status zmod44xx_dev_t dev uint8_t status 16 7 2 2 6 zmod44xx_start_measurement zmod44xx_dev_t dev 16 7 3 zmod44xx_config h File Refe...
Page 11: ...Interface API of the ZMOD44xx HiCom Low Level Files Target Speci c I2C Files Applica on Programming Interface API Files zmod44xx c zmod44xx h zmod44xx_types h zmod44xx_con g h Programming Example Fil...
Page 12: ...Module Index 2 Chapter 2 Module Index 2 1 Modules Here is a list of all modules Gas sensor IDs 5 Error codes 6 2018 Integrated Device Technology Inc June 14 2018...
Page 13: ...ere are the data structures with brief descriptions zmod44xx_conf Structure to hold the gas sensor module configuration 7 zmod44xx_conf_str A single data set for the configuration 7 zmod44xx_dev_t Dev...
Page 14: ...is a list of all documented files with brief descriptions zmod44xx c ZMOD44xx functions 10 zmod44xx h ZMOD44xx functions 13 zmod44xx_config h ZMOD44xx configuration 17 zmod44xx_types h ZMOD44xx types...
Page 15: ...Documentation 5 Chapter 5 Module Documentation 5 1 Gas sensor IDs Macros define ZMOD4410_PID 0x2310 5 1 1 Detailed Description The gas sensor product IDs 2018 Integrated Device Technology Inc June 14...
Page 16: ...finition Documentation 5 2 2 1 define ERROR_CONFIG_MISSING 5 There is no pointer to a valid configuration 5 2 2 2 define ERROR_GAS_TIMEOUT 2 The operation took too long 5 2 2 3 define ERROR_I2C 3 Fail...
Page 17: ...start zmod44xx_conf_str h zmod44xx_conf_str d zmod44xx_conf_str m zmod44xx_conf_str s zmod44xx_conf_str r 6 1 1 Detailed Description Structure to hold the gas sensor module configuration The document...
Page 18: ...3 zmod44xx_dev_t Struct Reference Device structure ZMOD44xx include zmod44xx_types h Data Fields uint8_t i2c_addr uint16_t pid uint8_t config 6 uint16_t mox_lr uint16_t mox_er zmod44xx_i2c_ptr_t read...
Page 19: ...sor specific parameter 6 3 2 5 uint16_t mox_lr sensor specific parameter 6 3 2 6 uint16_t pid product id of the sensor 6 3 2 7 zmod44xx_i2c_ptr_t read function pointer to i2c read 6 3 2 8 zmod44xx_i2c...
Page 20: ...x_init_measurement zmod44xx_dev_t dev Initialize the sensor for IAQ TVOC and eCO2 measurement int8_t zmod44xx_start_measurement zmod44xx_dev_t dev Start the measurement int8_t zmod44xx_read_status zmo...
Page 21: ...cess 0 error 7 1 2 2 int8_t zmod44xx_init_sensor zmod44xx_dev_t dev Initialize the sensor after power on Parameters in dev pointer to the device Returns error code Return values 0 success 0 error 7 1...
Page 22: ...evice Returns error code Return values 0 success 0 error Note This function must be called once before running other sensor functions 7 1 2 5 int8_t zmod44xx_read_status zmod44xx_dev_t dev uint8_t sta...
Page 23: ...turn values 0 success 0 error 7 2 zmod44xx h File Reference ZMOD44xx functions include zmod44xx_config h include zmod44xx_types h Macros define ZMOD4410_I2C_ADDRESS 0x32 define ZMOD44XX_ADDR_PID 0x00...
Page 24: ...t the measurement int8_t zmod44xx_read_status zmod44xx_dev_t dev uint8_t status Read the status of the device int8_t zmod44xx_read_rmox zmod44xx_dev_t dev float rmox Read adc values from sensor and ca...
Page 25: ...n values 0 success 0 error 7 2 2 3 int8_t zmod44xx_read_rmox zmod44xx_dev_t dev float rmox Read adc values from sensor and calculate RMOX Parameters in dev pointer to the device in out rmox pointer to...
Page 26: ...t8_t zmod44xx_read_status zmod44xx_dev_t dev uint8_t status Read the status of the device Parameters in dev pointer to the device in out status pointer to the status variable Returns error code Return...
Page 27: ...ription ZMOD44xx configuration Version 1 0 0 Date 2018 05 25 Author IDT 7 4 zmod44xx_types h File Reference ZMOD44xx types include stdint h Data Structures struct zmod44xx_dev_t Device structure ZMOD4...
Page 28: ...edefs typedef int8_t zmod44xx_i2c_ptr_t uint8_t addr uint8_t reg_addr uint8_t data uint8_t len function pointer type for i2c access typedef void zmod44xx_delay_ptr_p uint32_t ms function pointer to ha...
Page 29: ...ZMOD44xx Gas Algorithm Documentation...
Page 30: ...5 Data Structure Documentation 7 5 1 eco2_params Struct Reference 7 5 1 1 Detailed Description 7 5 1 2 Field Documentation 7 5 1 2 1 hot_wine_rate 7 5 1 2 2 max_co2 7 5 1 2 3 min_co2 8 5 1 2 4 open_w...
Page 31: ...10 6 2 iaq h File Reference 11 6 2 1 Detailed Description 11 6 2 2 Function Documentation 11 6 2 2 1 calc_iaq float r_mox float r_cda tvoc_params params 11 6 3 r_cda h File Reference 12 6 3 1 Detailed...
Page 32: ...libraries for clean dry air resistance total volatile organic compounds indoor air quality and estimated carbon dioxide R_CDA TVOC IAQ and eCO2 respectively HiCom Low Level Files Target Speci c I2C F...
Page 33: ...s program for gas sensor module control for example include r_cda h include tvoc h include iaq h include eco2 h Copy the library file into user s project folder Call the intended function in the user...
Page 34: ...float r_mox float tvoc tvoc_params tvoc_par A 600000 alpha 0 7 your functionality r_mox measurement r_cda r_cda_tracker r_mox tvoc calc_tvoc r_mox r_cda tvoc_par your functionality return 0 Example fo...
Page 35: ...t r_mox float tvoc float eco2 tvoc_params tvoc_par A 600000 alpha 0 7 eco2_params eco2_par min_co2 400 max_co2 5000 tvoc_to_eco2 800 0 hot_wine_rate 0 3 open_window_rate 0 05 your functionality r_mox...
Page 36: ...ure Index 3 1 Data Structures Here are the data structures with brief descriptions eco2_params Parameters to control the eCO2 algorithm 7 tvoc_params Parameters to control the TVOC algorithm 8 2018 In...
Page 37: ...ion and the function definition for the eCO2 algorithm 9 iaq h This file contains the IAQ algorithm function definition 11 r_cda h This file contains the clean dry air resistance tracker function defi...
Page 38: ...ields uint16_t min_co2 uint16_t max_co2 float tvoc_to_eco2 float hot_wine_rate float open_window_rate 5 1 1 Detailed Description Parameters to control the eCO2 algorithm 5 1 2 Field Documentation 5 1...
Page 39: ...he following file eco2 h 5 2 tvoc_params Struct Reference Parameters to control the TVOC algorithm include tvoc h Data Fields float A float alpha 5 2 1 Detailed Description Parameters to control the T...
Page 40: ...he eCO2 algorithm include math h include stdint h Data Structures struct eco2_params Parameters to control the eCO2 algorithm Macros define FILTER_TAU 20 0 define CNT_PREV_SAMPLES_TVOC 4 Functions flo...
Page 41: ...r to the Application Note ZMOD4410 Estimating Carbon Dioxide for further information 6 1 2 Macro Definition Documentation 6 1 2 1 define CNT_PREV_SAMPLES_TVOC 4 jump over first x samples 6 1 2 2 defin...
Page 42: ...ion Date 2018 03 23 Author IDT Version 1 0 3 https semver org The library contains an algorithm that calculates the Indoor Air Quality based on the scale introduced from the German Federal Environment...
Page 43: ...tailed Description This file contains the clean dry air resistance tracker function definition Date 2017 08 04 Author IDT Version 1 0 5 https semver org The library contains an algorithm to calculate...
Page 44: ...arams params calculates TVOC from r_mox and r_cda 6 4 1 Detailed Description This file contains the data structure definition and the TVOC algorithm function definition Date 2017 11 07 Author IDT Vers...
Page 45: ...cumentation 14 Parameters in r_mox MOx resistance in r_cda clean dry air resistance in params TVOC algorithm parameters Returns tvoc concentration in mg m 3 2018 Integrated Device Technology Inc June...