First things first, while your goal might be to simple measure HR, or perhaps more precisely, to collect series of Interbeat-Intervals (IBI’s), there are multiple ways to do so.
Two common methods are Electrocardiography (ECG), and Photoplethysmography (PPG). In short, ECG measures the electrical activity of the heart, while PPG optically measures blood volume change. Both can be used to derive HR and IBI series, but do so in a different manner, which can have important consequences for your study.