Introduction
- In this article, I will explain about connecting the Pulse Sensor with Android App with Arduino Mega2560.
- It can be used to give the correct information in the mobile App.
Parts of lists
- Arduino Mega 2560
- Pulse Sensor
- Bluetooth
- Hook Up wires
- Bread Boards
Pulse Sensor
- It can be used to check the pulse of the body.
- It can be user friendly and can be used by students, artists and developers.
- It can be called the plug-play.
Figure 1 : Pulse Sensor
Connection
Step 1 Connection from Pulse Sensor to Arduino Mega 2560
- They can commonly have three pins.
- The first pin can be connected to the gnd pin of the Arduino Mega 2560.
- The second pin can be connected to the vcc of the 5v of ArduinoMega 2560.
- The third can be connected to the vin of the Analog pin of the Ao of Arduino Mega 2560.
Step 2 Connection From Bluetooth to the Arduino Mega 2560
- Connect the vcc pin to the 5v of the Arduino Mega 2560.
- Connect the gnd pin to the gnd of the Arduino Mega 2560.
- Connect the Tx pin to the RX.
- Connect the RX pin to the TX.
Programming
- int pulsePin = 0;
- int blinkPin = 13;
- int fadePin = 5;
- int fadeRate = 0;
-
-
- volatile int BPM;
- volatile int Signal;
- volatile int IBI = 600;
- volatile boolean Pulse = false;
- volatile boolean QS = false;
-
-
- static boolean serialVisual = true;
-
-
- void setup()
- {
- pinMode(blinkPin, OUTPUT);
- pinMode(fadePin, OUTPUT);
- Serial.begin(115200);
- interruptSetup();
-
- Genotronex.begin(9600);
- Genotronex.println("Bluetooth On please press 1 or 0 blink LED ..");
- pinMode(ledpin, OUTPUT);
- }
-
-
-
- void loop()
- {
-
- serialOutput();
-
- if (QS == true)
- {
-
-
- digitalWrite(blinkPin, HIGH);
- fadeRate = 255;
-
- serialOutputWhenBeatHappens();
- QS = false;
- } else
- {
-
- digitalWrite(blinkPin, LOW);
- }
-
- ledFadeToBeat();
- if (Genotronex.available())
- {
- BluetoothData = Genotronex.read();
- if (BluetoothData == '1')
- {
-
- digitalWrite(ledpin, 1);
- Genotronex.println("LED On D12 ON ! ");
- }
- if (BluetoothData == '0')
- {
-
- digitalWrite(ledpin, 0);
- Genotronex.println("LED On D12 Off ! ");
- }
- }
- delay(20);
- }
Explanation
- In this article, I clearly explained about the Pulse Sensor
- It can be clearly explained in the Bluetooth app.
- When the pulse is low, it cannot blink led
- When the pulse is high, it can blink led.