Introduction

  • In this article, I explain about Heart Beat Pulse checking through the Arduino Mega. It can easily display the wave on a PC monitor.
  • In the PC monitor, it displays the reading of the pulse.
  • The wave form can be displayed in the sine wave form.
Parts Of List:
  • Arduino Mega
  • Easy pulsev1.1 sensor
  • HRM-2511E
  • Hookup wires
  • PC.
Connection:
Step 1: Connection from the Easy pulsev1.1 sensor to Arduino mega.
Figure1: Easy pulsev1.1
  • Connect the Vcc in the Easy pulse v1.1 sensor to the Vcc of the Arduino Mega.
  • Connect the Gnd in the Easy pulse v1.1 sensor to the Gnd of the Arduino Mega.
  • Connect the Ao in the Easy pulse v1.1 sensor to the Ao of the Arduino Mega.
Figure2: connection of HRM-2511E to Easy pulsev1.1
Connect the HRM-2511E and Easy pulsev1.1 in the power cable.
Programming
  1. void setup()
  2. {
  3. Serial.begin(115200);
  4. }
  5. void loop()
  6. {
  7. int sensorValue = analogRead(A0);
  8. Serial.println(sensorValue);
  9. delay_x(5);
  10. }
  11. void delay_x(uint32_t millis_delay)
  12. {
  13. uint16_t micros_now = (uint16_t)micros();
  14. while (millis_delay > 0)
  15. {
  16. if (((uint16_t)micros() - micros_now) >= 1000)
  17. {
  18. millis_delay--;
  19. micros_now += 1000;
  20. }
  21. }
  22. }
  23. void setup()
  24. {
  25. Serial.begin(115200);
  26. }
  27. void loop()
  28. {
  29. int sensorValue = analogRead(A0);
  30. Serial.println(sensorValue);
  31. delay_x(5);
  32. }
  33. void delay_x(uint32_t millis_delay)
  34. {
  35. uint16_t micros_now = (uint16_t)micros();
  36. while (millis_delay > 0)
  37. {
  38. if (((uint16_t)micros() - micros_now) >= 1000)
  39. {
  40. millis_delay--;
  41. micros_now += 1000;
  42. }
  43. }
  44. }
Explanation:
Output:
Figure3:output
Read more articles on Arduino: