Wednesday, January 12, 2022

POWER controlled RGB leds for indoor cycling

 Following up on the SMART'ER fan project, I decided to add some lights.

On several occasions, I got fixated by the single LED in the fan, indicating the HR zone, so I though it would be cool to add some RGB LEDs to the pain cave setup (like a Tacx Neo).

This is how it looks like :

Pretty awesome, no??

I now just need to decide on the placement, for now I like the floor lightning, but it can be set anywhere. I am also considering the space within the KICKR climb triangle.

But basically, imagination is the limit here.

What would you need to build one for yourself ? 

Pretty simple ! 

Following on the FAN project, you need the same controller (or another one of them), and same procedure to install things on the PC to program it.

https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/


https://www.aliexpress.com/item/32826540261.html

or preferably the M5Stack one ( slightly more expensive).

https://shop.m5stack.com/products/atom-lite-esp32-development-kit

Then you also need and RGB led strip that uses the ws2812b chip.

(Cheapest and most used).

https://pt.aliexpress.com/item/32682015405.html

You can get any size you want, if it is going on the floor, I recommend the IP67 waterproof one, so sweat is not an issue.


Then you need a 5V source ( power bank, phone charger, whatever), wiring is simple.


Connect 5V to ESP32 and to LED strip power pins.

Connect one GPIO from the ESP32 to the "Data" input of the LED Strip.

(Take note of the GPIO pin number, you are going to need to put that in the code, as well as the number of LEDS in your strip).

and ... DONE !!!


(In the future I might consider connection this to the same controller that is on the FAN, as the ESP32 can connect to multiple bluetooth devices at the same time, but as ESP32 devices are cheap, this way you can put this wherever you like, even on the ceiling or using a ws2812b mirror ball. )


Things to note : You need a powermeter, or power source for this. (You can adjust the code for any other parameter, speed, cadence, heart-rate, but the code is setup for power)

The KICKR'18 and newer support 3 Bluetooth connections at the same time, so no issues there.

You can connect it to the LEDs and to the training app you use. 


Some new powermeters also support 3 connections, otherwise, you will need to use ANT+ to connect to your PC, as BTLE will be taken by the leds.

Or, if you have a powermeter on your bike, connect the LEDs to that, and the trainer to the PC/App.


In the code, I am making sure the connection is to a specific device address, that is because I also have a STRYD pod, and the leds were connecting to it instead of the KICKR, as it also has the power capability.

You need to find the address for your powermeter, you can do a bluetooth search with your phone (or open the wahoo fitness app and search for it, and copy paste to the code).

Another option, is to remove that part of the code and the POWER LED will connect to any available cycling power device.


Details are in the readme file.

https://github.com/pauloserra81/powerleds


No comments:

Post a Comment