arduino programming for heart rate analysing

How did you arrive at the value of 156 used in your original code ?
How is the sensor wired ?
How are the heartbeats turned into a value that the sensor can read ?