Hey there I am new to these forums and I hope I am not posting in the wrong place. In any case I recently bought an Arduino Uno startup kit. The project I am working on is a salinity detection system. I want my system to detect a voltage difference across a resistor that is in parallel to an open circuit submerged in water (two nails spaced about 1 cm apart). What I would like to be able to do is send the voltage readings to a data processor so that I can graph the voltage change over time as I add fresh water into the salty water. I was going to use an open-source program called Processor to do this, does anyone know if processor will work for this?
Regardless, currently I am experimenting and I dont have a salinity detector yet so instead I am using a photo-resistor. Currently I am reading values into the serial monitor and here is what I need to know.. this value I am seeing.. what is it? Here is my code:
int val = 0; // variable to store value read at analog pin 3
void setup(){
Serial.begin(9600); // set up to pring out text to monitor, baud rate = 9600
pinMode(11,OUTPUT); // declare pin 11 as an output
}
void loop(){
val = analogRead(3); // read analog input pin 3
Serial.println(val); // pring value to serial monitor
// if statement used to control LED
if(val<600){
digitalWrite(11,HIGH);
delay(100);
digitalWrite(11,LOW);
delay(100);
}
}
I have an led setup so that I could tell if the thing was working without understanding the values being printed into the serial monitor. I see that the value increases as the light seen by the pr decreases but as to the actual value that I am seeing I dont know how its calculated. It varies between 500 (full light) and around 700 (no light). Is this value somehow the voltage I am looking for? Or do I need to re-wire my circuit?
Here is my circuit: