Hall Sensor Type needed for Ebrakes?

Get all your technical information about electric bikes here.
Post Reply
User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 11 2019 12:16pm

I'd like to add ebrakes to my bike, and thought about adding a magnet to the lever and a hall sensor to the brake lever's base, so if the magnet moves away the ebrake engages.
The CA can use NO or NC as ebrake input, so this should be easy.
But when i tried it with some SS41 i had lying around it didn't show the wanted behaviour. It engages when i move the magnet away from the hall sensor, but it doesn't disengage when i move it back again. I need to switch polarity of the magnet (turn it 180°) and then i switches off again.
So i guess this is the wrong hall sensor for the application?
Can someone tell me please what the right type would be?

User avatar
fechter   100 GW

100 GW
Posts: 13301
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by fechter » Jan 11 2019 1:46pm

A SS41 could work if the magnet is oriented properly. There are several ways this could be done. The face of the SS41 is the axis of the sensor. It will trigger when the magnetic field reaches a certain flux and turn off when the flux is reversed. There is a dead band in the middle and it has hysteresis.

One approach is to mount the magnet "sideways" so that one pole is closer to the sensor normally and the other pole is closer when you pull the lever. This will give the sensor flux in both directions.

Another approach is to mount like a reed switch but have a small piece of magnet behind the sensor in the repelling direction so the sensor sees reverse flux when the main magnet is pulled away. The small magnet needs to be spaced away from the sensor enough for the main magnet to reverse the field.

The simplest approach is to just use a reed switch, which will work with no power.

There must be some other type of hall switch that would work with a single magnet because I have seen them, but I don't know the part number.

Edit:
Here is one that both operates and releases with a positive flux. It should work with a single magnet.
https://www.mouser.com/ProductDetail/Di ... 252bWHl4f0
"One test is worth a thousand opinions"

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 11 2019 4:13pm

Thanks fechter. I used reed switches on my other bike. They were not very precise though.
I was hoping to be able to set the detection voltage of the CA to adjust for small changes of the distance over time or smaller imperfactions of orientation or so. This would not work with a digital on/off like a reed switch or a digital output hall.

User avatar
amberwolf   100 GW

100 GW
Posts: 26014
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by amberwolf » Jan 11 2019 11:11pm

IIRC, the halls in a motor, SS41 type, are a "latching output" that toggles only when the field changes.

Just to be complete, I'll see if I can find my old Fusin kit brake handles that used halls, and post up what's in there, but they're still digital output.


FWIW, I have some throttles here that will be donating their magnets and analog halls to make some brake levers that would work with controllers that have proportional ebraking. If your controller handles that, you could also do that.


Does the CA have an adjustment for the brake input voltage range? I thought it only had that for the throttle?

User avatar
fechter   100 GW

100 GW
Posts: 13301
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by fechter » Jan 12 2019 12:52am

izeman wrote:
Jan 11 2019 4:13pm
Thanks fechter. I used reed switches on my other bike. They were not very precise though.
I was hoping to be able to set the detection voltage of the CA to adjust for small changes of the distance over time or smaller imperfactions of orientation or so. This would not work with a digital on/off like a reed switch or a digital output hall.
Then you might be able to use a linear output hall like one from a throttle. When the magnet is close, it will be at one end of it's range (depending on magnet polarity) and it will be half the supply voltage when there is no magnetic field in the sensor axis.
It might work better to have the magnet axis almost 90 degrees from the sensor axis so the output will vary more with a small movement of the magnet. A picture would be good here as this is hard to explain.

The magnet orientation can also be used to tune a hall switch trigger point.
"One test is worth a thousand opinions"

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 12 2019 4:50am

Great help guys. Thanks. You're absolutely spot on. A throttle hall type would be the correct one. Just need to open one and order some spares on Aliexpress just in case.
Until the shipping arrives I'm sure I'll find some appropriate parts in my "throttle and stuff" box. 8) - i spotted at least 5 spares ...

2019-01-12 at 10.46.20.JPG

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 12 2019 4:56am

amberwolf wrote:
Jan 11 2019 11:11pm
Does the CA have an adjustment for the brake input voltage range? I thought it only had that for the throttle?
At least they have regen braking:
[ EBk->Brake Out ]
The CA Throttle OUT voltage when ebrakes are applied. This value must be less than
ThrO->MinOut [Default = 0]. Some controllers recognize values between 0V and ThrO->MinOut as a command to apply regen braking. For Grin controllers, regen braking increases from minimum to maximum in the range 0.8V - 0.0V respectively. Setting BrakeOut in this range selects the baseline regen brake intensity when ebrakes are applied, with values closer to 0V having more braking force and values closer to 0.8V having less braking force.

But maybe i'm reading this wrong. Could be - we'll see :)

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 12 2019 7:01am

Disassembles a throttle (well two of them to be sure), connected the throttle output to the ebrake input, but it didn't work as expected.
The throttle outputs 2.4-3.8V from 0-100% opened. But the CA seems to expect a much smaller value then 2.4V as closed. I could now add some resistor network to bring down this voltage to a lower voltage, but I'm not sure if this is the best way to do it.

User avatar
TommyCat   100 W

100 W
Posts: 169
Joined: Jan 22 2018 8:05pm
Location: North-west Illinois, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by TommyCat » Jan 12 2019 9:51am

Sounds like you might be missing a magnet... (or turned around?) but if not. Here is a thread that shows using mini pots to manipulate hall sensor throttle outputs. Although for the results your looking for, (below .8vdc output) you'd probably have to put it on the output line.

Hall Sensor Throttle Thread...
See my completed Magic Pie V5 rear hub E-Bike build Here!

User avatar
amberwolf   100 GW

100 GW
Posts: 26014
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by amberwolf » Jan 12 2019 10:29pm

izeman wrote:
Jan 12 2019 7:01am
Disassembles a throttle (well two of them to be sure), connected the throttle output to the ebrake input, but it didn't work as expected.
The throttle outputs 2.4-3.8V from 0-100% opened. But the CA seems to expect a much smaller value then 2.4V as closed. I could now add some resistor network to bring down this voltage to a lower voltage, but I'm not sure if this is the best way to do it.
AFAIK the CA only accepts a digital (on-off) signal for the ebrake input, basically shorting the ebrake signal in to ground.
https://www.ebikes.ca/product-info/cycle-analyst-3.html
Ebrakes: A digital input for ebrake sensors to plug in directly to the CA3, without needing to run another set of cables all the way down the bike to the controller.
The bit you quoted in another post about the CA and controllers' ranges is only referring to the *throttle* voltage. What happens when supporting a controller that accepts that kind of input is that when the ebrake input is engaged, the CA then changes throttle modes so that adjusting the throttle then converts the throttles output to a range *below* 0.8v, instead of above it, so that a controller that uses throttle input for proportional regen control in that range will respond appropriately.

I'm not sure there is any way to directly use an analog ebrake lever with the CA.

However...you *could* setup the ebrake lever so it's output range is the same as the throttle's--about 0.8-1.4v for it's lowest outptu voltate, when brakes are off. Then about 3.5-4v for it's highest output voltage, when the lever is pulled as far as you would want to have to pull it for max braking.

Then add a switch (direct, relay, electronic, etc) that when you begin to pull the brake lever disconnects the throttle's signal wire from the CA's throttle input and connects the brake lever's signal wire there. (or parallel the signal wires, and just switch the power wire from one hall to the other).

Then the brake lever would do the controlling of the below-0.8v-range, and the throttle would do the controlling above that, so you don't have to get used to using the throttle to control your braking power, for controllers that would be setup for thta (like the Phaserunner, etc).


If the controller doesn't support controlling proportional regen via the throttle input, then you can connect your analog output brake lever directly to the controller, but still have an ebrake switch on it that goes to the CA's ebrake input, to tell the CA to stop sending a throttle signal when braking.

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 13 2019 4:24am

Thanks Amberwolf for answering a not asked question ;)
I'm not looking for proportional braking. I got a mid drive with sooo many freewheels that it would never work.
I just answered your question as i thought it was new information for you - which turned out to be irrelevant.
Back on topic, i guess you're right that i need zero volts (or shorted ebrake pads) to de/activate braking.
I will continue looking for no latching hall sensors likr Fechter posted one and also ordered some reed switches to tests.

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 13 2019 11:18am

I guess i now found a type that can be ordered in China. Mouser etc is a no-go because of enormous shipping costs or minimum order requirements.
The type i found is: US5881
AH1815 is also nice, but i couldn't find any Ali oder ebay sources.

User avatar
fechter   100 GW

100 GW
Posts: 13301
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by fechter » Jan 14 2019 10:54am

The US5881 should work. You can adjust the sensitivity by angling the sensor with respect to the magnet as well as changing the separation distance.

With the standard linear throttle type sensor, the output voltage will be 1/2 the supply voltage when there is no magnet around. As the one magnetic pole approaches, it will increase, and as the opposite pole approaches, it will decrease. Most of them can swing from 0.8v to 4.3v with a 5v supply. If your old throttle won't go below 2v or whatever, the magnet pole needs to get closer or more aligned with the sensor.
"One test is worth a thousand opinions"

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 14 2019 1:15pm

The problem i see is, that the CA waits for ZERO volts. I reduced the output voltage with magnet directly next to the sensors to 0.2V and it still didn't trigger the ebrakes.
I will wait for the ordered halls and install them. I guess they should work great. It still is a pita to adjust. You need to glue the sensor and the magnet to the brake as you can't (shouldn't) drill any holes into the parts. Once the pads wear down it could ask for trouble.

User avatar
fechter   100 GW

100 GW
Posts: 13301
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by fechter » Jan 14 2019 1:51pm

izeman wrote:
Jan 14 2019 1:15pm
The problem i see is, that the CA waits for ZERO volts. I reduced the output voltage with magnet directly next to the sensors to 0.2V and it still didn't trigger the ebrakes.
Something doesn't seem right there. Even a SS41 or similar hall switch will only pull down to around 0.5v.

A cheezy work around would be to pass the output of the hall sensor through a diode to drop the voltage by 0.7v or so, and use a resistor to ground on the input of the CA to force it to zero whenever the sensor drops below 0.7v.
"One test is worth a thousand opinions"

User avatar
izeman   10 GW

10 GW
Posts: 4802
Joined: Jun 21 2011 8:25am
Location: vienna, austria
Contact:

Re: Hall Sensor Type needed for Ebrakes?

Post by izeman » Jan 14 2019 1:54pm

fechter wrote:
Jan 14 2019 1:51pm
Something doesn't seem right there. Even a SS41 or similar hall switch will only pull down to around 0.5v.
That's right but it was down at 0.2V after i added a voltage divider. 10k and 1k made the voltage drop to 10-20%.

e-beach   100 MW

100 MW
Posts: 2869
Joined: Jan 10 2012 9:48pm
Location: Any Los Angeles area beach I am at. Or Santa Monica or possibly the south bay beaches.

Re: Hall Sensor Type needed for Ebrakes?

Post by e-beach » Jan 14 2019 10:58pm

If you are trying to get the voltage down with one magnet, how about running the ss41 through a small trim pot and let the magnet do the rest?

:D :bolt:
Favorite Quote: "This is L.A., sugar. There is no 'over the top." --- Chris Erskine

Current build: Liahona w/ cheap front suspension and suspension seat post. Yescomusa 36v 800w generic front hub motor. 15ah Headway triangle mounted pack. Tronsung 30 amp,

Previous Build:1992 Trek Antelope 800 - Bone Crusher (no suspension) - Yescomusa 800 watt 36 volt front wheel kit. Don't do it! Get suspension!!!

User avatar
fechter   100 GW

100 GW
Posts: 13301
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Hall Sensor Type needed for Ebrakes?

Post by fechter » Jan 15 2019 12:16am

Just as an experiment, you could wire up a pot and slowly turn it down until the CA triggers, then measure what the voltage was.
It really should trigger around 1v.
"One test is worth a thousand opinions"

Post Reply