Carbon evolution from soil


Displays the raw CO2 readings and volumetric soil moisture content
json.data_raw.slice(0,-1)//Define your variables here... 
  var output = {}; 
//Check if the value exists in json 

  //vaiables
  var co2produced = json.co2;

// Convert analog read to volts
  var volts = json.analog_read / 21333

// Volumetric water content in percent
  var VWC = false;

/*
Voltage Range	Equation
0 to 1.1V	VWC= 10*V-1  
1.1V to 1.3V	VWC= 25*V- 17.5
1.3V  to 1.82V	VWC= 48.08*V- 47.5
1.82V to 2.2V	VWC= 26.32*V- 7.89
*/

if(volts <= 1.1)
  VWC = 10 * volts - 1

else if(volts > 1.1 && volts <= 1.3)
  VWC = 25 * volts - 17.5
  
else if(volts > 1.3 && volts <= 1.82)
  VWC = 48.08 * volts -47.5
  
else if(volts > 1.82)
  VWC = 26.32 * volts - 7.89

  
  //Show value and name in output 
  output ["co2produced"] = json.co2;
  output ["volts"] = json.analog_read / 21333
  output["VWC"] = MathROUND(VWC,2);

  //output ["soil moisture content"] = soil_moisture;

  return output;
{
  "time_offset": 240,
  "time": 1429714274793,
  "device_id": 65,
  "firmware_version": "0.400",
  "sample": [
    [
      {
        "time": 1429714274799,
        "protocol_id": 1,
        "temperature": 26.24,
        "co2": 578,
        "relative_humidity": 23.74,
        "data_raw": [

        ]
      }
    ]
  ]
}
Sam 0645   copy   copy  2
Created by

Dan TerAvest


Protocol connections:
5
Latest Update:
Dec 2015