SPARKY49
Posts: 1
Joined: Thu Mar 07, 2019 2:24 am

Choosing a device for analog

Thu Mar 07, 2019 2:35 am

I am interested in making a gear indicator for a bicycle.
The rear derailleur is not visible.
Can the Raspberry pi measure the rate of the pedal and wheel rotation and calculate the chain positioning (assuming that there is no overlap in the ratios)?
It will need to be able to keep track of pulses from two inputs and do maths at the same time.
Thanks for reading.
Cheers!

drgeoff
Posts: 9922
Joined: Wed Jan 25, 2012 6:39 pm

Re: Choosing a device for analog

Thu Mar 07, 2019 9:37 am

Yes a RPI can do that. The hard part will be getting the suitable pulses into the RPi.

boyoh
Posts: 1351
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Choosing a device for analog

Sat Mar 09, 2019 11:03 pm

You could use magnets and reed switches to switch pulses
to the Pi, Fit the magnets on the moving parts . and
Reed switches on fixed parts,
3.3v--------( RS )--------GPIO/IP--------( 10kr )------0v-
RS = Reed switch
10Kr = Pull down Resistor
3.3v Rail
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

JohnsUPS
Posts: 129
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Choosing a device for analog

Sun Mar 10, 2019 9:13 pm

Here are a couple of additional suggestions for obtaining pulses:

Affix a magnet or two to the rotating part (wheel and front sprocket), and locate hall effect sensors so that they switch when the magnet travels by it. Count the pulses of each, and do the math in software.

Affix an optical pickup so that the spokes of the wheel break the beam.

Neither would incur contact bounce.

User avatar
NGC6543
Posts: 75
Joined: Thu Feb 28, 2019 7:30 pm
Location: Lancashire, UK

Re: Choosing a device for analog

Sun Mar 10, 2019 9:40 pm

Is the gear change cable open, and if so (or even if not) might it be simpler to have a linear position sensor on it?

Maybe something like a slider potentiometer with the slider pinned to the cable.

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Choosing a device for analog

Sun Mar 10, 2019 9:49 pm

NGC6543 wrote:
Sun Mar 10, 2019 9:40 pm
Is the gear change cable open, and if so (or even if not) might it be simpler to have a linear position sensor on it?

Maybe something like a slider potentiometer with the slider pinned to the cable.
I would also go for that option. Or inwpuld take a look at the part that you select the gear to see if you can a a potentiometer there. And I would use a microcontroller, arduino, in stead of your Rpi to detect this.

PhatFil
Posts: 1437
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Choosing a device for analog

Sun Mar 10, 2019 10:05 pm

Brandon92 wrote:
Sun Mar 10, 2019 9:49 pm
NGC6543 wrote:
Sun Mar 10, 2019 9:40 pm
Is the gear change cable open, and if so (or even if not) might it be simpler to have a linear position sensor on it?

Maybe something like a slider potentiometer with the slider pinned to the cable.
I would also go for that option. Or inwpuld take a look at the part that you select the gear to see if you can a a potentiometer there. And I would use a microcontroller, arduino, in stead of your Rpi to detect this.

or attach a cable tie to the exposed cable with its tail extending over the top of the bar on which you have numeric stickers ;) again it only works with exposed cables..

User avatar
DougieLawson
Posts: 36557
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Choosing a device for analog

Tue Mar 12, 2019 6:50 am

You're probably best off by sensing the position of the two derailleurs relative to the frame of the bike. If you know the front chain ring teeth number and the rear sprocket teeth number it's easy to calculate the ratio (and a bunch of other numbers).

There's a web page doing that in Javascript at: http://machars.net/bikecalc.htm
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Beginners”