Electric bicycles should turn off the motor during braking. Therefore, I have invented a method to build a switch into a brake lever; the brake lever doesn't have to be replaced and no external switch is needed.
I use Hall effect sensors as switch, because they are reliable, watertight, small, and inexpensive. Used is the SS411P, the same as the one in the PAS sensor, but almost every hall sensor may be used. The 5mm magnet comes from a PAS sensor magnet ring.
As an example, the Shimano Deore XT brake lever is taken:
We can choose between active high or active low output. Just rotate the magnet 180 degrees to change the behaviour:
- Active low output
The output is 0V during braking. For two brakes, the outputs can simply be connected together.
- Active high output
The output is 5V during braking. The advantage is that the switch is fail-safe, see here. For two brakes, the outputs can be connected together with two diodes.