Hello guys,
so I've been working on my capstone for my bachelors. My team and I are implementing several circuits into a field vest used for military / Government officials. My application is two temp sensors which will differentiate between the ambient and the body temp and then will turn on either a cooling or heating system....the other is I have designed an ECG or electrocardio graph (Heart Beat Monitor circuit) I get a good reading on my oscope from the ECG using an IR emitter and detector ...it produces a nice analog ( almost digital looking) sine wave.
so I'm using an Arduino Uno....and as of now I'm interfacing a 16 x 2 LCD ( will later use a 20 x 4) but for now...I'm showing the Body temp: in the the first row of the LCD ( the second temp will be on the 20 x 4)
but I have a BPM: on the display as well....I want to to be able to take the output of the ECG and calcuklate somewhat of an accurate reading of how many geats it would be per minute.
I know it will be like taking 6 High inputs and * 10 to equal a minute....somehow I need to add in a time value for millis() as well...
I have the output of the ECG going into pin 2 digital side of the Arduino....here is my code so far....
so I've been working on my capstone for my bachelors. My team and I are implementing several circuits into a field vest used for military / Government officials. My application is two temp sensors which will differentiate between the ambient and the body temp and then will turn on either a cooling or heating system....the other is I have designed an ECG or electrocardio graph (Heart Beat Monitor circuit) I get a good reading on my oscope from the ECG using an IR emitter and detector ...it produces a nice analog ( almost digital looking) sine wave.
so I'm using an Arduino Uno....and as of now I'm interfacing a 16 x 2 LCD ( will later use a 20 x 4) but for now...I'm showing the Body temp: in the the first row of the LCD ( the second temp will be on the 20 x 4)
but I have a BPM: on the display as well....I want to to be able to take the output of the ECG and calcuklate somewhat of an accurate reading of how many geats it would be per minute.
I know it will be like taking 6 High inputs and * 10 to equal a minute....somehow I need to add in a time value for millis() as well...
I have the output of the ECG going into pin 2 digital side of the Arduino....here is my code so far....
Rich (BB code):
/*
Temperature Sensor, Heart Beat monitor and GPS
*/
#include <LiquidCrystal.h> // include LCD library
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
// initialize the LCD with the numbers of the interface pins from the Arduino
//declare variables
float tempC;
float tempF;
int BPM;
// Analog Inputs for ADC
int tempPin = A0;
// Digital Inputs
int BPMpin = 2;
void setup()
{
pinMode (tempPin, INPUT);
pinMode (BPMpin, INPUT);
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
lcd.print("Initializing....");
lcd.setCursor(0, 1);
lcd.print(".");
delay(1000);
lcd.setCursor(1, 1);
lcd.print(".");
delay(1000);
lcd.setCursor(2, 1);
lcd.print(".");
delay(1000);
lcd.setCursor(3, 1);
lcd.print(".");
delay(1000);
lcd.setCursor(4, 1);
lcd.print(".");
delay(1000);
lcd.setCursor(5, 1);
lcd.print(".");
delay(1000);
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("Welcome To");
delay(2000);
lcd.setCursor(0, 1);
lcd.print("Vital-Ballistics");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Body Temp:");
lcd.setCursor(0, 1);
lcd.print("Heart BPM:");
}
void loop()
{
// print result to lcd display
// Body Temp Calculations to display
tempC = analogRead(tempPin); //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0; //convert analog to temp
tempF = ((tempC*9)/5) + 32; //convert celcius to farenheit
lcd.setCursor(10, 0);
lcd.print(tempC,1);
lcd.print((char)223); // The degrees symbol 0xDF in Hex
lcd.print("F");
//BPM DISPLAY
BPM = digitalRead(BPMpin);
// Calculation will go here!!!!
lcd.setCursor(10, 1);
lcd.print(BPM);
// Blinking Cursor just for looks :)
lcd.setCursor(14,1);
lcd.blink();
delay(1000);
}
Last edited by a moderator: