fechter said:
If your controller has a brake lever input, you could parallel it to one of those. It will stop the motor from running.
This is the easiest way to do it, for multiple reasons, including that you can use the switches you already have.
It won't power off the system but it will keep it from being used, *and* if your controller has hard regen braking at low speed, it will also make it difficult to roll the bike along, assuming either a DD hubmotor or a clutchless/freewheelless middrive.
BigBlock said:
I bought several, but they all are normally closed when the magnetic key is removed and normally open once the key is attached.
You don't want to use the word "normally" in your sentence the way you have; it is used to designate the type of switch, not the state the switch is in when describing the action you see. Just say it is open or closed, or just call them Normally Closed. (yes, this does matter; if you use both words to describe the same switch, it won't help you find the right kind).
There are numerous reed type switches; you're looking for Normally Open (NO, N.O.), meaning when it is not engaged by the magnet, the contacts are open.
Normally Closed (NC, N.C.) is the type of switch you already have; the contacts are closed when the magnet is not present.
Mouser, Digikey, Farnell, etc., have filters you can use to sort / include only those kinds of switches you need.
Note taht you need a switch that can handle the voltage you're going to potentially have across the contacts, and any current that flows thru it. If you are using the switch on the controller "enable" line like the KSI (keyswitch / ignition) that provides battery voltage to the controller's low-voltage power supply (LVPS) then the switch has to handle whatever the fully-charged battery voltage is, *and* it must also handle the inrush current into the capacitors on the LVPS.
If it's not rated for either of those, it may just weld together, and never open again when the magnet is removed. Or it may be damaged and arc between the contacts; I had this happen on a tiny reed switch I once tried to use on my brake lever for brake lights; only 15v but the current was too high and breaking the connection caused arcing.
If you can't find one that can handle the voltage / current you want to put thru it, then you'll need to use the switch to control a relay that *can* handle it. The relay will need coil voltage/current from something low-voltage, and there will be parasitic drain from the coil the whole time it is on.
You can either have an LVPS somewhere that will need to be powered all the time so the switch can turn it on, or you can use a voltage divider that will create the coil voltage/current only when the switch is engaged...but it will have some parasitic drain the entire time not only from the coil current but from the voltage divider itself.
If you can only find low-voltage/current NO switches, you could instead put it in the 5v line to the throttle. Same disadvantage as the brakeline switch, but is simple to do.