I’ve noticed a lot of people seem to have problems with limit switches. Looks like it’s more operational than hardware, but I thought I’d share my solution to the issue.
I’ve been working in electronics just about all my life, I did sell hotdogs from one of those stainless steel carts, but that was long ago…
Having said that, I don’t like “bouncy”, “noisy” mechanical switches. Initially, I used some 5mm proximity sensors left over from an old robotics job. They worked well, but don’t seem to be lasting too long (wire breakage). And are quite expensive to replace. Plus I had to make an input/comparator PCB to power/read them.
So I ended up changing out to a simple Hall Effect switch. Small, solid state, open collector/drain, wide voltage range (supply and switch). Being open collector/drain, they’ll interface to most of the controllers out there (the ones I use anyway). Just pull the input low and the controller sees an input. Some controllers supply 5V for their switches, some 12V. So the wide voltage supply and switching is ideal, no regulator (as it’s built into the HE switch). Change controllers, no problem, just make sure the pinout is the same.
I used a shielded 3 wire cable (GND, VCC and OUT). The sensor comes in a modified TO-32 case, so I bent the leads coming out of the bottom, very tightly next to the body, backwards, then up a little and another right angle (so the leads look like they’re coming out of the back of the switch, instead of the bottom). Straight back would probably be OK, but I’m a little OCD that way…
Solder one wire to each lead, cut the shield back, and almost done. Some drinking straws are pretty dang close to 5mm diameter, so I just cut some sections about an inch long. Stuck the cable, hall effect sensor in there with some JB weld epoxy and let it dry. (some clean up is probably needed, wait for it to dry a little, then some alcohol will do nicely) The sensor just fits in that 5mm straw, so that or anything larger, your choice. Just think sensor placement, centered in the tube is best. And make sure the active face of the sensor comes all the way to the end of the straw, too far back and a weaker magnet may not activate it. (and I’m guessing I don’t need to mention the testing before the epoxy…)
Crimp some connectors for the JST connector, 2 conductors, and the shield crimped with ground. And you’re ready to go.
I ordered some 2mm “super” magnets off Amazon for a couple bucks. These are very small, and more than strong enough to activate the sensor. So you can place them quite easily. I also had some delrin laying around, I made some plastic blocks of it to hold the sensors. How you mount them to your machine is up to you.
Some controllers only have GND and input on them, so you’ll have to come up with your own method of grabbing VCC and wire it to each sensor.
I haven’t finished it yet (I did test this, and it works), but these will also drive an LED as well as activate the controller input. The only problem is you have to make sure the current limiting resistor is correct for the supply voltage of the controller and needed current for the LED. I’m thinking of making a constant current source out of a few left over LM334Z (I think that’s the part). Then I don’t have to worry about it. So, bonus, you get a nice little LED board that displays the current condition of the limit switches.
I also made an extra sensor cable assembly, for use on the rotary attachment. Since those magnets are so small, you can easily stick one on a work piece and and have a solid reference for starting.
Hope somebody can use this.