linear hall sensor for brake lever - really easy

curious

1 kW
Joined
Dec 29, 2007
Messages
445
Location
NJ, USA
For proportional regen. Does not require any drilling/dremmeling etc. Uses a ratiometric hall sensor (I used Allegro Micro A1321EUA-T). It has symmetric response around 2.5V so I only get 0-2.5V response in this magnet configuration but I can adjust the controller for that range. Magnet is the rightmost round thingy (left is the pull pin). The pulling frame is steel so the magnet conveniently sticks to it for alignment and can be CA'ed later. If you get 2.5-5V just flip the magnet. I put the sensor on a sticky tape for now but will eventially hotglue it.

There are ways to get the entire range (0-5V) from the ratiometric hall sensor with a single magnet but it is more sensitive to the alignment. It is also possible to mount two magnets (opposite orientation) within a small distance for 0-5V response.
brake_sens.JPG
 
Nicely Done!
 
Nothing special really - just wanted to show that this is super easy to do. My lever has plenty of clearance for 1.5mm magnet thickness but you can get thinner RE magnets if spacing is different.

The way it is currently aligned it gets 0-2.5V for the first ~40% of the lever action. To activate Kelly controller brake/regen switch I will use npn transistor (will also drive a nice blue led on the front panel). I will set up rear brake to engage at ~70% of the travel. Probably not enough to lock the wheel completely but will work as a reasonable backup if regen fails.
 
my bike came OEM with these Tektro ebrakes.

electric.gif


there's a small ring magnet bolted to the lever inside the housing, about the same place where the DIY version is glued.
corresponding external reed switch in the outer housing.
no reason a linear hall sensor couldn't live in there in place of the reed.
i recommend some heatshrink or a fusion tape wrap as the reed cover is a rather thin flimsy piece of plastic considering it's located in a high traffic area.
 
Outstanding work (as usual).

With a NPN transistor, the brake won't engage until you have around .7v output on the sensor. I'd be interested to hear how that works out.

Does the output on the sensor actually go all the way to 0v? Most of them start at around 0.5v.

Does the brake switch input on the Kelly have 5v on it?

Two magnets might work out well to get the full range. They also make unidirectional sensors (like the ones in a typical throttle), but by using the bidirectional sensor, you don't have to worry about lever travel.
 
The reason I did not put a second magnet is that there is not enough space on the pull frame (without modifications). Generally you have to place three of them or have the second one longer than the first one to have something like S_NN arrangement such that max hall output spans entire last 40% of the pull.

The min output of this particular hall sensor is something like 0.3V and the npn switch opens at about 0.7V. So the real analog range is about 0.7-2.5V which is OK for me since Kelly can be adjusted for that range. Additionally alighning single magnet on the outside section of the pull frame is much easier.

Kelly has 5V output for powering hall sensors, although Steven warned against using it for anything else (low current limit). So all my front panel LEDs are driven from 12V. Brake switch transistor drives front panel blue LED and pulls brake switch line on Kelly via diode.

I've only tested electronics separately - I've pulled apart my bike to fix few things but I should be able to test it pretty soon.

Can you point me to a unidirectional linear sensor part ? I may use it in the future.
You can always translate the levels with extra transistor though.
 
Tested it on a bike today. Works great. Much better brake feel than my old cantilever. And stronger too (I use a123 packs so I do not explicitly limit regen current in the controller settings).

The area of potential improvement is adding some exponential to the brake action ether through magnet placement or electronically. Otherwise it progresses to hard regen breaking over too short of a lever action. But do not get me wrong here, it still feels great and natural, just nitpicking here.
(edit) I tweaked brake analog input endpoints in Kelly software and now lever action range is perfect ! (end edit)

As for adjustment of regen/mechanical ranges - I do not see problems here. Rear pads will wear really slow with regen so mechanical action (backup) should not change for a while. Besides tweaking mechanical action on the lever is trivial.
 
hello from the future my ingenious endless sphere posters of the past.

Perhaps could you point me in the direction of a source for the magnets and switches I need to purchase?

I have a 36v ebikekit controller. Made be Infenion.

I'm not to lazy to do my own research. I just know that you know, and by answering me you are answering everyone else that has to know what I need to know!
 
Also if you need 0-5V, then use an opamp with a gain of 2.
 
Back
Top