The below video contains a demo and a brief description of the build process:
Hacked an old exercise bike into a wireless gamepad using the ESP32 Microcontroller.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
The below video contains a demo and a brief description of the build process:
Trigger_top.FCStdx-zip-compressed - 134.20 kB - 07/03/2022 at 15:53 |
|
|
Trigger_top.stlStandard Tesselated Geometry - 70.20 kB - 07/03/2022 at 15:53 |
|
|
Trigger_bottom.stlStandard Tesselated Geometry - 6.92 kB - 07/03/2022 at 15:53 |
|
|
Trigger_bottom.FCStdx-zip-compressed - 61.72 kB - 07/03/2022 at 15:53 |
|
|
trigger_button.FCStdx-zip-compressed - 35.08 kB - 07/03/2022 at 15:53 |
|
Note that your exercise bike might be completely different from mine and the procedure might be a bit different but this tutorial should give you a rough idea on how it’s done. These instructions assume that you have basic knowledge on Arduino and electronics.
Here’s a close look of the exercise bike.
I have used the ESP32 microcontroller as it comes with Bluetooth and I wanted to turn my bike into a wireless gamepad,
it is powered using a power bank and there’s an OLED display to show the distance pedalled as the built-in display isn’t working.
The first thing I wanted to do was to figure out how fast I was pedalling. So I took apart the bike’s display and found that there were 2 wires connecting the base of the bike to the bike’s display circuit.
The wire’s are probably connected to a magnetic switch.
I connected these two wires parallel to the ESP32 assuming one was gnd and the other having some type of signal.
I then wrote a program in Arduino IDE to monitor the signal pin and got a square wave when pedaling. You can find the code here: https://ivthdimension.wordpress.com/portfolio/exercise-bike-hacked-into-a-wireless-gamepad/
The faster I pedaled the more pulses I got, note that I had to pull the input HIGH to get a square wave.
Thus we can figure out how fast we pedaled based on the number of pulses obtained in a second.
The distance can be computed by counting the total pulses.
Most exercise bike’s give an approximate distance value, as distance travelled on a bike is based on the bike’s wheel diameter and we do not have a wheel. You can find the code here: https://ivthdimension.wordpress.com/portfolio/exercise-bike-hacked-into-a-wireless-gamepad/
Now we need some buttons to interact with the game.
My exercise bike came with these metal touch pads, they were originally used for the heart rate sensor.
But as the built in display wasn’t working, it isn’t possible to see the heart rate
and so I decided to use them as gamepad buttons.
The ESP32 comes with capacitive touch sensitive GPIO pins, thus we could just hook up the metal touch pad to the specified GPIO pins and monitor if the touch pad is being touched or not.
But unfortunately when I used long parallel wires connecting the Touch pads to the GPIOs, I managed to get accidental presses, probably due to parasitic Capacitance.
Touching one pad would result in two GPIO pins going high.
Although sometimes this did work fine, I couldn’t get it work all the time and there were far too many accidental button presses.
So I decided to use these TTP233 touch modules, although this made the wiring more complex it worked well.
Note that I had to use a ceramic capacitor to adjust the touch sensitivity.
You can find the code here: https://ivthdimension.wordpress.com/portfolio/exercise-bike-hacked-into-a-wireless-gamepad/
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates