void setup() { Serial.begin(9600); } void loop() { float sensor_volt; float RS_gas; // Get value of RS in a GAS float ratio; // Get ratio RS_GAS/RS_air float concentration; int sensorValue = analogRead(A0); sensor_volt=(float)sensorValue/1024*5.0; RS_gas = (5.0-sensor_volt)/sensor_volt; // omit *RL /*-Replace the name "R0" with the value of R0 in the demo of First Test -*/ ratio = RS_gas/0.23; // ratio = RS/R0 concentration = pow(10,((-1.51)*log10(ratio)-0.39));//in mg/L Serial.print("alcohol concentration = "); Serial.println(concentration); Serial.print("mg/L"); Serial.print("\n\n"); delay(1000); }