-
Notifications
You must be signed in to change notification settings - Fork 1
Ino Getting Started
In this quick tutorial we will go through one of the PAS CO2 sensor examples available using the Shield2Go or the Miniboard and the XMC microcontroller family in Arduino.
- Experience level: beginner
- Basic computer user level
- Basic programming skills (C/C++)
- Basic soldering skills (recommended)
Name | Picture |
---|---|
PAS CO2 Sensor Shield2Go (Coming soon) | ![]() |
or PAS CO2 Miniboard | ![]() |
XMC 2Go | ![]() |
Pin headers (included with the boards) | |
Micro-USB to USB A cable |
- Windows 10
- Segger J-Link
- Arduino IDE
- XMC-for-Arduino (Installed with Arduino IDE)
- This library (Installed with Arduino IDE)
-
Install Arduino IDE. If you are new to Arduino, please download the program and install it first.
-
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.
-
Install the library. In the Arduino IDE, go to the menu Sketch > Include library > Library Manager. Type pas-co2-sensor and install the library.
For this example we are going to use the I2C serial interface.
If you are using the PAS CO2 Sensor Shield2Go, it just need to be stacked on the XMC 2Go microcontroller board. Be sure that that the corresponding solder jumper are set for I2C mode, and PSEL is pulled to GND. Check the Shield2Go Manual (Coming soon) for complete details.
Then, simply connect it to the computer with the USB cable.
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:

Then, simply connect it to the computer with the USB cable.
Note
With everything ready now, we are going to upload and run one of the library examples.
-
Select the board.
Once installed, you can select the one of the supported board from the menu Tools > Board:... and configure its parameters.
Then we simply need to install the library to use it in your project:
-
Include it in your sketch. With the library installed in the Arduino IDE, you can include it from the menu "Sketch > Include Library > pas-co2-sensor". The header
#include <pas-co2-serial-ino.hpp>
will be added to your sketch. You can also open and test one of the examples provided in File > Examples > pas-co2-sensorOpen one of the examples: File > Examples > pas-co2-sensor > serial-periodic.
After selecting the board (Tools > Board > XMC1100 2Go*), and the proper COM port ( Tools > Port), the example sketch can be verified
and uploaded to the target
.
Finally, we can check the monitor output
. Do not forget to select the proper baudrate. You can blow in the sensor to see how the CO2 values change :)
This is just the start 🚀 !
Find out more about the available API functions in the source code for the Serial API and Pulse API in the header files pas-co2-serial-ino.hpp
and pas-co2-serial.hpp
, and pas-co2-pulse-ino.hpp
and pas-co2-pulse.hpp
files respectively under the src
folder.
The corresponding .cpp
files include Doxygen comments with the description and usage of each function, which is also available in html here.
And of course, don't forget to check out the available Arduino examples under the examples
folder.
2. Library Details
Library Architecture
PAS CO2 Serial API
PAS CO2 Pulse API
PAL Interface
Source Tree Structure
Preprocessor Configuration
Porting Guide
Doxygen Docs
4. Software Frameworks
Arduino
- Getting Started
- Lib Installation
- Ino Examples
- Arduino API
- PlatformIO