Це відео не доступне.
Перепрошуємо.
DIY KICKR HEADWIND (HRM CONTROLLED FAN)
Вставка
- Опубліковано 10 чер 2020
- ** IMPORTANT NOTE **
If you connect to the ESP32 to your HRM, you will need to connect via a different way (ANT+) to your other devices (assuming you have ANT+ in your HRM). BLE only allows for one connection.
****
This video will demonstrate how to control your pain cave cooling fan speed with your heart rate monitor. This is not an extensive guide, but more a crude one. Feel free to expand or elaborate on anything that I've done here.
Also let me know what you think in the comments below. Thank you!
Post: www.andrewgrab...
Github: github.com/agr...
Parts:
- ESP32 Dev Board: amzn.to/2XL9cO1
- Jumper Wires: amzn.to/2ATVnn9
- USB Cable: amzn.to/2XFzilo
- 4 Channel Relay: amzn.to/3cGwsAH
- Heart Rate Monitor: amzn.to/3cGx5dx
- High Velocity Fan: amzn.to/2XGqCuU
Guides:
- Installing ESP32 Dev Library in Arduino: • Install the ESP32 Boar...
Thanks:
- Curious T!mo for all the leg work on the BLE codes.
• ESP32 | BLE Client (He...
You just saved me about 300 eur. I was about to buy the Wahoo fan unit this afternoon. Thanks!
EDIT : it works flawless with my 2 cheap Magene BT+Ant+ HR monitors.
Just built this and it works great. You guide was easy to follow even for someone like me with no programming experience. The only things I changed were to use 4 relays. 0 - 115 bpm for no fan but the light for relay 1 tells me the system is working, 115 - 135 is low, 135 - 155 for medium and 155 + for high. In the summer I will make them lower but for now it is too cold as my cave is around 5 Celsius.
Awesome! Glad to hear it. Thanks for watching
Nice project. Thanks. I may get around to it if and when I finish your rocker plate design first. Sensible to have the fan related to HR rather than speed. You wouldn't want to have to put a gillet on when going downhill on your trainer.
Hi Andrew, thank you for a great tutorial . I made it myself and tested it with Polar and Wahoo HR monitors. I didn't have to change UUID in your code, at least for Wahoo and Polar H10, it works for both devices without any issues. Seems like all HR monitors would work with it (whichever will connect first will control the fan). Keep up the good work.
Thanks! That's good to know about the UUID.
I found the same. The UUID seems to be a generic one.
Thanks Andrew, this is great! I know nothing about programming, Arduino or even electronics. But his video (I got the link through the FB Rocker Plate page) makes it simple and clear and I am pretty sure I'll try to build one. I already saw that the components are available locally. Kudos!
I'm glad to hear and thank you! Let me know how it works out for you if you build it.
@@WeRideSouth Ok, now the three relais work well. It took me a while to understand that only the first number of any zone (the one preceding the //) is meaningful. I have two questions. 1) I am not sure about the Bluetooth ID, are they all the same? Your and mine two HRMs have the same ID "0000180d-0000-1000-8000-00805f9b34fb" even though it is followed by a more complex one (e.g.: 6a4e3e10-667b-11e3-949a-0800200c9a66). Should I use the latter to avoid interferences? 2) Would it be possible to define zone 1 (when is less than the entry value) as fan off? (i.e the fan would start only when it reaches Z2) Just curious, I suppose it's simple like switching to relais 4 that is not powered--is that so?
@@nardixbici the UUID should just be the one returned by the test script. As for an "off zone" if you look at line 44-48 on my github code you can see that there is a zone defined for OFF == 0. You could easily change that to less than or equal to a number... say 70 and this would accomplish what you're trying to achieve.
@@WeRideSouth Thanks Andrew. On the UUID, I was asking b/c the Serial monitor shows two IDs: . Maybe the second one is for ANT? I was curious though as the UUID is exactly the same you used. On the off-zone, i was able to re-programme for 4 relais (i.e. 3 zones) as I am not sure what instruction you were referring to (as of now I am sending to the fourth, unpowered relay; I suppose I could send to neverland as well). Which brings me to another question. In the schematic you provide, I see that you use relays 2-3-4, but the connecting wires start from the pins marked 1-2-3: am I seeing things or there is an error in the diagram? Anyway, thanks a lot, even if you do not have time to answe: I am discovering a new world!
Fantastic project, works a treat thanks so much for posting the video, keep up the good work
Thank you for watching!
@@WeRideSouth adding a heat sink to mine to keep the temps down
Thank you so much for this video!!
You can dual connect via Bluetooth to ESP32/fan and other devices (Zwift, etc) by using a HR strap with dual connection. I did not realize that this was possible, as I had an older Tickr strap. New Tickr/TickrX, Garmin HRM Dual, Polar H10 and Verity all seem to have this functionality. Not really sure how it works on the backend. I am using a new Tickr. Same process of identifying the UUID, no other changes. Am able to connect simultaneously via BT to fan and iPad running Zwift without an issue.
This works as well, but I feel like a lot of people aren't going to go out and buy the new Tickr. I'm currently trying to iron out an ANT+ solution. I have some dev boards on the way. I haven't been able to squeeze any reliability out of an RPi Zero and ANT+ dongle setup. The RPi setup also increases the level of effort required to implement .
@@WeRideSouth It happened to work out that I was in the market for a new strap and realized that newer ones have this functionality. What boards are you trying out?
@@mileslamberson3992 NRF52840-DONGLE
and a D52QD2M4IA-A
Great work Andrew, Just trying to get Petr's code to work as do have to reset ESP bit too often. But big thanks 👍
An averaging function would allow the fan to remain in a certain zone longer when HR is fluctuating around the thresholds.
On the ** IMPORTANT NOTE ** above. For the newbies (like me) it really is important to install the ESP Dev Library as per instructions in the linked guide. Without that, the Esp32 Dev Board may not be installed, and the program will not work (it didn't for me until I did that).
Thank you Andrew for the great, easy to follow tutorial. I bought a lasko blower fan today and then came across this video and now I am thinking of doing this. Have you tried this in your lasko blower fan as you mentioned in the video? Is there any way I can also use switch to control the fan when I am not using the HRM. If so what will be the circuit like?
Thanks! Unfortunately I haven't tried my lasko fan specifically, but it should utilize the same principle. You can definitely control the fan the same way. You'd have to put the switch pole on a type of interrupter that would override the switch control when an HRM is detected. Unfortunately I don't have time to work out a circuit for you at this time.
Hi! Just wanted to share an idea I had for this: for the ESP32 power source I used an old usb celphone charger, ripped it apart and connected the 220V pins on the fan wires and the 5V output to the ESP32 (be careful of polarity, check with a multimeter). This way I dont need to have an extra USB cable to power source the ESP32. It's working nicely!
I also oreder a solid state relay to replace the current one, wich will hopefully save a lot of space and make a more compact setup then my actual.
Awesome! Let me know how the solid state relays work out.
@@WeRideSouth it's probably gonna take a while since I ordered from AliExpress but I'll let you know
@@WeRideSouth when are you going to build an home made Sterzo?? 😁
@@luist76 that should actually be pretty simple. I'll add it to the white board. 😁
@@WeRideSouth yeah? That would be just awesome! Please please please please do it! 😁
Slick. Wish the approach worked with ANT+ as I utilize a Garmin Fenix 6 with ANT+ broadcast for HR. Plus this would allow the Fenix to communicate to both the fan and Zwift.
I plan to do something with ANT+ but unfortunately there isn't anything like an ESP32 that I have found since Garmin licenses ANT+. The closest I'll be able to get is to use something like a PiZero with an ANT+ dongle. It's in the works though.
@@WeRideSouth That would be awesome. Utilizing a five-speed fan would be seriously cool. For my pain cave, I mounted the fan on the wall behind me blowing down with a wireless remote. An automatic adjustment based upon HR zones would be incredible. Found a Taotronics 16" wall mount fan at $46.99 on Walmart.
@@WeRideSouth Great job by the way
Hi Andrew,
Thanks for the details. I tried it with Garmin HRM-Pro but had lots of problems because scan can not find the hrm. When i move the esp32 very close to Garmin HRM-Pro, it finally catch it. Connections is disconnected when the distance more than 10/15 cm. I have searched and found some informations about power level. I changed the power level to ESP_PWR_LVL_P9 but it doesn't solve the issue. Do you have any suggestion ?
Sorry, I haven't had any time to look into this. I was thinking about redoing it, but with ANT+ so there is no connectivity per say, just processing of HRM packets.
This is great - have ordered the parts and am cracking on with it.
Have you though about making the Wahoo Kickr Climb functionality with a $20 linear actuator? Seems like the same solution, although getting the gradient data from Zwift or the Kickr might be a challenge?
I have thought about it and people have done it in the Rocker Plate group on facebook. It's a bit more costly tho with all the parts.
Great job! I'm wondering is it gonna work with any Bluetooth heart rate monitor? Or only with Wahoo Tickr?
Yes, it will work with most bluetooth heart rate monitors that follow the GATT spec.
Hey nice project! Can I do this on Vornado DC Series (99 levels of fan speed)?
Thanks! I'm not sure about that one. Likely the Vornado is using something other than motor voltage to change the fan speed if it has 99 levels. Likely this wouldn't work.
Great project! Chapeau!
Would it be possible, to connect to a Wahoo Kickr and read the wattage instead of the HR?
It is very possible.
I cant get it to work with my garmin HRM3-SS (came with a forerunner watch). Is this code only compatible with bluetooth-sensors? thought ANT+ is also a Blutooth'isch protocol
A quick google shoes the garmin HRM3-SS is ANT+ only which is a wireless protocol, but not BLE which this script works. This script does not work for ANT+. Sorry.
@@WeRideSouth thanks. Bought a wahoo Tickr and worked from first second. Thanks so much for your work. Tweaked the code to add a i2c oled. Next step is to delete the relays and use pwm. When it's ready and works some weeks, i'll publish for everyone.
@@steffen_kuellmer Awesome! I look forward to seeing it!
Wow, great work! Unfortunately, I never did anything with an Arduino before. I just did what you are doing in your video and I think the Arduino works fine. I can connect my Forerunners 245 and the INR1, INR2, INR3 lights on the relay switch on and off according to my heart rate zone.
But: The fan does not switch on. I unplugged everything, checked every cable ... can't find any difference from your approach. Any idea what the problem could be? Is it correct to use K2-K4 (and not K1 although we use IN1-IN3)?
Thanks for your help!
Are your relays switching when you change the pin? If not you might have to check how you're powering the relay. There is a jumper that will let you power the switch portion with an external supply. Might be worth checking the documentation of your specific relay.
Very nice! I’m going to try this but with WiFi control and Alexa rather than the heart rate. Don’t want to lose the heart rate connection to zwift. Were you able to fit everything inside the lasko floor fan?
I haven't tried it with the lasko, but I imagine so. There is quite a bit more room than the little fan.
Andy - I am using a outdoor dimmable electric outlet that is connected to SmartThings and therefore now Alexa enabled as well. Do you have any idea how to capture the HRM data for SmartThings or Alexa?
What size leads/wires do I need for the incoming side? I'd assume they are the same size as the fan wires? And guessing we can use small gauged wires on the relay side as it should be stepping down the voltage?
Eg. 1.5mm wires coming from the fan, so all others on the incoming side need to be 1.5mm. All wires from the relay side could be 1mm?
It is recommended to use 12-14 gauge wire for 120 volt. I think it's the same for 240.
Hi Andrew, it's a great job. I made it myself but I have a problem with starting the fan. I hope you can solve it. I connected all wires as you showed at the film but if I run my esp32 the fun suddenly start too. And then, my headwind react very well of changing my zones. Could you explain me what I have to do that the fan will start when it reaches the first zone?
Once you put on the HRM the fan should start on the lowest setting. If you do not want this to happen you can just change up the code to do nothing between 1 BPM and X BPM.
@@WeRideSouth Ok. Now the fan starts when I reach 70 BPM but I need to change the code as when I finish my training the fan doesn't stop if my BPM is under 70. Could you show me where and what I have to add in the code?
@@ala_philip4340 you would have to change the structure of the function starting on line 36 to include something like if hr < 70 turn off pins.
Hi Andrew, my board works and I am able to operate the fan with the HR zones. However, I have a couple of problems: 1) I seem to need to relaunch (compile) the ketches every time I restart; 2) it does not switch off when I unplug the HRM (HR seem to stay at the last displayed one forever). Also, I have a question: do I need to keep the ESP32 connected to the computer or (as I thought) once the programs are loaded this becomes a self-contained equipment (maybe I would need a battery connected via the USB cable?)
It sounds like problem 1 and 2 are related. If you HRM doesn't default to zero when disconnected you'll have to write some code to account for that. Maybe an interval in which the HR stays the same you can turn off. Lastly, you should not have to keep the ESP32 connected. Once the code is uploaded to the board you should be good.
@@WeRideSouth Thanks a lot once again! Indeed it works disconnected from the PC, powered through the USB cable. The not switching off is a minor issue b/c I can unplug the cable to do that. However I have found another issue: If I start the ESSP32 by connecting it to the plug rather than the PC, nothing happens (only the board LED switches on, no action on the relays). But as soon as I plug it into the PC it starts immediately (i.e. action on the relays). Once it has so started, I can transfer the ESP32 from the plus to the PC and vice-versa and it keeps working in either location. Any possible reason for this potential bummer issue?
@@nardixbici That's odd. Once you upload the code to the ESP32 it should run the loop when plugged in. Do you have a button on your ESP board?
@@WeRideSouth Yes I have two buttons, marked BOOT and EN
@@WeRideSouth, I have a similar issue with my Garmin HRM-Tri. As soon as I disconnect, the HR defaults to 71, and sometimes it stays there until it disconnects. But it can also climb by itself to around 90, and then disconnect after a minute or two. So odd. Otherwise, it works great between the 3 zones. Thank you very much for putting this together.
Hi Andrew. I have a problem. I have no idea about programming, but I modified the script a bit. I have set up 3 zones:
// Heart Rate Zones
#define ZONE_1 110 // 100 bpm
#define ZONE_2 120 // 110 bpm
#define ZONE_3 190 // 120 bpm
Additionally, I would like the fan to turn on not when the HRM is connected, but when the heart rate exceeds 99 BPM.
static void notifyCallback(
BLERemoteCharacteristic* pBLERemoteCharacteristic,
uint8_t* pData,
size_t length,
bool isNotify) {
Serial.print(“Heart Rate: “);
Serial.print(pData[1], DEC);
Serial.println(“bpm”);
if(pData[1] == 99) {
for(int i=1; i
@Andrew Grabbs I'm trying to make a compact version of this and was looking for a smaller type of relay and came up with two types of solid state relays: "high-level trigger" and "low-level trigger". Can you tell me wich one to use?
Unfortunately I don't have any experience with either. I would make sure they are rated for wall power whether it be 110 or 220 and also switchable by optical 5v.
@@WeRideSouth yeah that I checked. I think the question is: the channel that triggers the fan is High or Low? In other words, is it the presence of current or the absence that triggers the relay?
@@luist76 in regards to the relay you are wiring for "normally closed" and then you'll trigger the relay to switch typically with high.
@@WeRideSouth I made a few tests with a multimeter and the channel that is supposed to be active is the one with no voltage, i.e. if I'm in zone 1, pin 25 is 0V and pins 26 and 27 are 3,3V. If I'm in zone 2, Pin 25 and 27 0V and pin 26 3,3V and in zone 3 Pin 25 and 26 3,3V and pin 27 0V. I believe this is working because the relay I bought (wich is same as yours) works both ways, depending on the wiring, but regarding SS relays I need to pick the right one, so from what I found I need a low-level trigger relay. I hope this helps anyone having issues with this.
This is brilliant, would love to have access also the the battery service for my HRM has anyone had a crack at getting that to also show?
I'm not sure the HRM broadcasts battery level. I'll dig around in the profile.
I stand corrected. the Battery level characteristic on my TICKR is 00002a19-0000-1000-8000-00805f9b34fb and reads out 0-100 for percent.
@@WeRideSouth I did see that on mine also, but have been unsuccessful in getting it to read (more my skill level than anything I assume)
What would need to be changed in the code if changing the fan based on the cycling speed rather than the HRM?
You'd need to connect to your smart trainer via the ESP32 and decode either the Cycling Power Service or the Fitness Machine Service depending on which your trainer uses. I believe CPS you have to count rotations of the fly wheel and do your own calculation based on wheel size to get speed. FTMS has speed built in.
Modified the program to PWM the fan based on percentage of my minimum and maximum heart rate. Which is auto adjusted and stored in Non volatile memory for each session reboot. ANT+ would be my preferred connectivity , as the issue with BLE is once paired to the esp32 it can't also be paired to Zwift at the same time. I have been researching ANT+ solution and drawn a blank. ESP32 don't have ANT+ capability and there is no plan by Espressif to develop firmware in the future. There are no Arduino solutions. And i have purchased a Particle Xenon which has an ANT+ capable BLE device fitted, but again it is not implemented in firmware. Very frustrating. I think for now the only bodge solution is using an ESp32 in Client mode and another in server mode , connected together via serial TX/RX as a bridge. It's a pity BLE/ANt+ Heart rate straps don't transmit both formats simultaneously (but then why would manufacturers make things complicated to do that?) . There is a suggestion on here that some heart rate straps can connect to more than one BLE devices at the same time. If anyone has found that to be true then please list them here.
Nice write up. I'm playing with a nordic ant+ board now, but I'm not close. The new Wahoo Tickr can do multiple BLE.
Have you got a photo of a fan-cable connection? I'm not so good at electronics. I've got a live cable from the power plug and three wires from the fan (one for each speed), connected in similar box. Should I throw away this box and instead install 4 Channel Relay?
You will have to install a relay if you want to control the fan with the micro controller. I'll take a photo.
@@WeRideSouth I would be grateful for the connections photo
Very cool! Was about to buy the components when I realized the issue of BLE only allowing for one connection. I currently use Zwift on an iPad Pro, and as such don't really want to go down the route of ANT+.
I am completely, 100% new to this sort of project, but I'm curious if it would be feasible to use the Zwift Mobile API to pull HR data? Thoughts?
I'm not aware of the Zwift mobile api, but if they have it then it certainly would be feasible. The only downside would be the the delay (if there is any noticeable delay.)
@@WeRideSouth Thanks for the quick reply! From some cursory Googling, this is what I've come across. I have a fair bit more learning/figure to go before I can make sense of all this.
github.com/Ogadai/zwift-mobile-api
@@mileslamberson3992 Miles, I was reading that as well. It says you have to have a developer account, I reached out to the email to see if they respond, but I'm not sure if you can access the sensor values. I'm investigating :-)
@@WeRideSouth Ah! Gotcha, I was confused by that. Sounds good!
In the past week, I've gone deep down this rabbit hole. I played around with the Mobile API after seeing some folks on Reddit reporting that they were able to pull their own data post GDPR (but not other users). I wasn't able to see my own and kept getting deprecation notices.
I've learned a ton so far, and have now started playing around with Arduino. Any experience using an Arduino microcontroller with ANT (like the NRF52) rather than going the dongle route? I've found the ANT and ANT+ Arduino libraries, now wondering about implementation.
I love that shirt!
The one from Colorado?
Hi Andrew. Is it possible for more than one app on a phone to read a single bluetooth data stream? Or is it that once one app connects, the other loses connectivity. I ask because I'd like to pair both zwift and my own app to the HRM and trainer. Then I'd use my own app to rebroadcast for operation of the fan. However, I have a feeling only one app can tap into the bluetooth data. I understand the 1:1 bluetooth connection disadvantage but I'm not sure if its 1 device to 1 app or 1 device to 1 phone and multiple apps. Thanks!
Hello Roglie! How many devices that connect via BLE to a device really depends on the device. For example TICKR heart rate monitor will only allow 1 BLE connection. App vs Phone vs Connection is all the same. Only one bluetooth connection at any time. Now a trainer for example, KICKR, will allow 3 bluetooth connections at any given time. I hope that helps!
@@WeRideSouth Yeah I think that clarifies it. So I can't have 2 apps on my phone simultaneously connected to one (older) TICKR. Cheers.
@@DangleBerriesPL there is a bit of grey area there. If your phone is making the connection and each app is using the phone established connection, it could possibly work. But if the app itself makes the connection then another app cannot make that connection as well.
Is there a way to do this ANT+ instead of BT?
I have been playing with a raspberry pi zero and an ant+ dongle, but the results haven't been great. There currently isn't a esp32 that supports ant+.
@@WeRideSouth Until an esp32 that supports ANT+ is available, users could use CABLE to Connect ANT+ to BLE. store.npe-inc.com/cable-connect-ant-to-ble/ If I give it a go, this is what I'll use so my HRM can connect to both my Peloton app and the fan controller.
Hi Andrew - am getting a problem - hope you can help? The first difference is that I'm running Arduino on a mac so I get the com post as "/dev/cu.Bluetooth-Incoming-Port". Then I'm getting an error uploading the sketch to the esp32. The error message is "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header". Any thoughts?
I am not too familiar with MAC but I did stumble upon this write up: randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/
Might try holding the boot/flash button while uploading. Let me know if that gets it sorted.
@@WeRideSouth thanks again - the button approach didn’t work so I’ve ordered a capacitor and will see if that works.
Hi there!
Thankx for this, it looks really cool!
I'm having this issue: when I'm in the step of uploading the BLE example (10:48 in your video) I always get the same error "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
" over and over again...
The only thing I have different from you is that my ESP module connects on Port 3...
I checked Baud rate on COM monitor and it's OK.
Can you please help?
Thank you in advance!
I would definitely try a different cable. You might have to try a few to get a good working one.
@@WeRideSouth actually I tried several cables and that's the only one that got the PC to recognise the board. The other ones just got the led light turned on...
Do you recommend any specs for the cable?
Thanks for your quick reply!
@@luist76 I'm not sure of the specs, but I know I've had issues with random cables and had to try a few different ones. I also had to upload the program multiple times due to random failures. It's super finnicky. Also try plugging the cable in and uploading as close to the same time as possible.
@@WeRideSouth ok, I'll try it and let you know if it worked.
Thanks again!
Tried again with 3 more cables, same error...
I'll try in another PC, step by step from the beginning, just in case...
can this still be manually turned off/on if bt is not used?
No you'd have to make a switch bypass to keep it intact.
Great work! I tried it too and my ESP32 keeps resetting when dryswitchng the relays. Did you have to disconnect the JD-VCC and VCC jumper and supply 5V to jd-vcc and 3.3V to vcc? I have te same brand Relay array...
I couldn't resist, got up from my bed and tried it as i wrote it and it works! Jdvcc to 5V, Vcc to 3v3 and no crash!
I forked your repo and tweaked the code, so you can update if you want.. After the hrm disconnects, it reconnects again without the need for reset. Only the hr levels are left for debugging
@@DivisPetr Awesome! I left my jumper setup to VCC to JD-VCC and never had any issues dry switching it.
@@DivisPetr have you posted your revised code somewhere? I have the issue of having to reset.
@@CKD1976 yes, it is forked on my github github.com/czechdude/hrm_fan_control/network/members . I unfortunatelly also have to reset the esp32, when I try to connect my HRstrap, it catches probably some wrong device.
Hey Andrew any chance you can sell a completed components kit?
Unfortunately I cannot at this time.
@@WeRideSouth thanks for the step by step then! I’ve ordered the parts! I’ve never used the other programs for programming the ble part.
@@Jsauce8921 let me know how it works out!
Any way to get this to work with ANT+?
Rory, I was working on an ANT+ version with Raspberry Pi and an ANT+ dongle, but the dongle was unreliable. It could be the specific brand, but I'm looking for a better way.
@@WeRideSouth BT is definitely a better option. Im running an old computrainer.. i may could find a way to hook up to the control module instead.
@@ferory240 The only problem with using BT is that the fan ties up your connection to your HRM. If you don't have a ANT+/BT HRM and an ANT+ dongle, your training application (Zwift, TrainerRoad) won't be able to get your HR stats while you use the fan. I'm still trying to work out an ANT+ solution, I just haven't found a packaged user friendly one that doesn't require extensive linux and programming knowledge.
@@WeRideSouth no way to hardwire to the computrainer device?
@@ferory240 good point. You could figure out how to tap into whatever signal is received by the application (zwift, trainerroad) and then use your computer to transmit a signal to change the speed of the fan.