10 years, 1 month ago.

Microswitch connection with mbed (?!)

I am using these microswitches to control the range of robot arm, but I am not sure about the connection.

If any one of you have used this scenario before or have any idea, please do reply.

http://www.rapidonline.com/Electronic-Components/Cherry-DG13-B1AA-Microswitch-SPDT-3A-125V-AC-2A-30V-DC-Roller-PCB-straight-50-2646

1 Answer

10 years, 1 month ago.

This is a simple changeover switch, find the common connection, normally at one end (not the middle) then you can meter the normally closed and normally open connection. If you connect the common to ground (-ve of power supply) then you can connect one of the other connections to a DigitalIn pin of your Mbed. That DigitalIn can be either set as mode PullUp or you can add a 4k7 resistor to the +3.3v supply. Depending which other switch connection you to connect to the mbed, you will have the DigitalIn going from 0 to 1 or 1 to 0 when to switch is operated.

Hello Paul,

Thanks for the answer! Yes, the first two pins from left give NormallyOpen contact and first pin and last pin provide the NormallyClose contact. These two interchange on pressing the lever.

Can you explain a bit more about "That DigitalIn can be either set as mode PullUp or you can add a 4k7 resistor to the +3.3v supply."

posted by Saad Qazi 17 Mar 2014

Have a look at: https://mbed.org/users/4180_1/notebook/pushbuttons/

posted by Erik - 17 Mar 2014