50 Bucks USB Bike Controller
I started riding imaginary bikes about a year ago after many years driving imaginary cars.
I was never able to control either adequately using a gamepad so my weapon of choice is a steering wheel attached to my sim rig.
After building my own direct drive wheel base I thought it might be cool to have a bike controller for two wheel sessions. Turns out it is very cool indded and fun too!
Supplies
See the parts list in the first pic. Basically some bike/ebike parts, electronic parts including an Arduino, 49e linear Hall sensors and the "wheel" side quick release to fit my wheelbase.
Add a few cents for 3D print flament and it adds up to roughly 50 eurobucks.
3D Printed Mounts
I designed some 3D printed mounts to attach the handlebars to the quick release in Onshape. These were two parts that clamped snugly around the handlebar and secured together with bolts and nuts.
I also added a thin strip of rubber around the bar to ensure a sug fit. Unfortnatlely there is a bit of slippage and rotation of the bar in the holder.
Likely this could be resolved with a tighter fit and more torque on the bolts but as it was a PLA print I didn't want to put too much pressure. Improvements noted for v2.
Electronics
This involved connecting wires to the sensors and adding dupont connectors to the buttons and throttle which came prewired.
I used dupont connectors on the Arduino side for everthing to make wiring easy to change.
The Hall sensors were inserted into the brake lever housings and held in place with zip ties while magnets were installed on the levers.
I tested these with a multimeter and discover about a 0.8v variation over the range of motion of the magnets.
Code
The code is a pretty simple Arduino firmware that converts sensor values to USB HID gamepad inputs using the Arduino Joystick library.
Once the code was loaded on the Ardiono I was able to test it using the Windows USB gamepad settings dialog.
Downloads
Final Assembly
A mini tupperware container was drilled with holes for cables and attached to the handlebars using the handledbar mounting bolts.
All the wires were then shoved into that along with the Arduino with a hole left for the USB cable to be attached.
Finally I tested the fit on the wheelbase before attaching to my rig.
When the wheelbase is mounted on the rig the handlebars are connected to the PC with a dedicated USB cable.
I set the steering range on my wheelbase to 60 degress which gives a comfortable range of motion while seated at the rig and seems to work well with the games I've tried so far.
Thanks for reading if you've made it this far. Overall this was a pretty easy (compared to the wheelbase at least) and fun project and the controller is great to use. I highly recommend trying it for yourself.