Table of Contents

How to Build a Pulse Rate Monitor with Quarky

Quarky Pulse Rate Monitor
Example Description
Discover how to create a real-time digital pulse rate monitor using Quarky, an HW827 pulse sensor, and an SSD1306 OLED screen. Learn the fundamentals of I2C communication, analog signal sampling, and block-based coding in PictoBlox’s Upload Mode to track and display live biometric data.

Introduction

Pulse rate monitors and digital displays are essential components found in modern fitness trackers, wearable medical devices, and smart health-monitoring systems, allowing us to keep track of vital signs in real time! Learn how optical heart rate sensing works, how OLED screens render crisp live data, how to interface the HW827 pulse sensor and SSD1306 OLED display with Quarky, and program them with ease in PictoBlox – our blocks-based graphical programming platform with advanced hardware interaction abilities. Once you’re equipped with the basic knowledge of the Advance Sensors extension, I2C communication, and live biometric signal processing, we’ll show you how to detect finger presence, display real-time pulse counts, and build exciting DIY smart health and wearable tech projects using Quarky.

To work in PictoBlox, you’ll first need to download it from HERE.

Ready? Set. Go!

Prerequisites

  • HW827 Pulse Sensor to detect the finger and read the pulse count.
  • OLED Display SSD1306 to display the pulse reading.
  • Quarky as the main controller.
  • PictoBlox to create and run the program.
  • Jumper Wires

How to connect with Quarky

  1. First, open PictoBlox.
  2. Click on the Board tab on the toolbar and select Quarky.Select-Quarky-Board-PictoBlox
  3. Next, click on the Connect button and select the appropriate serial port.
  4. In the top right corner, there is a toggle button named Mode. This button is used to switch between the two working modes of PictoBlox, namely the stage mode and the upload mode.
  5. Switch to Upload mode by toggling this button. You’ll observe some changes in the UI.Switch to Upload Mode

 

Connection Diagram

Connection of Pulse Sensor and OLED Display to QuarkyOLED Display Connection

Connect the OLED Display pins to Quarky as follows:

  1. Connect GND of the OLED Display to GND on Quarky.
  2. Connect VDD/VCC of the OLED Display to V on Quarky.
  3. Connect SCK/SCL of the OLED Display to D1 on Quarky.
  4. Connect SDA of the OLED Display to D2 on Quarky.

Pulse Sensor Connection

Connect the HW827 Pulse Sensor pins to Quarky as follows:

  1. Connect GND of the Pulse Sensor to GND on Quarky.
  2. Connect VCC of the Pulse Sensor to V on Quarky.
  3. Connect Signal/S of the Pulse Sensor to A1 on Quarky.

Note: Refer to the connection diagram for the exact wire placement, pin position, and orientation.

Step-by-Step Block Coding Guide

  1. Go to the Quarky palette and drag the ‘when Quarky starts up’ block into the scripting area.
  2. Click on Add Extension.Select Quarky Advance Sensors from the extension list
  3. Add the ‘initialize OLED display on scl () and sda ()‘ block from the Advance Sensors palette. For the scl, use the Digital pin ‘D1‘ and for sda use Digital Pin ‘D2‘.
  4. Add the ‘initialize pulse sensor on pin ()’ block from the Advance Sensors palette. For the pin use Analog Pin ‘A1‘.Initial Script for Quarky Pulse Rate Monitor
  5. Underneath the ‘initialize pulse sensor on pin ()‘ block, add the ‘forever’ block from the Control palette.
  6. Inside the ‘forever‘ block, add the ‘if () then‘ block from the Control palette.
  7. Inside the if condition, add the ‘Is finger present on pulse sensor?‘ block from the Advance Sensor palette.
  8. Inside the if block, add the ‘display ()’ block from Advance Sensor palette.
  9. Inside the ‘display ()’ block, add the ‘get pulse count’ block from Advance Sensor palette.block script that reads the pulse count
  10. To upload the code, click on the Upload Code button.

Uploading

Output

Pulse sensor output

Conclusion

In this lesson, we learned how to build a digital pulse monitoring system by interfacing an HW827 pulse sensor and an SSD1306 OLED display with Quarky. Using PictoBlox’s Upload mode alongside the Advance Sensors extension, we explored how to configure I2C communication on digital pins D1 and D2 to initialize the OLED screen and read biometric analog signals through pin A1. We programmed real-time conditional logic to detect finger presence and continuously fetch and output the pulse count directly onto the display. With these fundamentals of biometric sensing and external display interfacing mastered, you can now apply this knowledge to design smart health trackers, interactive fitness monitors, and other advanced wearable robotics projects!