









Below is a typical pin configuration for an HRM sensor with analog output:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V to 5V DC) |
| 2 | GND | Ground pin |
| 3 | OUT | Analog output pin providing a voltage proportional to the heart rate signal |
For digital HRM sensors with I2C interface:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V to 5V DC) |
| 2 | GND | Ground pin |
| 3 | SDA | Serial Data Line for I2C communication |
| 4 | SCL | Serial Clock Line for I2C communication |
Connecting the HRM Sensor:
VCC pin to a 3.3V or 5V power source.GND pin to the ground of your circuit.OUT pin to an analog input pin of your microcontroller (e.g., Arduino).VCC and GND pins as described above.SDA and SCL pins to the corresponding I2C pins on your microcontroller.Important Considerations:
Arduino UNO Example Code (for an analog HRM sensor):
// HRM Sensor Example Code for Arduino UNO
// This code reads the analog output of the HRM sensor and calculates the heart rate.
const int hrmPin = A0; // Analog pin connected to the HRM sensor's OUT pin
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(hrmPin, INPUT); // Set the HRM pin as input
}
void loop() {
int sensorValue = analogRead(hrmPin); // Read the analog value from the sensor
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (5V reference)
// Print the raw sensor value and voltage to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.println(voltage);
delay(100); // Delay for 100ms before the next reading
}
No Output Signal:
Inconsistent Readings:
I2C Communication Failure (for digital sensors):
Q: Can I use the HRM sensor with a 3.3V microcontroller?
Q: How do I filter noise from the sensor readings?
Q: Can the HRM sensor measure heart rate through clothing?