How do I control a PWM fan with my heart rate?

s355

Commendable
Mar 19, 2021
116
0
1,580
It should work like this. The fan is off at 50% heart rate or less. When heart rate is 50% or higher, each 1% my HR increases or decreases, the fan's speed will increase/decrease by 2%. It should be at full speed when my HR is 100%. How do I do the PWM, and how do I turn off the fan with pin 4 when my heart rate is less than 50%? Is this possible with the Alta HR as control input?
 

kanewolf

Titan
Moderator
It should work like this. The fan is off at 50% heart rate or less. When heart rate is 50% or higher, each 1% my HR increases or decreases, the fan's speed will increase/decrease by 2%. It should be at full speed when my HR is 100%. How do I do the PWM, and how do I turn off the fan with pin 4 when my heart rate is less than 50%? Is this possible with the Alta HR as control input?
How do you define percentages of heart rate?
The Alta HR undoubtedly has bluetooth. You would need to write the software to implement what you want.
 

s355

Commendable
Mar 19, 2021
116
0
1,580
How do you define percentages of heart rate?
The Alta HR undoubtedly has bluetooth. You would need to write the software to implement what you want.
It is % of max heart rate, which is 220-age. I can get my Fitbit data from the web API.
 

s355

Commendable
Mar 19, 2021
116
0
1,580
API won't work. It's a direct BT connection. That way, when the internet goes offline, the Pi will still receive signals.
Second one is the wrong Fitbit,
3rd one doesn't collect live data.
 

kanewolf

Titan
Moderator
API won't work. It's a direct BT connection. That way, when the internet goes offline, the Pi will still receive signals.
Second one is the wrong Fitbit,
3rd one doesn't collect live data.
Sorry. I don't have a fitbit.
I guess I don't understand why the API with a bluetooth connection doesn't work. It seems to meet the requirements you identified.
 

Ralston18

Titan
Moderator
@s355

Interesting.

First write the code/script necessary to change the fan speed based on a manually entered heart rate.

Get the fans to respond as per your requirements.

Then work on the necessary code to capture the heart rate via the fitbit and pass the fitbit heart rate to the "fan speed" code.

= = = =

That said, unless there is some definitive correlation between your heart rate, the game you are playing, and the cooling needs of your system, things may not end well.

Cooling requirements are based on what the CPU and GPU are doing. Not how fast your heart is going during game play.

Just my thoughts on the matter.