Pages: [1]   Go Down
Author Topic: Looking for switches...  (Read 564 times)
0 Members and 1 Guest are viewing this topic.
Albany, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody!

I am looking for two different types of switches.

First, I need a 3-way switch, ON, OFF, AUTO.  I'm not sure how they work with adruino.  Does each position output a different voltage so I can determine the position of the switch?

I also am looking for a 2-way switch, ON and OFF.  Basically the same thing, I need to determine the position of the switch.

Thanks for any help and recommendations.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34726
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I need a 3-way switch, ON, OFF, AUTO.
Most three way switches have three connections, the center connected to the lower, the center connected to the upper and the center connector not connected to anything.
This is not directly compatible with any digital system. It is best to have the center connected to an analogue input, with a 10K resistor also connected from the input to +5V. Then the one end of the switch are connected to a 10K  resistor to ground and the other switch connector to a 4K7 resistor to ground.
Do an analogue read and look at the result, that will give you three different readings.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

2 and 3-way Switches can be found inexpensively at taydaelectronics.com
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 37
Posts: 1355
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
First, I need a 3-way switch, ON, OFF, AUTO.  I'm not sure how they work with adruino.
You can do that with a "center-off"(on-off-on) toggle switch  (example), or a rotary switch.  The toggle switch I linked to is a double-pole (6 connection) switch.  You can use a single-pole double-throw (3-connections) center-off switch, or ignore the 3 extra terminals on a double-throw switch.

You can find rotary switches with adjustable stops, so you can adjust the number of positions, in case you can't find the "right" 3-position rotary switch.

With a center-off switch, you can use two Arduino inputs and you'll have 3 states*...   Input "A" can be on, or input "B" can be on, or both inputs can be off.   You can use if-statements in your sketch to take different actions depending on the switch/input states.

This example shows you how to connect a switch an read the state.    Most likely, "on" will mean that you are grounding an input and reading zero.

Quote
I also am looking for a 2-way switch, ON and OFF.  Basically the same thing, I need to determine the position of the switch.
Any-old SPST (single-pole-single-throw) switch will work for that.


* With 2 inputs, there are actually 4 possible states.  But, with this type of switch, there is no way to turn-on both inputs at the same time.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1857
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

On other type of switch is typically used in camera shutter releases where you press the shutter 1/2 way and the camera focuses, and if you press it all of the way, it takes a picture.  I don't think I have a picture of a wired shutter release disassembled, but a wired shutter release has 3 wires leading out (ground, focus, and shoot).  Internally there is 3 pieces of metal held apart with a small spring.  When you press the button down 1/2 way, it connects the ground and focus wires.  If you press the button down all of the way, the ground, focus, and fire wires are all connected.

The camera has a small circuit that becomes active when the focus + ground wires are connected, and another for the shoot + ground wires.  Some cameras need the focus wire to be connected as well, others don't, which can become important if you are trying to trip the shutter from an Arduino.
Logged

Pages: [1]   Go Up
Jump to: