Processing...

Electronics and Electrical Engineering Design Forum

 

Embedded

Looking for switch

I’m looking for a switch and can’t for the life of me find it. It shouldn’t be that uncommon.

It’s a SPDT Switch that can have either eight positions (ideally) or I could buy two that have four, etc.

It should be three pins per switch, for a total of 24 pins (the eight position one). I’ve searched everywhere online and can’t find anything like this!

I would prefer the raised toggle switches compared to the push up push down recessed little toggles. The switch should be under two inches in length to put this into perspective.

I need these to add both a logic one and a logic zero to one input. Simply giving logic one and open or logic zero and open is not okay. It needs to switch between both logic states.

Please help me find these switches! I’ve seen them before and they really should not be that uncommon!

Thanks.

Steffwiz@me.com
Asked By:
Steffan Long
2 years ago
 
 
{username}
Score: 1

I think you mean an 8-pole, double throw or 8PDT switch. A DPST is a double pole single throw. Sounds like you want “double throw” i.e. two on states or on-on (not an on-off switch).

This could be done with a two position 8 gang rotary switch (I found one at Mouser Electronics, but it was over $200).

Apparently 8P4T switches are available in abundance. Perhaps you could impede the rotation to make it a 8P2T switch.

Digi-key shows 82 4PDT switches in stock (but no 8PDT switches).

Or, how about using a SPDT switch to drive some relays or transistors, etc.

» Reply
 
{username}
Score: 1

First off, thanks for the reply!

Let me try to explain my situation. I currently have a need for eight inputs for a project of mine. However, these inputs are expecting binary input, and so each input needs to be sent either logic one or logic zero, +5 V or Ground in this case. If any input is left open (as it would with a SPST switch) the input will be left unchanged. For example, if it was previously high, and then opened, the input will be left high as compared to low. So the switch must switch from high and low for each of the eight inputs.

These switches should be really cheap, I would definitely not expect to pay $200 for one.

Thank you for your help.

» Reply
 
{username}
Score: 1

So, I’m confused. In your first post you said you needed a switch [i.e. ‘one’ switch] that has 8 positions. Then your elaboration in your second post makes it sound like you need 8 SPDT switches.

Are you looking for a “switch” that has one body and eight bats, with each bat being able to toggle one line (either high or low)? I’ve never heard of anything like that (except for a dip switch).

» Reply
 
{username}
Score: 1

I think I’m looking for eight SPDT switches on one body. I’ve seen this setup with four, and that would be okay (I would just buy two). I need them all to switch separately.

 
{username}
Score: 1

I most likely am looking for a DIP Switch (I am not entirely sure what that means, but a Google search looks correct). This is for testing on a breadboard and eventually soldering into proto board, nothing user-friendly.

 
{username}
Score: 2

Oh, yes—but, the closest you are going to get to what you are describing in a dip switch is the rocker-type switch. But here’s a digi-key reference:

http://search.digikey.com/us/en/products/5435640-5/450-1417-ND/969227

BTW: they are called “DIP” switches because they fit in a Dual-In-Line footprint (like a DIP IC)

Other than that, it sounded like you were looking for an “8 gang toggle switch panel”.

 
{username}
Score: 1

A rocker switch seems fine. The one I’ve seen before has these like toggle switches for each position.

I am definitely looking for a DIP switch then, thank you for the explanation!

Isn’t that switch SPST, though?

 
{username}
Score: 1

Your right — didn’t think of that. So, you can’t use a resistor to pull the line high or low? If you can do that, you can use a SPST.

 
{username}
Score: 1

I’m not sure what you mean, I’m still really new to all of this. I’ve heard of a “pullup resistor” before, but never really understood how it works.

I found this one: http://www.newark.com/jsp/search/productdetail.jsp?SKU=73J8821&CMP=AFC-GB100000001

It seems that it would work for me, although much more expensive than I expected.

Please explain how I would use a SPST switch with my setup. :)

 
{username}
Score: 1

By golly, there IS such a thing:

http://www.rselectronics.com/Products/Switches/DIP_Switches/Toggle_SPDT_DIP_Switches.aspx
http://search.digikey.com/us/en/products/KAT1108E/EG4555-ND/666103

There might be more at Digi-Key, but their search tool makes it difficult to distinguish.

» Reply
 
{username}
Score: 1

Yup! Those are the exact ones that I was looking for.

 
{username}
Score: 1

Attached are examples of a pull-up and pull-down arrangement. The resistor value needs to e adjusted according to load requirements—i.e. highest value that will still supply the necessary current to achieve a noise immune logic state.

Attached Files:
 
{username}
Score: 1

Just noticed that some of the text got cut off, so here it is again.

Attached Files:
 
{username}
Score: 1

The trick in finding those dip switches was to get a distinction between DIP Switches and SPDT without the search tool thinking I was refering to the whole switch package rather than one of the switched in the package. Stupid search tools (…with Homer Simpson voice)!

 
{username}
Score: 0

So I could use either of those? For a pullup circuit, when the switch is open, the logic level is high? For a pulldown, it’s opposite?

 
{username}
Score: 1

Yes, but you need to consider the drive requirements of the inputs. Your description sounds like a CMOS or PMOS input. In which case, either will do—with, say a 100K resistor. If it’s more like a TTL input then the pull-up circuit is best. But there are many different families of TTL, so check the spec sheet to get an idea of the optimal value of resistor to use. Unless excessive current draw isn’t an issue, then just use a 1K resistor.

 
{username}
Score: 0

The inputs are to a microcontroller. I just tested it with the pulldown (so that when the switch is ON the output is HIGH and not backwards) and with 1k resistors, and it works flawlessly. I’m not sure if I should be using 1k resistors or something else, but it works.

Thanks for your help! You saved me $10 plus shipping on those switches!

 
{username}
Score: 0

Then, the input current should be pretty low, so you can probably get away with a fairly high value. If this is a battery powered circuit, then you probably what to keep the current draw down, so go with the highest value possible and still be within recommended input voltage levels. Also, consider that the higher the value, the less immune to noise the it will be. If you can find a manufacture recommendation for the max pull up or pull down value, go with that. Other wise, check the spec sheet for the worst case input leakage current and select a resistor value that will insure the input voltage will be high enough (for a pull up) or low enough (for a pull down) that the input levels will be satisfied. Spec sheets always give a max input low and a minimum input high spec. I would design for a couple of tenths of a volt back from the extreme. Or, if the resistor value comes out really high, then consider how a lower value will affect battery life and come down to the lowest tolerable.

Also, consider that there will be eight of them, so the battery life impact is multiplied by 8.

If not a battery driven circuit then use a resistor value that will put the input voltage near the rail. Something like 10K.

 
{username}
Score: 0

Maybe you can help me. This is the datasheet for the microcontroller: http://atmel.com/dyn/resources/prod_documents/7593S.pdf

I am currently using pins PF0-PF7 for my eight inputs. The datasheet says something about internal pullup resistors.. what does that mean?

 
{username}
Score: 0

That means, my friend, that you don’t need no stinkin’ external pull-up resistors! The microcontroller has input pull-up resistors built-in. You probably have to turn them on, though (couldn’t find a register in the datasheet — there must be another data sheet with details such as that.)

BTW: I use PIC processors so I know microcontroller mechanics, but I’m not familiar with the Atmel details.

 
{username}
Score: 0

Looks like in order to get the internal pull-ups to work, you need to reset the MCUCR.PUD bit, write a one to DDRxn and a one to PORTxn and make the port an input (how ever you do that—the logic on this device is very convoluted—I think I’ll stick with the PIC—much easier!) BUT, don’t quote me on this!

 
{username}
Score: 0

I would do that in C++.

I’m not sure which port numbers you mean exactly (but I can look them up).

I would use:

pinMode(pin1, INPUT);
pinMode(pin2, INPUT);

digitalWrite(pin1, HIGH);
digitalWrite(pin2, HIGH);

That would set both pins as inputs and set them as logic high (although a bit awkward setting a logic state to a input pin, it should work).

Is there any problem keeping my current setup? It works and I’m really getting to where I’m uncomfortable with the internal pull-ups and such.

 
{username}
Score: 0

You don’t have to use the internal pullups—they’re just a convenience ;)

 
{username}
Score: 0

we can provide you a 8pole 2 way switch front panel mounting type with a connector to provide you the 8 outputs which can be either high(1) or low (0) with input power supply provided externally. if you are interested please let us know.

we are basically based on INDIA

» Reply
 
{username}
Score: 0

Try this link this will give you a simple tutorial on winavr and how to start with Atmel if you are just using C

http://www.8051projects.net/e107_files/public/1242392126_2569_FT22383_avr_tutorial.pdf

Alternatively download the datasheet on the Atmel device and within that data sheet will be a section on how to disable, enable in one of the registers weak pull-ups

With Pic Micro this is done through the OPTION_REG bit 7

RBPU: PORTB Pull-up Enable bit 1 = PORTB pull-ups are disabled 0 = PORTB pull-ups are enabled by individual port latch values

Try this link this will give you a simple tutorial on winavr and how to start with Atmel if you are just using C

http://www.8051projects.net/e107_files/public/1242392126_2569_FT22383_avr_tutorial.pdf

Alternatively download the datasheet on the Atmel device and within that data sheet will be a section on how to disable, enable in one of the registers weak pull-ups

With Pic Micro this is done through the OPTION_REG bit 7

bit 7 RBPU: PORTB Pull-up Enable bit
1 = PORTB pull-ups are disabled
0 = PORTB pull-ups are enabled by individual port latch values

bit 6 INTEDG: Interrupt Edge Select bit
1 = Interrupt on rising edge of RB0/INT pin
0 = Interrupt on falling edge of RB0/INT pin

bit 5 T0CS: TMR0 Clock Source Select bit
1 = Transition on RA4/T0CKI pin
0 = Internal instruction cycle clock (CLKOUT)

bit 4 T0SE: TMR0 Source Edge Select bit
1 = Increment on high-to-low transition on RA4/T0CKI pin
0 = Increment on low-to-high transition on RA4/T0CKI pin

bit 3 PSA: Prescaler Assignment bit
1 = Prescaler is assigned to the WDT
0 = Prescaler is assigned to the Timer0 module

bit 2-0 PS2:PS0: Prescaler Rate Select bits

Code would be assuming no other functions required eg timer interrupts, hardware interrupts or prescaler

OPTION_REG = 0×40

Warning !!! enabling the week pull up’s on port b for example might lead to confusion if using port B for reading data this could lead to false readings initially so make sure that you disable these for data reading , also clear the port down first before any reading that you might need to achieve

Hope this helps you

Mark H http://www.harrington.force9.co.uk

» Reply
 
{username}
Score: 0

I am also including for you another link for uncompressing rar files and uploading a rar file which illustrates how to make your own programmers

See link below

7 zip for rar file extensions
http://www.7-zip.org/

Attached Files:
» Reply
Login or Register to discuss this topic.
x
Like free stuff...
EEWeb Weekly Giveaway Sponsored by Mouser This Week: Freescale Sensor Dev Tool box kit!
Enter Here
Login and enter if you're already a member.
Click Here