Microflow studio

Switch

Digital
Input

Similar to a Button, a switch is a simple input device that can be either open or closed.

In comparison, a switch will hold its state until it is changed, while a button will only be active while it is being pressed.

Types of switches

Switches come in many shapes and sizes. Below are a few examples and how to wire them up.

Wiring

The wiring examples are for illustrative purposes, it might not work with your particular switch.

Is my button active table

Switch TypeSwitch StateInput Pin State
Normally Open (NO)OnHIGH (1)
Normally Open (NO)OffLOW (0)
Normally Closed (NC)OnLOW (0)
Normally Closed (NC)OffHIGH (1)

2 pin on-off switch

A 2 pin switch requires a resistor to work properly.

2 pin on-off switch

3 pin on-off switch

A 3 pin switch is similar to a 2 pin switch, it does not require a resistor but it has an additional pin that is connected to the input pin.

The input pin is usually connected to the middle pin, while the other two pins are connected to the ground and power.

3 pin switch

Resources

Johnny-Five

Previous
Servo
Next
Tilt