Datasheet

5
4. Usage
That requires us to use the analog port of Arduino to take the readings. We have converted the read value
to the corresponding concentration of O2. It's more convenient for you to get a value of O2 directly without
watching the figure.
Notice: Please power the Gas Sensor(O2) more than 48 hrs before you get data from it.
Here is an example of concentration control Buzzer. When Oxygen concentration gets lower than the
minimum safe concentration , the Buzzer will sound.
1. Connect the module to the Analog port 0 of Grove - Basic Shield using the 4-pin grove cable and
connect Buzzer to Pin 3.
2. Plug the Grove - Basic Shield into Arduino. And connect Arduino to PC by using a USB cable.
3. Copy and paste the code below to a new Arduino sketch. Please click here if you do not know how
to upload.
#include <math.h>
const int buzzerPin=3; //Connect the Buzzer Grove module to Pin3, Digital 3
float WarningValue= 19.5; //The minimum sate concentration of O2 in air
void setup()
{
Serial.begin(9600); //Start the Serial connection
}
void loop()
{
//long unsigned a;
float sensorValue;
float sensorVoltage;
float Value_O2;
sensorValue = analogRead(A0);
sensorVoltage =(sensorValue/1024)*5.0;
sensorVoltage = sensorVoltage/201*10000;
Value_O2 = sensorVoltage/7.43;
Serial.print("Concentration of O2 is ");
Serial.print(Value_O2,1);
Serial.println("%");
if(Value_O2<=WarningValue)
{
digitalWrite(3,HIGH);