edelans / Heart-Rate-Smart-Fan

Control your fan speed with your heart beat.
GNU General Public License v3.0
15 stars 0 forks source link

Heart-Rate-Smart-Fan

Control your fan speed with your heartbeat. Check this out on YouTube!

full parts illustration

Use case

I created this while setting up a home trainer for bike training in my garage during the lockdown in 2020. One issue with home trainers, unlike biking outdoors, is that you don't get the benefit of the wind generated by your speed that cools you down. So you sweat a lot, and this creates dehydration. Not cool (pun intended).

The solution is to use a fan. But you don't want to start the fan until you are warmed up. And when you are lazy (and focused on your workout) you don't want to have to get up to reach your fan. It's much cooler to have it automated instead!

Parts

pasts illustration

SmartFan

Other equipments of my setup

Wiring

For the dimmer

4 wires between AC Dimmer and ESP32 :

AC dimmer ESP32
VCC 3V3
GND GND
Z-C Pin 4
PWM Pin 23

For the LED

Beware : I realized different implementations of the ESP32 don't have the same pin pattern, so you'd better rely on pin readings rather than blindlessly following a wiring schema on the internet. That's why there is no schema here.

⚠️☠️⚠️ be extra careful while manipulating ⚡ 220v wires ⚡ : make sure the wire is unplug first ! ⚠️☠️⚠️

For the 220V part, I just cut a power extension cord in 2, and wired the "incoming" part to "AC-IN", and the "outgoing" part to "LOAD". I didn't find any indication regarding which wire (phase/neutrol) should go where... So either I got lucky, either it doesn't matter... If you are reading this and you have the answer, please help me !

⚠️☠️⚠️ be extra careful while manipulating ⚡ 220v wires ⚡ : make sure the wire is unplug first ! ⚠️☠️⚠️

Why ESP32

Why driving the fan with heart rate

Speed-based smartFan

Power-based smartFan

Heartrate-based smartFan

➡️ Seems to be the most versatile setup!

Who connects to what

Tablet setup

Apple TV setup

You only have 2 bouetooth connections available to the Apple TV, the workaround is to use the Zwift companion app on your spartphone to proxy all connected devices through a single BT connection to the Apple TV.

That's a lot of conenctions... I can simplify by removing the garmin watch and connecting the HRM directly to the phone/tablet via ANT+.

Inspiration

Thanks a lot to @jmlopezdona and his project for a speed controlled smart fan for paving the way for the present project (Heart rate controlled).

Improvements

Epilogue

In the end, I replaced this with a smartplug and an integration with Google Assistant. When I want to start the fan, I can say "Hey Google, turn on the fan". It's dumber (just 1 fan speed, no automation) but much simpler (form factor, less cables involved), less brittle, and works good enough ¯\(ツ)/¯.

I don't regret building this though, as it was super fun to hack, and I learnt a lot.