How to hook up a limit switch?

We are building a tower with a hook system that will go up and down, but we don’t know how to hook up a limit switch electrically, There are two limit switches one on top of the hook and one on the bottom of the hook thing that goes up and down the tower so when a Limit switch is hit the motor will stop traveling in that direction, what wires need to be hooked up to what on the limit switch, to where etc… Thanks a lot, visuals are awesome if anyone has one displaying a limit switch hooked up

A limit switch would be a digital device and should be hooked up to the digital sidecar like the sensor on this document.

http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2013/SignalLayout_0.pdf

They can be wired normally open or closed and there’s a diagram on the one’s that come in the KOP that illustrates this, and it should look like this

One wire goes to the terminal on the bottom or COM, and the other wire is attached to the upper or lower terminal on the side based on if you want a normally open or closed switch operation.

I’m still confused, which one on the diagram is the limit switch? So how would I wire it up so when the button on top is hit the motor will stop in that direction? Sorry I’m a newbie

There is no limit switch in the diagram per se. A limit switch is a custom circuit on that diagram.

If you want to stop a motor, you can either wire it to the “Digital I/O” section of the sidecar and program it to stop (recommended for reliability and consistency)

The “COM” pin on the switch goes to the (-) pin on the sidecar and the “NC” or “NO” pin goes to the “SIG” pin on the sidecar. You can then program the switch to turn off the motor or control whatever you want. The sidecar has internal pull-up resistors, so there’s no need for any other wiring.

You can also wire it to the limit switch inputs on a Jaguar (Jaguar required, may be easier to get started.)

See page 11 in http://content.vexrobotics.com/docs/217-3367-VEXpro_Jaguar_GettingStartedGuide.pdf for a connection diagram.

FYI, and oh and NC on the switch stand for normally open and normally closed. A normally open switch has no continuity when the switch is not depressed, I’ll normally closed switch does.

You want to wire one side of the switch to ground on a digital input of the digital sidecar, and the other side to the signal connection. So that when the switches actuated the digital I/O pin senses whether there is ground or not. that can be used in your program to tell whether the switch has been pressed or not.

So if I hook it up to jaguar I don’t need to program anything in labview the limit switch will do it all automatically?

There’s a nice tutorial on YouTube from team 3476.

1 Like

So if I hook up the limit switch so theres a wire in the NO3 tab is it true when the button isn’t pressed, because I want it wired up to it’s true when the button isn’t pressed, and false when the button is hit, thanks

Yes, but I’d recommend coding it if only so you learn how. Doing that is just the tip of the iceberg when it comes to FRC coding. The code isn’t that hard to do as long as you have the proper logic. Make a flowchart for the possible states of the switch(es) and the motor. If the switch is open when the motor is running, what do you want it to do? If the switch is closed when the motor is running, what do you want it to do? What if the motor isn’t running?

NO = Normally Open = Off/False (not passing any signal) until the switch is pressed (then it’s On/True)
NC = Normally closed = On/True (passing a signal) until the switch is pressed (then it’s Off/False)