5
\$\begingroup\$

I would like to mount a bracket onto the head tube of a bike frame to measure the degree of rotation the bike's handlebars have been turned. Ideally, this would be a contactless solution to increase the chance of the bracket fitting correctly.

Two of the options I have researched are:

  • A Hall Effect sensor on the fixed head tube and a magnet on the rotating bike fork
  • Optical sensor on the fixed head tube and encoded object on the rotating bike fork

Before I delve too deep into creating a Hall Effect prototype, does anyone have a better suggestion than the above options or any tips on how to best design this sensor?

Thanks in advance!

EDIT:

@TelaClavo @RocketMagnet Thankyou both of you guys for the detailed answers. I think due to the requirement of mounting the sensor(s)/magnet on the perimeter of the head tube I am more favoured towards TelaClavo's solution. The sensor would be located in a bracket fitting on the front of the head tube, just above the moving ring between the head tube and fork. The magnets attached around the ring.

The assumption I am making now, is that in order to accommodate head tubes of different diameters, a universal bracket can be manufactured to house the PCB components and sensors to fit flush to the head tube in both the sensor and magnets.

\$\endgroup\$
1
  • \$\begingroup\$ Some kind of ratchet wheel which flicks a momentary SPDT switch left or right. (Think: Wheel of Fortune). If you turn left, it clicks left-left-left, and if you turn right, it clicks right-right-right. There could be an extra switch which is flicked when you pass center by a lone peg, causing recalibration. \$\endgroup\$
    – Kaz
    Commented May 16, 2012 at 22:54

4 Answers 4

3
\$\begingroup\$

With a single Hall-effect sensor, if you don't want to deal with the mechanical complexity of having to position your magnet right on the axis of rotation, and the sensor close to it, but steady, and choose to place the magnet in a spot on the perimeter of the rotating tube, and the sensor on the fixed tube, you won't have a very good SNR when the magnet is away from the sensor. I would use a few (three or four) sensors, and one magnet. Create a PCB with the shape of an arc of a circle, and put there the N sensors, concentrically, plus your analog circuitry (if needed), and your MCU (with N ADC channels). Secure the PCB to the fixed tube, and the magnet, to the rotating tube. Reading the N input signals, you'll be able to deduce the angle of the handle bar with more than decent resolution.

Responses to comments: (I don't have enough space there).

  • Rocketmagnet: In the second half of your answer, the AM8192B1 is not a single Hall-effect sensor. It is an IC with many Hall-effect sensors inside. See page 1 of the datasheet: "The AM8192B1 uses Hall sensor technology to detect the magnetic flux density distribution at the surface of the silicon. Hall sensors are placed in a circular array around the center of the IC and deliver a voltage representation of the magnetic field distribution." That's exactly my answer. As far as your comment, you were right, and I've edited my answer.
\$\endgroup\$
2
  • \$\begingroup\$ Normally, your answers are excellent, but this is just wrong. You certainly can tell the angle with a single magnet and single sensor. \$\endgroup\$ Commented May 17, 2012 at 8:23
  • 1
    \$\begingroup\$ @Rocketmagnet See answer to your comment in my text. \$\endgroup\$
    – Telaclavo
    Commented May 17, 2012 at 9:37
4
\$\begingroup\$

My suggestion would definitely be the Hall Effect solution. We use these extensively for rotation measurement, and they work very well. There are two ways to do it:

Ratiometric Hall Effect:

Use a device like the A1324. It's a 3-pin device which gives an analog voltage proportional to the magnetic field strength. For a magnet, you have two options:

  • A diametrically polarised ring magnet mounted on the steering column. The sensor should sit at the circumference of the magnet, facing the centre.
  • An axially polarised button magnet. Mount it on the steering column with its diameter colinear with the rotation axis.

Hall effect sensors

As the steering column rotates, the analog output voltage will vary sinusoidally with angle. Therefore, if you need to know the exact angle, you'll need to calibrate it. Take readings with the handlebars at several known angles. Then create either a piecewise linear function, or find the correct parameters for the perfect inverse sin function. Added: This option only works if we assume that the handle bars don't rotate more than about ±75º, preferably less than that.

Rotary Magnetic Encoder IC

AM8192B1

RLS have several good Hall Effect based rotary sensor chips. You simply place a diametrically polarised button magnet on top of them, and it can tell you the rotation to 13-bit resolution. The AM8192B1 is the highest resolution one. Added: This is the option to choose if you need to measure rotations beyond ±90º degrees.

\$\endgroup\$
4
  • \$\begingroup\$ Suppose your top left figure. Let's define Theta=0 when N points to your sensor. What voltages will the sensor output when Theta= +10º and when Theta= -10º ? \$\endgroup\$
    – Telaclavo
    Commented May 17, 2012 at 9:35
  • 1
    \$\begingroup\$ @Telaclavo - You have this all wrong. You should never let N or S point to the sensor. When the handle bars are straight, the sensor should be half way between N and S. At this point, the sensor will output 2.5v. When the handle bars turn left, the output falls. When the handle bars turn right, the output rises. \$\endgroup\$ Commented May 17, 2012 at 10:05
  • \$\begingroup\$ @Telaclavo - Obviously, this only works for mechanisms which rotate less than about 150º, like handle bars. Preferably no more than 100º for good SNR. \$\endgroup\$ Commented May 17, 2012 at 10:07
  • \$\begingroup\$ You are right. I just couldn't find in the datasheet what's the axis with respect to which the projection of B is measured and outputted. Ok, the axis is perpendicular to the branded surface (man, they should put that in the first page, and not hidden in page 5). And yes, you can tell the sign with a single sensor. However, to do that, you need to place the magnet right on the axis of rotation or otherwise the distance between magnet and sensor will be too long, for many angles. Having the magnet on the axis will make it slightly more cumbersome to hold the sensor steady close to it. \$\endgroup\$
    – Telaclavo
    Commented May 17, 2012 at 11:52
0
\$\begingroup\$

Accelerometer+Gyro for handle bar would probably work. If you add a Hall sensor, it could be compensated for drift very well.

I almost design something like this for a customer but at the end he couldn't find the money and I end up just dreaming it.

\$\endgroup\$
0
\$\begingroup\$

This is an old post, but, if anyone still reads this, it may be useful to consider how the internals of an eBike thumb throttle can be adapted for this application.

Typically, the throttle uses a fixed Hall effect sensor with a moving magnet next to it. The magnet is curved and has N at one end and S at the other. As the thumb moves the magnet past the HES, the voltage typically across Control and Ground increases from maybe +1/2V up to 5V, given 5V is applied across VCC and Ground.

I am making a steering position sensor, and will use this technique. After some time struggling to find a magnet of the correct field config and radius, I decided to try lining up some neodymium magnet 4mm by 4mm cylinders (which I have in stock) in a curved track and connecting them with ball bearings of 2mm dia to ensure continuity of the field. These will be placed fixed around the frame headstock tube and the HES will be fixed to the fork on the brake caliper bolt.

If this sytem works, I will publish a follow up here.

Here's a useful video:

https://www.youtube.com/watch?v=QehDPrRzYIw&t=321s&ab_channel=EngThink

\$\endgroup\$
1
  • \$\begingroup\$ I don't think the ball bearings are necessary. \$\endgroup\$ Commented May 19 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.