Creating virtual bicycle trainer

I got basic bicycle trainer for my bike last year. And I wish to create Virtual reality trainer.

I found to use Reed switch and a resistor (which resistance?) to measure the speed of the bike. I also need a way to sense steering and braking. I think I'll use potentiometer for turning and push button somewhere on the handlebars for sensing braking.
I plan on writing a program which would read what the bike is doing. (speed, braking, turning) and then simulate keystrokes with xvkbd or directly with X. My first plan is to race TORCS with my bike.
In the future I would also like to apply a load to the trainer when ridding uphill (If it is possible to get that info from the game). Any idea how?

My questions are:

  • Which resistor to use with reed switch
  • Which reed switch? (normally open or normally closed)
  • Does anybody have any better idea how to sense turning and/or braking?

Hi,

no resistor necessary if you use the internal pull up resistor and connect the reed switch to GND.

Normally open or normally closed does not matter, you can consider this in your software.

Mike

for RPM, use a hall-effect sensor mounted to the fork and a magnet attached to a spoke. No moving parts like in the reed switch and you should find a few sketches for hall-effect sensors already.

for steering, a POT would do the trick but eventually, you might look at using an optical sensor pointing to a printed pattern taped around the handle bar neck. Again, no moving parts and easy attachment.

for braking, I'd consider a POT on the brake calipers so you can use a varying level of braking force instead of on/off braking.

FYI, in the mid 90s I'd put some effort into designing a cyber-gym setup for something like what your are talking about but never moved it out of the design phase. Love the ties into X for game interface control, good one.

@Doug I think I'll stay with reed switch, because I think it will work alright at the bicycle speeds and because I don't know which to buy. And if my local store has the right one.

I might look into using an optical sensor, when my Arduino coding skills will be better. Currently I am at 6 blinking lights level :slight_smile:

POT for braking would be useful, if I found out how to emulate joystick in Linux, but I haven't found out that yet.

thanks

@mike_pa thanks

I have a questions about buttons. For which current and which voltage should the button be? Because I think I'll need more robust buttons than those I see in the sketch examples.