Hi Paul and Paul,
Thanks. Over the weekend I was able to figure out how to download the OLA SW so I could modify it. And I got that up and running. As a debug step I had taken Paulvha code (in zip above) that he had provided me earlier and inserted it into the bottom of the setup() in the Openlog_artemis.ino file. Concept was to independently try to make this code work within the framework as a test (few debugging steps needed code mods, see below, but I tested all this code standalone and sensor was working). I can’t get past the "“Air sensor not detected. Please check wiring. Freezing…”. It just stays there. I also tried this after commenting out the autodetect step, (so code skipped the autodetect step). And this did not affect problem. I also tried doing a power off of the sensor and restart as I saw that in some earlier versions of SCD30 code. Very mysterious…
I will reload the base version of OLA code and select ‘d’ to see what I get. I will also confirm I am at V1.2.1 of Apollo 3. Code I inserted into Setup() below: (sorry it has other mods in it that I was working on but pay attention to setup().
#include “SparkFun_SCD30_Arduino_Library.h” //Click here to get the library: http://librarymanager/All#SparkFun_SCD30
SCD30 airSensor;
//Setup Qwiic Port
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#include <Wire.h>
TwoWire qwiic(1); //Will use pads 8/9
const byte PIN_QWIIC_POWER = 18;
uint32_t qwiicBusPullUps = 1; //Default to 1.5k I2C pull-ups - internal to the Artemis
//Define the pin functions
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//Depends on hardware version. This can be found as a marking on the PCB.
//x04 was the SparkX ‘black’ version.
//v10 was the first red version.
#define HARDWARE_VERSION_MAJOR 1
#define HARDWARE_VERSION_MINOR 0
//void setup()
//{
Serial.begin(115200);
Serial.println(“SCD30 Example”);
// Power up QWIIC interface: needed on OLA board
pinMode(PIN_QWIIC_POWER, OUTPUT);
digitalWrite(PIN_QWIIC_POWER, HIGH);
qwiic.begin();
qwiic.setPullups(qwiicBusPullUps); //Just to make it really clear what pull-ups are being used, set pullups here.
delay(100); // give time for SCD30 to start-up now power has been applied
//The SCD30 has data ready every two seconds
if (airSensor.begin(qwiic) == false)
{
Serial.println(“Air sensor not detected. Please check wiring. Freezing…”);
while (1)
;
}
// Code from Github for setting SCD30 (much commented out, and can be commented in)
//airSensor.setMeasurementInterval(4); //Change number of seconds between measurements: 2 to 1800 (30 minutes)
//Read altitude compensation value
unsigned int altitude = airSensor.getAltitudeCompensation();
Serial.print("Current altitude: ");
Serial.print(altitude);
Serial.println(“m”);
//My desk is ~1600m above sealevel
//airSensor.setAltitudeCompensation(1600); //Set altitude of the sensor in m, stored in non-volatile memory of SCD30
//Pressure in Boulder, CO is 24.65inHg or 834.74mBar
//airSensor.setAmbientPressure(835); //Current ambient pressure in mBar: 700 to 1200, will overwrite altitude compensation
//Read temperature offset
float offset = airSensor.getTemperatureOffset();
Serial.print("Current temp offset: ");
Serial.print(offset, 2);
Serial.println(“C”);
//airSensor.setTemperatureOffset(5); //Optionally we can set temperature offset to 5°C, stored in non-volatile mem of SCD30
// Autoselfcalibration on off
int autocal1 = airSensor.getAutoSelfCalibration();
Serial.print("Autocal = ");
Serial.print(autocal1);
Serial.println(“”);
//airsensor.setAutoSelfCalibration(1); set to on or off
// bool setForcedRecalibrationFactor(uint16_t concentration);
//}
//void loop() {
if (airSensor.dataAvailable())
{
Serial.print(“co2(ppm):”);
Serial.print(airSensor.getCO2());
Serial.print(" temp(C):");
Serial.print(airSensor.getTemperature(), 1);
Serial.print(" humidity(%):");
Serial.print(airSensor.getHumidity(), 1);
Serial.println();
}
else
Serial.println(“Waiting for new data”);
delay(1000);
//}
}