Devices & Components
Arduino Uno Rev3
USB-A to Mini-USB Cable
IR transmitter (generic)
IR receiver (generic)
Software & Tools
Arduino IDE
Project description
Code
heart_Beat_sensor_101/code
arduino
this is the code you need to upload to the Arduino board after making the connections.
1// code by YaSh. 2//Heart_Rate_Sensor code. 3 4int reading = 0; 5int reading_final; 6int Heart_rate; 7void setup() 8{ 9 Serial.begin(9600); //Initializing Serial connections. 10 pinMode(A0,INPUT); 11 pinMode(A1,INPUT); 12 13} 14//Taking readings and plotting. 15void loop() 16{ 17 for(int i=0;i<5;i++) //For debugging. 18 { 19 reading = reading + analogRead(A0); 20 //calculating sum of ambient junk readings 5 times so that we can eliminate them afterwards. 21 } 22 reading_final = (reading)/5; // Average junk reading calulated. 23 delay(100); 24 Heart_rate = analogRead(A0)-reading_final; // Final reading value. 25 Serial.println(Heart_rate); //Printing and plotting. 26}
Downloadable files
heart_beat_sensor_101
its the schematic for connecting the IR receiver and emitter to the Arduino.
heart_beat_sensor_101
heart_beat_sensor_101
its the schematic for connecting the IR receiver and emitter to the Arduino.
heart_beat_sensor_101
Comments
Only logged in users can leave comments