No analog output(A0) on Sparkfun Artemis Nano

I am not getting any analog output working on the Sparkfun Artemis Nano.

I also don’t see any information under tools get board info/serial.

Can someone help me.

This is my first Arduino set.

Everything works with an Arduino Uno no working on the Sparkfun Artemis Nano.

// Grove - Gas Sensor(O2) test code
// Note:
// 1. It need about about 5-10 minutes to preheat the sensor
// 2. modify VRefer if needed
 
const float VRefer = 3.3;       // voltage of adc reference
 
const int pinAdc   = A0;
 
void setup() 
{
    // put your setup code here, to run once:
    Serial.begin(9600);
    Serial.println("Grove - Gas Sensor Test Code...");
}
 
void loop() 
{
    // put your main code here, to run repeatedly:
    float Vout =0;
    Serial.print("Vout =");
 
    Vout = readO2Vout();
    Serial.print(Vout);
    Serial.print(" V, Concentration of O2 is ");
    Serial.println(readConcentration());
    delay(500);
}
 
float readO2Vout()
{
    long sum = 0;
    for(int i=0; i<32; i++)
    {
        sum += analogRead(pinAdc);
    }
 
    sum >>= 5;
 
    float MeasuredVout = sum * (VRefer / 1023.0);
    return MeasuredVout;
}
 
float readConcentration()
{
    // Vout samples are with reference to 3.3V
    float MeasuredVout = readO2Vout();
 
    //float Concentration = FmultiMap(MeasuredVout, VoutArray,O2ConArray, 6);
    //when its output voltage is 2.0V,
    float Concentration = MeasuredVout * 0.21 / 2.0;
    float Concentration_Percentage=Concentration*100;
    return Concentration_Percentage;
}

hi

2 errors:

  1. A0 is a pinName and should not be assigned to an int. see article viewtopic.php?f=169&t=57715 for more info.

  2. In setup() you should do pinMode(A0, INPUT);

If I pinMode(A0, INPUT); entered it will be uploaded to the board.

I’m still not getting any signal.

I don’t understand what to enter in the INT line. That shouldn’t have a pin name what you’re told.

If I remove this it doesn’t work either because it gives an error at line “sum += analogRead(pinAdc);”

instead of pinADC use A0: sum += analogRead(A0);

Thank you

Only during the serial monitor the values Vout =3.30 V remain.

As with the INPUT as OUTPUT

Tested with the Arduino UNO, the value is 1.51 V.

This test code comes from https://wiki.seeedstudio.com/Grove-Gas_Sensor-O2/

// Grove - Gas Sensor(O2) test code
// Note:
// 1. It need about about 5-10 minutes to preheat the sensor
// 2. modify VRefer if needed
 
const float VRefer = 3.3;       // voltage of adc reference
 
 
 
void setup() 
{
    // put your setup code here, to run once:
    pinMode(A0, INPUT);
    Serial.begin(9600);
    Serial.println("Grove - Gas Sensor Test Code...");
}
 
void loop() 
{
    // put your main code here, to run repeatedly:
    float Vout =0;
    Serial.print("Vout =");
 
    Vout = readO2Vout();
    Serial.print(Vout);
    Serial.print(" V, Concentration of O2 is ");
    Serial.println(readConcentration());
    delay(500);
}
 
float readO2Vout()
{
    long sum = 0;
    for(int i=0; i<32; i++)
    {
        sum += analogRead(A0);
    }
 
    sum >>= 5;
 
    float MeasuredVout = sum * (VRefer / 1023.0);
    return MeasuredVout;
}
 
float readConcentration()
{
    // Vout samples are with reference to 3.3V
    float MeasuredVout = readO2Vout();
 
    //float Concentration = FmultiMap(MeasuredVout, VoutArray,O2ConArray, 6);
    //when its output voltage is 2.0V,
    float Concentration = MeasuredVout * 0.21 / 2.0;
    float Concentration_Percentage=Concentration*100;
    return Concentration_Percentage;
}

your Vrefer is wrong. The artemis/apollo3 has a reference value of 2 volt. That is the maximum.

Ok thanks I found that.

I am now going to try to calibrate this O2 sensor via the Arduino Uno.

And use the values in the project with the Sparkfun Artemis Nano.

Thanks for your help.