Hello Everyone ,
I was using arduino UNO for my project and i have done the following steps to get Groove Gsr sensor & Temperature sensor (LM35) readings,
- Connected GSR Sensors with PIN A0 , Ground , VCC Respectively
- Connected LM35 Temperature sensor to PIN A1 , Ground , VCC Respectively
But i get problem before connecting gsr sensor Readings of temperature sensor is like
27 28 29
Which is correct !
but when i connect GSR Sensors the reading goes from
20 ~ 60
Which is the problem
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
int sec1=-1;
int sec2=0;
int pinTemp = A2;
const int GSR=A1;
int sensorValue=0;
int gsr_average=0;
const int PulseWire = 0; // PulseSensor PURPLE WIRE connected to ANALOG PIN 0
const int LED13 = 13; // The on-board Arduino LED, close to PIN 13.
int Threshold = 550;
PulseSensorPlayground pulseSensor;
void setup(){
Serial.begin(9600);
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13); //auto-magically blink Arduino's LED with heartbeat.
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and "began" seeing a signal.
if (pulseSensor.begin()) {
// Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset.
}
}
void loop(){
// write the latest sample to Serial.
int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".
long sum=0;
for(int i=0;i<10;i++) //Average the 10 measurements to remove the glitch
{
sensorValue=analogRead(GSR);
sum += sensorValue;
delay(0);
}
gsr_average = sum/10;
int temp = analogRead(pinTemp); //Read the analog pin
temp = temp * 0.48828125; // convert output (mv) to readable celcius
delay(500);
if(sec2==0)
{
++sec1;
}
Serial.print("Time Elapsed : ");
Serial.print(sec1);
Serial.print(".");
Serial.print(sec2);
sec2+=5;
if(sec2==10)
{
sec2=0;
}
Serial.print(", GSR: ");
Serial.print(gsr_average);
Serial.print(", BPM: "); // Print phrase "BPM: "
Serial.print(myBPM);
Serial.print(", Temperature: ");
Serial.print(temp);
Serial.println();
}
Note : Please Ignore BPM Codes above