Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Switch Ratings - What do they mean?

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    13

    Switch Ratings - What do they mean?

    I'm trying to select switches for a Teensy 3.0 powered soley by the USB (no battery or external). If I look at a site like Mouser, they have several ratings that I would like to know the meaning of:
    • Current Rating - Ranging from 0.1 mA to 20A

    • Voltage Rating AC - Ranging from 4.5V to 600V

    • Voltage Rating DC - 0.5V to 600V

    • Power Rating - 0.1VA to 50VA


    The switches will primarily be pushbuttons used as input to digital pins. I just want to ensure that I get switches that can handle what I suspect is not much "power" from the Teensy.

    Google is not my friend in this case, Mouser doesn't have a glossary, and I couldn't find anything in this forum.

    I'd appreciate "keep it under/over xyz" or links to further reading. I just can't seem to get any info on this.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,922
    Almost any switches will work. When used with Teensy3 pins, they'll need to be rated for 3.3 volts or higher and 0.1 mA or higher. Virtually all switches are rated for much more. It's perfectly fine to use a switch rated for higher voltage or more current.

    For pushbuttons, you probably want "momentary" contact. Some are "on/off", which could also work if you write your code differently, but usually the simpler (and cheaper) momentary ones are easiest.

  3. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    13
    Wow, fast reply. I know you have a ton you go through and you're about to end a several hour wild goose chase for me.

    So if I'm reading this correctly....

    Current - 0.1 mA or higher
    Voltage AC - 3.3V or don't care? I know I care DEEPLY about one of these voltages, but not sure if AC, DC, or both.
    Voltage DC - same question as AC.
    Power Rating - Doesn't matter?

    ..and yes, I was going to use momentary switches to emulate key presses, cheap as in "inexpensive", you bet. Trying to get some quality ones, but not building something for a harsh environment (unless you count my desk).

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,952
    Quote Originally Posted by eviolett View Post
    Wow, fast reply. I know you have a ton you go through and you're about to end a several hour wild goose chase for me.

    So if I'm reading this correctly....

    Current - 0.1 mA or higher
    Voltage AC - 3.3V or don't care? I know I care DEEPLY about one of these voltages, but not sure if AC, DC, or both.
    You don't care about AC, since you will be connecting the switch to direct current (on the teensy).

    Quote Originally Posted by eviolett View Post
    Voltage DC - same question as AC.
    Power Rating - Doesn't matter?
    As Paul says, the switch has to be able to handle 3.3v or higher and 0.1 maA or higher, so that you can connect it to the Teensy. The higher voltages would matter if you are connecting say automobile direct current (12v), etc. A momentary switch is essentially two wires, separated by a spring to keep them apart. When you press on the switch, it completes the circuit.

    Now, if you are planning to hook up many buttons, you may need to worry about having enough pins to read all of those buttons. If that is the case, there are various ways to hook up multiple switches, such as I2C (where you can cascade up to something like 1,024 different switches), and shift registers.

    Membrane switches are another possibility if you aren't worried about pressing more than one key at a time, but want to use fewer data pins than switches. Here is a 4x4 matrix 16-key membrane switch from one of the ebay vendors I buy from: http://www.ebay.com/itm/4x4-Matrix-1...item4ac6f2cda9

    Obviously, when you get more than a few buttons, you need to be more careful about your wiring. Using different colors of wire can help trace out the rats nest when one button doesn't work and/or to associate a given button with an input.

    For some things bigger buttons (arcade buttons) are desired, particularly if the button has a separate 1-2 cables that operate a LED within the button. For other things, it is useful to have buttons that fit in a breadboard (0.1" spacing, normally called tactical buttons). And a piece of wire makes a dandy emergency button, connecting from ground to the data pin.
    Last edited by MichaelMeissner; 09-03-2013 at 08:31 PM.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,922
    None of those voltage, current, AC vs DC, or power ratings matter.

    They all are about the maximum amount of current the switch can conduct when its closed and how much voltage it can block when it's open, and a variety of other more subtle issues that can come into play when turning the power on and off to equipment that consumes very substantial amounts of power. When you use a switch to turn on power to devices, these spec matter.

    When used with a Teensy I/O pin, presumably with the built-in pullup resistor but also if used with a real pullup resistor like 10K, the voltage, current and power are very low. They are far less than the maximum ratings on even the smallest switches you can buy at Mouser.

    All switches, especially very large ones, have mechanical chatter. Many of the Teensy examples use the Bounce library. Unless you have some very good reason to not use it, I would highly recommend the Bounce library. It makes detecting the changes easy and very reliable, even if you end up with a switch that has substantial chatter.

    Really, truly, you do not need to worry about these electrical specs for this application. Just buy the switches you like based on size, appearance or other physical considerations, or price. Electrically speaking, reading the switch position using a Teensy3 I/O pins is so undemanding voltage/current/power-wise that any switch will work.

  6. #6
    Junior Member
    Join Date
    Aug 2013
    Posts
    13
    Quote Originally Posted by PaulStoffregen View Post
    All switches, especially very large ones, have mechanical chatter. Many of the Teensy examples use the Bounce library. Unless you have some very good reason to not use it, I would highly recommend the Bounce library. It makes detecting the changes easy and very reliable, even if you end up with a switch that has substantial chatter.
    @Paul - Good to know. As for the bounce, I have a question on encoders in a separate thread. If you (or someone else) could be so kind, I have some questions there: http://forum.pjrc.com/threads/24152-...hlight=encoder

    @Michael - Thanks, and yes, I already have an issue with the number of pins and I was going to hookup several of the push buttons to a chip that allows (shifts?) 8 buttons and uses 3 pins. I was going to use some encoders and I want those hooked up directly to the pins to limit the complexity/debugging. I figured putting the buttons on the chip would be more straight forward.

  7. #7
    Hi,

    Just wanted to ask that will a 250v switch work well in a circuit that only has a maximum of 230 volts?
    Does a high voltage rating well above the voltage of the circuit matter?

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •