Giter VIP home page Giter VIP logo

arduino-pas-co2-sensor's Introduction

XENSIV™ PAS CO2 Sensor Arduino Library

build-check

Arduino library of Infineon's XENSIV™ Photoacoustic Spectroscopy (PAS) CO2 miniaturized sensor.

Supported Sensor Boards

XENSIV™ PAS CO2 Miniboard XENSIV™ PAS CO2 Sensor Shield2Go

Getting started

Find a getting started tutorial based on the XENSIV™ PAS CO2 Shield2Go and the XMC eval boards in this link.

Library installation

Look for XENSIV PAS CO2 in the Arduino library manager.

Other installation alternatives here.

API reference

Discover all the API features and functions in the API reference.

More information

More information can be found in the library docs.

License

See the LICENSE file for more details.

arduino-pas-co2-sensor's People

Contributors

ederjc avatar jaenrig-ifx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arduino-pas-co2-sensor's Issues

Get new values only every 60 seconds

Prerequisites
Can you reproduce the problem reliably?
Yes

Description:
I only get a value transmitted every 60 seconds, even though the period is set to 7 seconds, for example. If interprupts are used, you can see exactly that it is always 60 seconds. Even a reset does not solve the problem.

Steps to Reproduce:

  1. Upload the serial-peridoic Example
  2. Open the Serial Monitor

Expected Result:
Get new value every 7 seconds.

#define PERIODIC_MEAS_INTERVAL_IN_SECONDS 7
err = cotwo.startMeasure(PERIODIC_MEAS_INTERVAL_IN_SECONDS);

Actual Result:
Serial Monitor Result:

11:50:48.714 -> �j�⸮⸮⸮⸮�Υ(⸮⸮⸮o`⸮⸮1ġ�⸮⸮serial initialized
11:50:56.426 -> get co2 error: 7
11:50:56.426 -> co2 ppm value : 0
11:51:03.382 -> get co2 error: 7
11:51:03.428 -> co2 ppm value : 0
11:51:10.397 -> get co2 error: 7
11:51:10.444 -> co2 ppm value : 0
11:51:17.442 -> get co2 error: 7
11:51:17.442 -> co2 ppm value : 0
11:51:24.467 -> co2 ppm value : 2179
11:51:31.434 -> get co2 error: 7
11:51:31.481 -> co2 ppm value : 0
11:51:38.454 -> get co2 error: 7
11:51:38.500 -> co2 ppm value : 0
11:51:45.480 -> get co2 error: 7
11:51:45.480 -> co2 ppm value : 0
11:51:52.457 -> get co2 error: 7
11:51:52.503 -> co2 ppm value : 0
11:51:59.463 -> get co2 error: 7
11:51:59.510 -> co2 ppm value : 0
11:52:06.495 -> get co2 error: 7
11:52:06.542 -> co2 ppm value : 0
11:52:13.527 -> get co2 error: 7
11:52:13.527 -> co2 ppm value : 0
11:52:20.504 -> get co2 error: 7
11:52:20.550 -> co2 ppm value : 0
11:52:27.525 -> co2 ppm value : 2189
11:52:34.552 -> get co2 error: 7
11:52:34.598 -> co2 ppm value : 0
11:52:41.553 -> get co2 error: 7
11:52:41.600 -> co2 ppm value : 0
11:52:48.605 -> get co2 error: 7
11:52:48.605 -> co2 ppm value : 0
11:52:55.575 -> get co2 error: 7
11:52:55.623 -> co2 ppm value : 0
11:53:02.600 -> get co2 error: 7
11:53:02.646 -> co2 ppm value : 0
11:53:09.633 -> get co2 error: 7
11:53:09.633 -> co2 ppm value : 0
11:53:16.610 -> get co2 error: 7
11:53:16.658 -> co2 ppm value : 0
11:53:23.635 -> co2 ppm value : 2191
11:53:30.622 -> get co2 error: 7
11:53:30.669 -> co2 ppm value : 0

Frequency (1/1, 1/50, 1/100):
1/1

Build/Commit:
v2.0.0

Target:
TTGO LoRa32 OLED, EVAL_PASCO2_MINIBOARD

Host OS and Version:
Windows 10

Environment
Arduino IDE 1.8.13

THANKS!

continuous-mode.ino works in Arduino IDE but not in PlatformIO.

Prerequisites

Can you reproduce the problem reliably? Yes.

Did you check current release notes for known issues? Saw nothing about PlatformIO.

If this is not the latest release, have you checked newer releases? PlatformIO updates automatically.

Description:

See title.

Steps to Reproduce:

  1. Copy and paste program into PlatformIO.

  2. Use this platform.ini file:
    [env:esp32dev]
    platform = espressif32
    board = upesy_wroom
    framework = arduino
    monitor_speed = 115200
    lib_ldf_mode = deep+
    lib_deps =
    https://github.com/Infineon/arduino-pas-co2-sensor

  3. Upload to uPesy ESP32 Wroom DevKit.

Expected Result:
co2 ppm value : 500

Actual Result:
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1

Frequency (1/1, 1/50, 1/100):
I2C 100kHz

Build/Commit:

idk

Target:

uPesy ESP32 Wroom DevKit

Host OS and Version:

Windows

Compiler:

idk

Environment

PlatformIO

THANKS!

serial-alarm.ino example shows co2 ppm value as 0 (with error code 7) when sensor is connected to Arduino UNO

Prerequisites

Can you reproduce the problem reliably?
Yes

Description:
Hi ,

I am trying to use the example serial-alarm from arduino-pas-co2-sensor-master library(version 2.0.0). But in serial terminal, getting error code 1 and 7. Attached is the snapshots for your reference. Can you please check and let me know.

Steps to Reproduce:

  1. Arduino uno board is connected PAS-CO2 sensor.
  2. 12 volt and 3.3 v for the sensor is taken from sensor2go kit.
  3. Open the code example serial-alarm.ino available in Arduino\libraries\arduino-pas-co2-sensor-master\examples\serial-alarm.
  4. Modified I2C_FREQ_HZ value 100000 and interrupt_pin to 3 in serial-alarm.ino
  5. Changed the PASCO2_INO_INT macro value to 3 from 0xFF in pas-co2-platf-ino.hpp since we are using Pin #3 for interrupt.
  6. In pas-co2-serial-ino.hpp file and in startMeasure function, the value of alarmTh is modified to 24000 from 0
  7. Run the code example serial-alarm.ino

Expected Result:

A non zero co2 ppm value.

Actual Result:

2

Frequency (1/1, 1/50, 1/100):
100

Build/Commit:

Please specify the release, like 1.4.1. If there is no release, give us the commit for the code you used.
2.0.0

Target:

Arduino uno board

Host OS and Version:

Windows 64 bit

Environment
Arduino ide

THANKS!

setPressRef() doesn't work, getting negative ppm

Prerequisites

Can you reproduce the problem reliably?
yes

Did you check current release notes for known issues?
Where can I find those?

If this is not the latest release, have you checked newer releases?
Using 2.0.0

Description

setPressRef() returns 1; getCO2() returns negative values

Steps to Reproduce

  1. upload example serial-periodic
  2. run it

Expected Result

serial initialized
co2 ppm value : 400
co2 ppm value : 410

Actual Result

serial initialized
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : -3325
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : -3329
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : -3333
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : -3335
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1

Frequency (1/1, 1/50, 1/100)

serial_periodic has

#define PERIODIC_MEAS_INTERVAL_IN_SECONDS  7 

Build/Commit:

Please specify the release, like 1.4.1. If there is no release, give us the commit for the code you used.
2.0.0

Target:

STM32F103 BluePill, PAS CO2 Miniboard

Host OS and Version:

Debian GNU/Linux 11

Compiler:

gcc/10.3.1-2.3

Forced compensation

Hello all,
thank you very much for providing the library.

I am not understanding how with the latest version a calibration is done with a known CO2 concentration (Forced compensation). Can someone explain me how this is done.

Thank you!

Library problem and error happen frequently.

Have you looked for an answer?
Yes

We appreciate you checking the documentation, release notes, or the Developer community before asking. Please tell us where you looked, so we can fill the gap and help the next person too.

Question/Issue:
I had a problem with the library, at this line. When I used continuous-mode example with the original library, it always returns error, so I tried to edit it a little bit. I changed return res; to return res ? 0 : 1; and it worked.
And another problem is there are errors frequently, it usually keeps errors a while before returns values again.
The logs:
The original

serial initialized
initialization error: 1
start measure error: 1
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
get co2 error: 1
co2 ppm value : 0
pressure reference error: 1
get co2 error: 1
co2 ppm value : 0

After my change

serial initialized
co2 ppm value : 1910
co2 ppm value : 1918
co2 ppm value : 1929
co2 ppm value : 1945
co2 ppm value : 1954
co2 ppm value : 1962
co2 ppm value : 1967
co2 ppm value : 1974
co2 ppm value : 1977
co2 ppm value : 1980
co2 ppm value : 1983
co2 ppm value : 1985
co2 ppm value : 1989
co2 ppm value : 1992
co2 ppm value : 2002
co2 ppm value : 2012
co2 ppm value : 2027
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 0
pressure reference error: 1
co2 ppm value : 2077
co2 ppm value : 2075
co2 ppm value : 2072
co2 ppm value : 2075
co2 ppm value : 2074

What can we help you with?

Context

Let us know about your environment, any information that may help us answer correctly the first time. Perhaps: the chip or kit, your host OS, what IDE you're using, the compiler, the debug probe, anything that you think might affect the answer.

Build/Commit:

v3.1.0

Target:

ESP32-WROOM-32UE

Host OS and Version:

Windows

Compiler:

Arduino v2.1.1

Source code:

The continuous-mode example

Where did you expect to find the answer?
I found Adafruit_BusIO library, although they edited library last 3 weeks, but it's about SPI.
So, I don't know why these problems happened.
Hope you find the answer soon.

THANKS!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.