VernierST / arduino

Project sketches using Vernier Sensors with Arduino. The Vernier Library is used where appropriate. Please see VernierLib for additional sketches.
https://www.vernier.com/arduino
Other
28 stars 21 forks source link

VernierLib library not working for NH4-BTA , No3-, k ISE. #9

Closed preity1802 closed 4 years ago

preity1802 commented 4 years ago

Screenshot (45)

The library(VernierLib) provided by Vernier does not work with the ISEs I bought from Vernier. It gives 0.00 output for all the ISEs. Also, when I capture the value from Analog2 port, the values are not stable for High or low-value solutions. Please help!

The attached screenshot is for the type of output when I am reading it from Analog2. It is averaged for 10 consecutive values. It looks the same for both 1 PPM and 100 PPM solutions.

Also, one thing I noticed that for Ammonium ISE, the ISE behaves as -ve linear way, which is just opposite of what is mentioned on the website. Similarly, for nitrate, it behaves in a +ve linearly way but opposite to what is mentioned on the website(-ve linearly).

13-08-2020 17:50 PM: I am attaching the four files having values for 1 PPM and 100 PPM from Nitrate ISE with a simple analog read the program and an analog read program with averaged value. Data is almost similar for both 1 PPM and 100 PPM.

  1. Program with averaging: void setup() {

    Serial.begin(9600); Serial.println("CLEARDATA"); //clears up any data left from previous projects

Serial.println("LABEL,Time,Timer,sensorVoltage"); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)

Serial.println("RESETTIMER"); //resets timer to 0 }

void loop() { float sensorVoltage,sensorReading; // declares a variable named sensorVoltage int numberAveraged = 10; //number of readings averaged for reading reported int i,count; int sum = 0; float voltage;

for (i = 0 ; i < numberAveraged; i++) { count = analogRead(A2); //read 0 to 5 volt analog lines Analog 2 sum = sum + count; } sensorVoltage = ((sum / numberAveraged) * 5.0)/ 1024.0; //convert average count to voltage (0 to 5 volt input) Serial.print("DATA,TIME,TIMER,sensorVoltage"); Serial.println(sensorVoltage); delay(100); // delay in between reads in milliseconds }

  1. Program without averaging: 13-08-2020Nitrate-1 PPM averaged.xlsx 13-08-2020_Nitrate-1 PPM_without averaged.xlsx 13-08-2020Nitrate-100 PPM averaged.xlsx 13-08-2020_Nitrate-100 PPM_without averaged.xlsx

void setup() { Serial.begin(9600); Serial.println("CLEARDATA"); //clears up any data left from previous projects

Serial.println("LABEL,Time,Timer,sensorVoltage"); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)

Serial.println("RESETTIMER"); //resets timer to 0 }

void loop() { float sensorVoltage,sensorReading; // declares a variable named sensorVoltage int sensorValue = analogRead(A2); sensorVoltage = sensorValue * 5.0 / 1023;// Converts the count to the sensor voltage Serial.print("DATA,TIME,TIMER,sensorVoltage"); Serial.println(sensorVoltage); delay(100); // delay in between reads in milliseconds }