MECH-0033 Switch, Micro SPDT, 15A, V-152-1C25

https://www.marginallyclever.com/catalog/images/MECH-0033.jpg

$0.63

5 grams

Qty

About

Switches are also known as mechanical end stops. They are commonly used to help a robot sense the world around it. For example, in a CNC machine, the moving parts will back up until they contact the switch and then stop. This is called their "home" position.

Tutorial

  • Connect one pole to ground (black), one to 5v (red), and one to signal (blue).
  • Connect the signal line to an Arduino digital pin.
  • Run this Arduino code:
    void setup() {
      Serial.begin(9600);
      pinMode(YOURPIN,INPUT);
    }
    
    void loop() {
      Serial.println(digitalRead(YOURPIN));
      delay(100);
    }
  • Now open the serial window and watch the number change as you click the switch.

See Also

Switches on Wikipedia