sparkfun / OpenLog_Artemis

The OpenLog Artemis is an open source datalogger the comes preprogrammed to automatically log IMU, GPS, serial data, and various pressure, humidity, and distance sensors. All without writing a single line of code!
https://www.sparkfun.com/products/15846
Other
86 stars 45 forks source link

SCD30 autodetection has problems #4

Closed nseidle closed 4 years ago

nseidle commented 4 years ago

v1.2 OLA firmware, no MicroSD card, 10Hz output, SCD30 with no SEL connection.

SCD30 is usually autodetected correctly, but not always. It's most repeatable when SCD30 is first inserted/powered by OLA. After power-on, OLA can be reset and correctly IDs SCD30.

nseidle commented 4 years ago

Now replicable using I2C_Detector test sketch.

It turns out the SCD30 wants a lot of time at boot. Boot time is not clearly documented but mentioned in the interface spec as <2s (so not clear at all).

image

By power cycling the SCD30 via MOSFET+software I can get the SCD30 to ack but then fail to begin (register checks fail). This is workable. New code is this:

case ADR_SCD30:
  if (co2Sensor_SCD30.begin(qwiic) == true) //Wire port
    qwiicAvailable.SCD30 = true;
  else
  {
    //Give it 2s to boot and then try again
    delay(2000);
    if (co2Sensor_SCD30.begin(qwiic) == true) //Wire port
      qwiicAvailable.SCD30 = true;
  }
  break;

This code works reliably. Pushing to v13. @jiggermole - please reopen if you continue to have problems.

nseidle commented 4 years ago

Further thoughts. This problem is related to:

jiggermole commented 4 years ago

V1.3 of the firmware did take care of the issue. the SCD30 detect reliably now.

nseidle commented 4 years ago

Excellent! Thanks. Please keep an eye on v14 and future firmware. I need to add the ability to set boot and measurement times for individual sensors.