SENSORS USING -------------------------------------------------------------------
MQ7 - Carbon monoxide sensor - https://www.sparkfun.com/datasheets/Sen … c/MQ-7.pdf
MQ2 - methane sensor - http://www.seeedstudio.com/depot/datasheet/MQ-2.pdf
DHT11 - temparature sensor - http://www.micro4you.com/files/sensor/DHT11.pdf
pulse sensor - www.pulsesensor.com
and i used arduino uno board for processing
thank you and please help…
CODE------------------------------------------------------------------------------
#include <DHT11.h>
int pin = 4;
DHT11 dht11(pin);
int coPin = A0;
int pulsePin = A1;
int methanePin = A2;
int pulseRate = 0;
int sensorValue = 0;
int tempValue = 0;
int methaneValue = 0;
int coValue = 0;
int blinkPin = 13; // pin to blink led at each beat
int fadePin = 5; // pin to do fancy classy fading blink at each beat
int fadeRate = 0; // used to fade LED on with PWM on fadePin
// these variables are volatile because they are used during the interrupt service routine!
volatile int BPM; // used to hold the pulse rate
volatile int Signal; // holds the incoming raw data
volatile int IBI = 600; // holds the time between beats, must be seeded!
volatile boolean Pulse = false; // true when pulse wave is high, false when it’s low
volatile boolean QS = false; // becomes true when Arduoino finds a beat.
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}
void loop()
{
interruptSetup();
sendDataToProcessing(‘S’, Signal); // send Processing the raw Pulse Sensor data
if (QS == true){ // Quantified Self flag is true when arduino finds a heartbeat
fadeRate = 255; // Set ‘fadeRate’ Variable to 255 to fade LED with pulse
sendDataToProcessing(‘B’,BPM); // send heart rate with a ‘B’ prefix
sendDataToProcessing(‘Q’,IBI); // send time between beats with a ‘Q’ prefix
QS = false; // reset the Quantified Self flag for next time
}
delay(20);
get_co();
get_methane();
get_temp();
delay(2000);
}
void get_co()
{
coValue = analogRead(coPin);
Serial.println(coValue);
}
void get_methane()
{
methaneValue = analogRead(methanePin);
Serial.println(methaneValue);
}
void get_temp()
{
int err;
float temp, humi;
err=dht11.read(humi, temp);
delay(DHT11_RETRY_DELAY); //delay for reread
Serial.println(temp);
Serial.println(humi);
}
void sendDataToProcessing(char symbol, int data ){
// symbol prefix tells Processing what type of data is coming
Serial.println(BPM); // the data to send culminating in a carriage return
}
/////////////// here is my code i think problem is with the code please help. thank you./////////////////