Table of Contents

Advertisement

ZMOD44xx Programming Manual with ZMOD4410 Example
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
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
Program Flow ......................................................................................................................................................................................4
© 2018 Integrated Device Technology, Inc.
1
June 11, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ZMOD44 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for IDT ZMOD44 Series

  • Page 1: Table Of Contents

    ZMOD44xx Programming Manual with ZMOD4410 Example Contents Introduction ........................................2 Hardware Setup for the ZMOD4410 ................................2 General Program Flow for Setting up ZMOD44xx Gas Measurements ......................3 Description of the Programming Example Code ............................3 main Files ......................................3 Program Flow to Run the Sensor ...............................4 Using the Example on a Different Hardware Platform ..........................5 Adaptation for the Target System ..............................5 Error Codes ......................................5...
  • Page 2: Hardware Setup For The Zmod4410

    Gas Sensor Family such as the ZMOD4410 Gas Sensor Module for TVOC and Indoor Air Quality. In addition, this document describes the function of an example code provided as a C file by IDT for the ZMOD4410, which can be operated using its evaluation kit (EVK). The ZMOD4410 is designed for the 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).
  • Page 3: General Program Flow For Setting Up Zmod44Xx Gas Measurements

    The “Target Specific I2C and Low-Level Functions” block is the hardware-specific implementation of the I2C interface, it contains read and  write functions to communicate with the ZMOD44xx. If the IDT EVK is used, files for the Hi Com Communication Board are provided with this manual. Custom microcontrollers can be used to establish I2C communication.
  • Page 4: Program Flow To Run The Sensor

    ZMOD44xx Programming Manual with ZMOD4410 Example 4.2 Program Flow to Run the Sensor Refer to the example code for more details. Table 1. Program Flow Note: In the following table, lines that are shaded blue can be run in an endless loop with polling or interrupt usage. Line Program Actions Notes...
  • Page 5: Using The Example On A Different Hardware Platform

    The type definitions of the function pointers can be found in zmod44xx_types.h (see Figure 2). The functions read and write should point to the I2C implementation of the hardware used. In addition, IDT provides precompiled algorithm libraries that are hardware-platform dependent. IDT offers a download of these libraries for x86/x64 (Linux/Windows) as well as for ARM and MSP microcontrollers.
  • Page 6: Revision History

    The information contained herein is provided without representation or warranty of a ny kind, whether express or implied, including, but not 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 presented only as a guide and does not convey any license under intellectual property rights of IDT or any third parties.
  • Page 7 ZMOD44xx-API Documentation...
  • Page 8 CONTENTS Contents ZMOD44xx Application Programming Interface Overview Module Index Modules ..........Data Structure Index Data Structures .
  • Page 9 CONTENTS Data Structure Documentation zmod44xx_conf Struct Reference ........6.1.1 Detailed Description .
  • Page 10 CONTENTS 7.2.2 Function Documentation ........7.2.2.1 zmod44xx_init_measurement(zmod44xx_dev_t dev) .
  • Page 11: Zmod44Xx Application Programming Interface Overview

    ZMOD44xx Application Programming Interface Overview This document refers to the IDT document ZMOD44xx Programming Manual with ZMOD4410 Example. The figure below shows an overview of the ZMOD44xx example, API and libraries. The following describes in detail the Application Programming Interface (API) of the ZMOD44xx.
  • Page 12: Module Index

    Module Index Chapter 2 Module Index 2.1 Modules Here is a list of all modules: Gas sensor IDs ..........Error codes .
  • Page 13: Data Structure Index

    Data Structure Index Chapter 3 Data Structure Index 3.1 Data Structures Here are the data structures with brief descriptions: zmod44xx_conf Structure to hold the gas sensor module configuration ..... . zmod44xx_conf_str A single data set for the configuration .
  • Page 14: File Index

    File Index Chapter 4 File Index 4.1 File List Here is a list of all documented files with brief descriptions: zmod44xx.c ZMOD44xx functions ........zmod44xx.h ZMOD44xx functions .
  • Page 15: Module Documentation

    Module Documentation Chapter 5 Module Documentation 5.1 Gas sensor IDs Macros • #define ZMOD4410_PID (0x2310) 5.1.1 Detailed Description The gas sensor product IDs. June 14, 2018 © 2018 Integrated Device Technology, Inc.
  • Page 16: Error Codes

    Module Documentation 5.2 Error codes Macros • #define ERROR_INIT_OUT_OF_RANGE • #define ERROR_GAS_TIMEOUT • #define ERROR_I2C • #define ERROR_SENSOR_UNSUPPORTED • #define ERROR_CONFIG_MISSING • #define ERROR_SENSOR 5.2.1 Detailed Description The gas sensor and API error codes. 5.2.2 Macro Definition Documentation 5.2.2.1 #define ERROR_CONFIG_MISSING (5) There is no pointer to a valid configuration.
  • Page 17: Zmod44Xx_Conf_Str

    Data Structure Documentation Chapter 6 Data Structure Documentation 6.1 zmod44xx_conf Struct Reference Structure to hold the gas sensor module configuration. #include zmod44xx_types.h Data Fields • char name [ZMOD44XX_NAME_LEN] • uint8_t start • zmod44xx_conf_str • zmod44xx_conf_str • zmod44xx_conf_str • zmod44xx_conf_str • zmod44xx_conf_str 6.1.1 Detailed Description Structure to hold the gas sensor module configuration.
  • Page 18: Device Structure Zmod44Xx

    Data Structure Documentation Data Fields • uint8_t addr • uint8_t len • uint8_t data 6.2.1 Detailed Description A single data set for the configuration. The documentation for this struct was generated from the following file: • zmod44xx_types.h 6.3 zmod44xx_dev_t Struct Reference Device structure ZMOD44xx.
  • Page 19: Delay_Ms

    Data Structure Documentation 6.3.2.2 zmod44xx_delay_ptr_p delay_ms function pointer to delay function 6.3.2.3 uint8_t i2c_addr i2c address of the sensor 6.3.2.4 uint16_t mox_er sensor 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_ptr_t write function pointer to i2c write...
  • Page 20: File Documentation

    File Documentation Chapter 7 File Documentation 7.1 zmod44xx.c File Reference ZMOD44xx functions. #include "zmod44xx.h" Functions • int8_t zmod44xx_read_sensor_info (zmod44xx_dev_t dev) Read sensor parameter. • int8_t zmod44xx_init_sensor (zmod44xx_dev_t dev) Initialize the sensor after power on. • int8_t zmod44xx_init_measurement (zmod44xx_dev_t dev) Initialize the sensor for IAQ, TVOC and eCO2 measurement. •...
  • Page 21: Function Documentation

    File Documentation 7.1.2 Function Documentation 7.1.2.1 int8_t zmod44xx_init_measurement ( zmod44xx_dev_t dev ) Initialize the sensor for IAQ, TVOC and eCO2 measurement. Parameters pointer to the device Returns error code Return values success != 0 error 7.1.2.2 int8_t zmod44xx_init_sensor ( zmod44xx_dev_t dev ) Initialize the sensor after power on.
  • Page 22: Zmod44Xx_Read_Sensor_Info(Zmod44Xx_Dev_T Dev)

    File Documentation Returns error code Return values success != 0 error 7.1.2.4 int8_t zmod44xx_read_sensor_info ( zmod44xx_dev_t dev ) Read sensor parameter. Parameters pointer to the device Returns error code Return values 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 status ) Read the status of the device.
  • Page 23: Zmod44Xx_Start_Measurement(Zmod44Xx_Dev_T Dev)

    File Documentation Return values success != 0 error 7.1.2.6 int8_t zmod44xx_start_measurement ( zmod44xx_dev_t dev ) Start the measurement. Parameters pointer to the device Returns error code Return values success != 0 error 7.2 zmod44xx.h File Reference ZMOD44xx functions. #include "zmod44xx_config.h" #include "zmod44xx_types.h"...
  • Page 24: Detailed Description

    File Documentation Functions • int8_t zmod44xx_read_sensor_info (zmod44xx_dev_t dev) Read sensor parameter. • int8_t zmod44xx_init_sensor (zmod44xx_dev_t dev) Initialize the sensor after power on. • int8_t zmod44xx_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.
  • Page 25: Zmod44Xx_Init_Sensor(Zmod44Xx_Dev_T Dev)

    File Documentation Return values success != 0 error 7.2.2.2 int8_t zmod44xx_init_sensor ( zmod44xx_dev_t dev ) Initialize the sensor after power on. Parameters pointer to the device Returns error code Return values 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.
  • Page 26: Zmod44Xx_Read_Status(Zmod44Xx_Dev_T Dev, Uint8_T Status)

    File Documentation Parameters pointer to the device Returns error code Return values success != 0 error Note This function must be called once before running other sensor functions. 7.2.2.5 int8_t zmod44xx_read_status ( zmod44xx_dev_t dev, uint8_t status ) Read the status of the device. Parameters pointer to the device in,out...
  • Page 27: Zmod44Xx_Config.h File Reference

    File Documentation Returns error code Return values success != 0 error 7.3 zmod44xx_config.h File Reference ZMOD44xx configuration. #include stdint.h #include "zmod44xx_types.h" 7.3.1 Detailed Description ZMOD44xx configuration. Version 1.0.0 Date 2018-05-25 Author 7.4 zmod44xx_types.h File Reference ZMOD44xx types. #include stdint.h Data Structures •...
  • Page 28: Error_Init_Out_Of_Range

    File Documentation Macros • #define ZMOD4410_PID (0x2310) • #define ZMOD44XX_OK • #define ERROR_INIT_OUT_OF_RANGE • #define ERROR_GAS_TIMEOUT • #define ERROR_I2C • #define ERROR_SENSOR_UNSUPPORTED • #define ERROR_CONFIG_MISSING • #define ERROR_SENSOR • #define ZMOD44XX_NAME_LEN (5) Typedefs • 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 •...
  • Page 29 ZMOD44xx Gas Algorithm Documentation...
  • Page 30 CONTENTS Contents ZMOD44xx Application Programming Interface Overview How to Work with the IDT Gas Algorithm Libraries Data Structure Index Data Structures ..........
  • Page 31 CONTENTS File Documentation eco2.h File Reference ......... 6.1.1 Detailed Description .
  • Page 32 IDT Evalua o n Kit £ zmod44xx_types.h iaq.lib r_cda.h Target Speci ¡ c I2C and r_cda.lib tvoc.h Low-Level Func ¢ o ns tvoc.lib Customer-Speci c Microcontroller Documenta...
  • Page 33 How to Work with the IDT Gas Algorithm Libraries Chapter 2 How to Work with the IDT Gas Algorithm Libraries • Include the intended header file in the user's program for gas sensor module control; for example: #include "r_cda.h" #include "tvoc.h"...
  • Page 34 How to Work with the IDT Gas Algorithm Libraries Example for clean dry air resistance: #include "r_cda.h" main() { float r_cda; float r_mox; // your functionality // r_mox measurement r_cda = r_cda_tracker(r_mox); // your functionality return Example for TVOC: #include "r_cda.h"...
  • Page 35 How to Work with the IDT Gas Algorithm Libraries Example for eCO2: #include "eco2.h" #include "r_cda.h" #include "tvoc.h" #define DELAY # 10 seconds between measurements main() { float r_cda; float r_mox; float tvoc; float eco2; tvoc_params tvoc_par = = 600000, .alpha = 0.7};...
  • Page 36 Data Structure Index Chapter 3 Data Structure Index 3.1 Data Structures Here are the data structures with brief descriptions: eco2_params Parameters to control the eCO2 algorithm ......tvoc_params Parameters to control the TVOC algorithm .
  • Page 37 File Index Chapter 4 File Index 4.1 File List Here is a list of all documented files with brief descriptions: eco2.h This file contains the data structure definition and the function definition for the eCO2 algorithm iaq.h This file contains the IAQ algorithm function definition ..... . r_cda.h This file contains the clean dry air resistance tracker function definition .
  • Page 38 Data Structure Documentation Chapter 5 Data Structure Documentation 5.1 eco2_params Struct Reference Parameters to control the eCO2 algorithm. #include eco2.h Data Fields • 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.
  • Page 39 Data Structure Documentation 5.1.2.3 uint16_t min_co2 lowest possible CO2 value in ppm 5.1.2.4 float open_window_rate rate for fast negative changes 5.1.2.5 float tvoc_to_eco2 how much ppm CO2 are generated per mg/m 3 TVOC The documentation for this struct was generated from the following file: •...
  • Page 40: File Documentation

    File Documentation Chapter 6 File Documentation 6.1 eco2.h File Reference This file contains the data structure definition and the function definition for the eCO2 algorithm. #include math.h #include stdint.h Data Structures • struct eco2_params Parameters to control the eCO2 algorithm. Macros •...
  • Page 41: Detailed Description

    File Documentation 6.1.1 Detailed Description This file contains the data structure definition and the function definition for the eCO2 algorithm. Date 2017-11-08 Author Version 1.1.2 - https://semver.org/ The library contains an algorithm to calculate an estimated CO2 value in ppm from a given TVOC (Total Volatile Organic Compound) value in mg/m 3.
  • Page 42: Iaq.h File Reference

    File Documentation Returns eCO2 value 6.2 iaq.h File Reference This file contains the IAQ algorithm function definition. #include math.h #include stdint.h #include "tvoc.h" Enumerations • enum { VERY_GOOD = 1, GOOD = 2, MEDIUM = 3, POOR = 4, BAD = 5 } IAQ ratings (German Federal Environmental Agency) Functions •...
  • Page 43: R_Cda.h File Reference

    File Documentation Parameters r_mox MOx resistance r_cda clean dry air resistance params TVOC algorithm parameters Returns iaq rating 6.3 r_cda.h File Reference This file contains the clean dry air resistance tracker function definition. #include stdint.h Functions • float r_cda_tracker (float r_mox) tracks r_cda 6.3.1 Detailed Description This file contains the clean dry air resistance tracker function definition.
  • Page 44: Tvoc.h File Reference

    File Documentation Parameters r_mox current MOx resistance Returns new r_cda 6.4 tvoc.h File Reference This file contains the data structure definition and the TVOC algorithm function definition. #include math.h #include stdint.h Data Structures • struct tvoc_params Parameters to control the TVOC algorithm. Functions •...
  • Page 45 File Documentation Parameters r_mox MOx resistance r_cda clean dry air resistance params TVOC algorithm parameters Returns tvoc concentration in mg/m 3 June 14, 2018 © 2018 Integrated Device Technology, Inc.

This manual is also suitable for:

Zmod4410

Table of Contents