Hi all,
I bought 2 Arduino UNO boards, 2 Seeed Base Shields v2 and 2 of the Grove GSR sensors. When I first got them both about 2 months ago they worked very well. I maybe used them both only 3 - 4 times. Yesterday, I noticed that they stopped registering changes when I inhaled deeply (which it registered before, and that is what they should do). Although I noticed changes in the readings when I moved my fingers, one of the units today stopped registering this as well. Even when I do not have anything in the finger cot sensors, the serial monitor does not show a change to negative values (the other one still shows this though). I've isolated every possible part by swapping each component at a time, using a different computer, different code - and it appears to be the Arduino board itself. That seems really strange to me as I would have thought the finger cot sensors would be the problem, but I am a novice, and not sure why that would be. I have reset the boards with both the reset buttons, changed the voltage switch from 3.3 to 5v, but no changes. I am racking my brains as to why this problem is occurring, and can't find anything on google that pertains to my problem. Any help is greatly appreciated!
I have attached a picture, which I hope helps because I am not sure of how to draw a wiring diagram.
Also, this is the code I am using:
const int GSR = A2;
int threshold = 0;
int sensorValue;
int resistance_voltage;
int conductance_voltage;
void setup() {
long sum = 0; //extended size variable for number storage
Serial.begin(9600); //setting baud rate
for (int i = 0; i < 500; i++) //for loop that adds the sensorValue to sum 500 times
{
sensorValue = analogRead(GSR);
sum += sensorValue;
delay(5);
}
float threshold = 3.32 - (sum / 500 * (5.0 / 1023.0)); //average conductance threshold calculated by subtracting max value by sum divided by 500 multiplied by the converted analog to voltage value
float thresholdMS = threshold * 1000000; //average threshold in micro-Siemens calculated by multipling threshold above by micro-Siemen conversion rate
Serial.print("threshold = ");
Serial.println(threshold);
Serial.print('\n'); //carriage return for easier display
Serial.print("thresholdMS = ");
Serial.println(thresholdMS);
}
void loop() {
int temp; //establishing temp variable
sensorValue = analogRead(GSR); //reading analog sensor value
float resistance_voltage = sensorValue * (5.0 / 1023.0); //conversion arduino analog range to voltage
Serial.print('\n'); //carriage return for easier display
Serial.print('\n'); //carriage return for easier display
float conductance_voltage = 3.32 - resistance_voltage; //subtract the max voltage value from the measured loss to get the amount of electrcity being conducted. Inverting the value so it reads conductance as opposed to resistance.
Serial.print(conductance_voltage); //print the conductance value to serial
Serial.print('\n'); //carriage return for easier display
delay(5); //delay serial prints
}
The code may not be totally right (i.e., some unnecessary things on there), because I needed to remove certain lines so I just got the value (I will need to analyse the data later, and that makes it easier).
