Getting Started

In this quick tutorial we will go through one of the XENSIV™ PAS CO2 sensor examples available using the Shield2Go or the Miniboard and the XMC microcontroller family in Arduino.

Required Hardware

Name

Picture

XENSIV™ PAS CO2 Sensor Shield2Go

_images/pas-co2-s2go-front.png

or XENSIV™ PAS CO2 Miniboard

_images/pas-co2-miniboard.png

XMC 2Go

_images/xmc2go.jpg

or XMC1100 Boot Kit

_images/xmc1100-bootkit.jpg

Pin headers (included with the XMC 2Go)

Micro-USB to USB A cable

In case of using the miniboard, the following items are also required:

  • Jumper cables

  • 12V DC power supply

Software Installation

  1. Install Arduino IDE. If you are new to Arduino, please download the program and install it first.

  2. Install XMC Board. The official Arduino boards are already available in the Arduino software, but other third party boards as the Infineon XMC MCU based need to be explicitly included. Follow the instructions in the link to add the XMC board family to Arduino. Do not forget to install as well the JLink software.

  3. Install the library. In the Arduino IDE, go to the menu Sketch > Include library > Library Manager. Type XENSIV PAS CO2 and install the library.

    _images/ard-library-manager.png

Hardware Setup

For this example we are going to use the I2C interface.

A. Shield2Go

_images/shield2go_co2_pinout.png

If you are using the XENSIV™ PAS CO2 Sensor Shield2Go, it is recommended to use a microcontroller which provides a 5V output. In this tutorial, the XMC11000 Boot Kit is used. Connect the shield and the eval kit as in the following wiring diagram:

_images/pas-co2-xmc1100bk-conn-diag.png

Be sure that the corresponding solder jumper are set for I2C mode, and PSEL is pulled to GND. For this example it is not required, but consider connecting the interrupt signal to the pin 2(P1.4) or 3(P0.0) of the XMC1100 Boot Kit for appliations that require interrupts. Check the Shield2Go Manual for complete details.

Then, simply connect the eval kit to the computer with the USB cable.

Warning

Alternatively, the XMC 2Go can be used by stackin the sensor shield on top. But the XMC 2Go V1 does not support 5V signal, as required by the XENSIV™ PAS CO2 Sensor Shield2Go. Thus, if XMC 2Go is used, keep in mind that an additional 5V signal needs to be provided to the 5V pin of the XENSIV™ PAS CO2 Sensor Shield2Go.

B. Miniboard

_images/minieval_co2_pinout.png

In order to use the I2C interface we need to add a 10 Kohm pull-up resistors to the SDA and SCL lines, and a 12VDC voltage needs to be additionally provided to VDD12V pin. Connect the boards as shown in the following diagram:

_images/xmc2go-miniboard-i2c-conn-diag.png

You need to provide a 12V DC signal to for the emitter. Then, simply connect it to the computer with the USB cable.

Note ⚠️ : If the pin headers provided are not press-fit you will need to solder them on the corresponding boards. Otherwise, use your preferred way of connecting the hardware.

Ready To Go!

With everything ready, now we are going to upload and run one of the library examples.

  1. Select the board

    Once installed the XMC board family, you can select one of the supported board from the menu Tools > Board:. Choose the XMC1100 XMC2Go or XMC1100 Boot Kit depending on your hardware setup (Tools > Board > XMC Family > XMC1100 XMC2Go/XMC1100 Boot Kit).

  2. Open the example

    With the library installed in the Arduino IDE, you can include it from the menu Sketch > Include Library > XENSIV PAS CO2. The header #include <pas-co2-ino.hpp> will be added to your sketch. In this case, open and run one of the examples provided in File > Examples > XENSIV PAS CO2.

    Let´s try the continuous mode example: File > Examples > XENSIV PAS CO2 > continuous-mode.

  3. Build and run the example

    Select the proper COM port ( Tools > Port), and then verify ver-but the example and upload it the target upl-but .

    Finally, we can check the monitor output ser-but. Do not forget to select the proper baudrate for the serial terminal. You can blow into the sensor to see how the CO2 values change 😃.

    _images/ard-monitor-example.png

What’s next?

This is just the start 🚀 !

Check out the rest of the available library examples and find out more about the library functions in the API reference section.