How to wire multi-directional switch???

Hi everybody,

i don't know how to wire my multi-directional switch to a DUE. i have a few questions:

Do i have to connect pin 1 and 2 to ground? to which pins can i connect the rest?

And if i want to use external pull-up resistors instead of the internal, do i need a pull-up resistor for each input or can i connect only one resistor between VCC and the switches?

TPA_31aug10-14456.pdf (229 KB)

We don't know your application ... You could wire it to switch to 3.3V or to GND (or both as there are 2 poles).

Note the minimum required switching current of 1mA, so I would recommend 1K pullup (or pulldown) on each input.

You cannot mix pullup and pulldown on the same pole.

dlloyd:
We don't know your application ...

sorry, i want to navigate the menu on a display (like a MP3-Player) going up, down, left, right and push to choose something in the menu.

You can wire each pin to a digital pin but you must use separate pull-up resistors for each pin.

Or you can use suitable resistors to wire them all to one analog pin. Have a look how this Adafruit shield does it.

i want to test both options: with external pull-up and with internal pull-up. are these two sketches right?

Yes they are right. Why do you want to test both options? They will both work and you don't have the equipment to do any deep investigation into the noise margin which will be the only difference between the two.

Grumpy_Mike:
Why do you want to test both options?

Because i want to build a shield and i am not sure if it works with the internal pull-ups because they are 50kOhm and the minimum current of the switch is 1mA. I am not sur if ther will be any problems...

If you're using the internal pullup then the minimum current of the switch needs to be greater than the 5V / 50K = .0001A. And it is. But I won't discourage you from trying both options -- good experience.

Be sure to take a few moments to search for menu libraries for the Arduino. There are a few nice ones out there.

MorganS:
You can wire each pin to a digital pin but you must use separate pull-up resistors for each pin.

can i use any digital pin? or are thr some recommended ones?

MorganS:
Or you can use suitable resistors to wire them all to one analog pin. Have a look how this Adafruit shield does it.

That is exactly what i needed ^^ but now its to late, i have ordered everything to build my own shield

Not too sure that a minimum current for a switch makes a lot of sense.
However if you want to ensure 1mA then hose external pull-ups need to be 3K3.

Any pin will do they are all the same when they are an input.

Chagrin:
If you're using the internal pullup then the minimum current of the switch needs to be greater than the 5V / 50K = .0001A. And it is. But I won't discourage you from trying both options -- good experience.

The DUE has 3.3V. So i get 0.066mA and that is less than the minimum current of the switch so it wont work, or am i wrong???

Chagrin:
Be sure to take a few moments to search for menu libraries for the Arduino. There are a few nice ones out there.

thanks :wink:

So i get 0.066mA and that is less than the minimum current of the switch so it wont work, or am i wrong???

You are not wrong if and it is a big if, the switch will not work with currents less than 1mA. As I said I am not at all sure about the varsity of this. The standards of data sheets is not what it used to be.
Normally minimum currents are only required when operating at high humidity with none noble metal contacts.

Then I will build both options on the board so i can choose between them with jumpers.

Is it also ok if I take 1kOhm pull-up resistors for each input?

And how about the pins 1 and 2? Is it right, that they are connected both to GND?

Is it also ok if I take 1kOhm pull-up resistors for each input?

Yes.

And how about the pins 1 and 2? Is it right, that they are connected both to GND?

Yes.

Grumpy_Mike:
Not too sure that a minimum current for a switch makes a lot of sense.
However if you want to ensure 1mA then hose external pull-ups need to be 3K3.

Any pin will do they are all the same when they are an input.

Perhaps the minimum current ensures a long lifetime by self-cleaning action of the contacts
(breaking down oxide film)? Perhaps its nonsense, I've certainly not seen such a spec before
to the best of recollection.

I came across the issue some years back where I was using an industrial type switch in a test machine that switched low energy. Needed to source another switch that still had an industrial look and could handle the low level current and voltage. It had snap-action and gold contacts.

It seems wetting current, wiping action, actuation force and contact material all come into play.
http://www.aeroelectric.com/Reference_Docs/Microswitch/TB13_Low_Energy_Switching.pdf

thank you a lot for your help everybody!!