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
6. Revision History ............................................................................................................................................................................................6
Figure 2. File Overview for ZMOD44xx Gas Measurements ..............................................................................................................................3
Figure 3. System Hierarchy ................................................................................................................................................................................5
List of Tables
Table 1. Program Flow ......................................................................................................................................................................................4
The ZMOD44xx Gas Sensor Family is highly configurable in order to meet various application needs. This document describes a general
program flow to set up ZMOD44xx gas sensor modules for gas measurements. The term ZMOD44xx refers to any product in the ZMOD44xx
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).
Recommendation: Read the datasheet for the specific ZMOD44xx product before using this manual.
2. Hardware Setup for the ZMOD4410
To implement the ZMOD44xx sensor with the user’s program, specific hardware is needed. The example below shows the ZMOD4410 EVK,
which consist of three components:
ZMOD44xx HiCom Communication Board
ZMOD4410 Sensor Board (Daughter Board) with the ZMOD4410 Gas Sensor Module
Micro-USB cable
Refer to the ZMOD4410 Evaluation Kit Description for instructions on assembly, connections, and installation of hardware and software.
Figure 1 shows the assembled evaluation kit.
3. General Program Flow for Setting up ZMOD44xx Gas Measurements
To operate the ZMOD44xx in the hardware and use its full functionality, four code blocks are needed as illustrated in Figure 2:
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.
The “Application Programming Interface (API)” block contains the functions needed to work with the ZMOD44xx. A detailed description of
the API can be found in the document: ZMOD44xx_API.pdf.
The “Programming Example” block provides a code example that is used to initialize the ZMOD4410 gas sensor module, operate it at a
constant temperature of 300°C, and display the data for TVOC, IAQ, and eCO2. Further details can be found in section 4 of this
document.
The “Libraries” block contains the functions and data structures needed to calculate eCO2, IAQ, and TVOC. The libraries are described in
more detail in the document ZMOD44xx_gas_lib.pdf.
To avoid naming conflicts, all function names start with the prefix “zmod44xx_” in the ZMOD44xx code. This naming applies to all products
in the ZMOD44xx product family.
Figure 2. File Overview for ZMOD44xx Gas Measurements
HiCom Low Level
Files:
Target Specific I2C
Files:
Application Programming
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
tvoc.h
tvoc.lib
Target Specific I2C and
Low-Level Functions
Documentation:
ZMOD44xx_gas_lib.pdf
IDT Evaluation Kit
Customer-Specific Microcontroller
hicom.c
hicom.h
hicom_i2c.c
hicom_i2c.h
main.c
main.h
4. Description of the Programming Example Code
The following section describes the example code and how to use the ZMOD4410 Gas Sensor Module. In the example, the ZMOD4410 is
initialized and configured for continuous operation at 300°C, and then it displays measured values. The example is intended to work on a
Windows® (trademark of Microsoft, Inc.) computer in combination with the IDT gas sensor EVK. However, the example can be adjusted to
operate on other platforms such as ARM® (trademark of ARM, Ltd.) and Linux® (trademark of Linus Torvalds).
To run the example using the EVK without further configuration, run ZMOD44xx_example.exe, which is included in the kit software.
4.1
main
Files
The main.c / main.h files contain the main program flow.
The TVOC, IAQ, and eCO2 algorithm is configured by setting the parameters according to the TVOC (IAQ, eCO2) library. Then the target
specific initializations are performed. The ZMOD4410 is configured by reading the Final Module Test parameters from the sensor’s nonvolatile
memory (NVM) and initializing it to run continuously at 300 °C.
An endless loop continuously checks the status of the ZMOD4410 and reads its data. The raw data is subsequently processed, and the TVOC,
IAQ, and eCO2 values are calculated. All values are shown in a command line window. To stop the loop, press any key, which releases the
hardware and stops the program.
5. Using the Example on a Different Hardware Platform
To incorporate this programming example into a different hardware platform, it is necessary to set the device’s struct pointers read, write and
delay_ms. 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.
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
Application-Specific Algorithm
Application-Specific ZMOD44xx Configuration
ZMOD44xx API and Libraries
Low-Level I2C Communication
Low-level Hardware Functions
Target Hardware
The low-level I2C functions are implemented in the file hicom_i2c.c (see Figure 2) for the EVK hardware running on a Windows-based computer
and the HiCom Communication Board.
5.2 Error Codes
Most of the API functions return a code to indicate the success of the operation. If no error occurred, the return code is 0. In the event of an
error, a number not equal to zero is returned. The API has predefined symbols ZMOD44XX_ERROR_* for the error codes defined in
zmod44xx_types.h.
DISCLAIMER Integrated Device Technology, Inc. (IDT) and its affiliated companies (herein referred to as “IDT”) reserve the right to modify the products an d/or specifications described herein at any time,
without notice, at IDT's sole discretion. Performance specifications and operatin g parameters of the described products are determined in an independent state and are not guaranteed to perform the same
way when installed in customer products. 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 on ly as a guide and does not
convey any license under intellectual property rights of IDT or any third parties.
IDT's products are not intended for use in applications involving extreme environmental conditions or in life support systems or similar devices where the failure or malfunction of an IDT product can be
reasonably expected to significantly affect the health or safety of users. Anyone using an IDT product in such a manner does so at their own risk, absent an express, written agreement by IDT.
Integrated Device Technology, IDT and the IDT logo are trademarks or registered trademarks of IDT and its subsidiaries in the Unit ed States and other countries. Other trademarks used herein are the
property of IDT or their respective third party owners. For datasheet type definitions and a glossary of common terms, visit www.idt.com/go/glossary. All contents of this document are copyright of Integrated
Device Technology, Inc. All rights reserved.
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.