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: 11239
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.
Quis custodiet ipsos custodes?

boyoh
Posts: 1526
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: 188
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: 81
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: 923
Joined: Wed Jul 25, 2018 9:29 pm
Location: The 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: 1705
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: 40197
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest 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
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Return to “Beginners”