Using Envitec O2 sensor

Hello everybody! I have just joined the forums in the process of my first hobby project with an Arduino.

I found this Envitec O2 sensor lying around in a workshop, it is its first time being used, and I have already validated its readings via a multimeter.

It reads 13 to 16mv DC in correspondence to 0-100% Oxygen concentration. I am trying to read its output via an analogue port and the analogue ground, however, I cannot seem to work the range out correctly in the below code. It gives me 61.10mv instead of the multimeter readout of 13.7mv.

Any help would be much appreciated.

void setup()
{
     Serial.begin(9600);
}

void loop()
{
     int sensorValue = analogRead(A0);
  
     float voltage = sensorValue / (0.016 * 1023.0) * 1000;

     Serial.println(voltage);
  
     delay(1000);
}

assuming you are using a UNO (with its poor Analog input process / reference) you have 10 bits (1024 values) to represent 5V --> each step of an analogRead is 5 / 1024 = 4,88mV

You say you want to measure "13 to 16mv" so there is barely 1 step between the 0% value and 100% value... Merge this with the accuracy of the reference (the 5V are really dependent on the stability of your power supply) and float calculation accuracy and I'm not surprised you have a hard time.

I'd say try first to use analogReference(INTERNAL); to go to the internal 1.1V (on a MEGA use INTERNAL1V1) and then just print the value you read from analogRead.

With the reference at 1.1V, each step is only 1,074mV so you'll have a few more steps for your full range...

Ideally you would want to amplify the signal before reading it.