-
1Circuit for Temperature using Lm35
-
2Arduino code for lm35
// Script para leer temperatura utilizando un LM35
// Declaracion de variables
float tempC;
int tempPin = 0; // Definimos la entrada en pin A0
void setup()
{
// Abre puerto serial y lo configura a 9600 bps Serial.begin(9600);
}
void loop()
{
// Lee el valor desde el sensor
tempC = analogRead(tempPin);
// Convierte el valor a temperatura
tempC = (5.0 * tempC * 100.0)/1024.0;
// Envia el dato al puerto serial
Serial.print(tempC);
//Serial.print("
grados Celsius\n");// Espera cinco segundo para repetir el loop
delay(5000);
}
-
3Circuit for pulse
-
4Respiratory rate
Using a microphone module measure de respiratory rate first aproximation, you must put the mic. close to nose
float total=0;
// the setup routine runs once when you press reset:
void setup() {
Serial.begin(9600);
}// the loop routine runs over and over again forever:
void loop() {
int array[100]= {0};
int x;
for(int i = 0; i < 100; ++i)
{
array[i]= analogRead(A0);
delay(1);
}for(int i = 0; i < 100; ++i)
{
// Serial.print(array[i]);
total=total+array[i];
}
Serial.println(total/100);
total=0;
}
it makes a average fo 100 measures
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.