Hi, can someone tell me how to wire an ON OFF ON toggle switch. I only need to use one on state/side.
Thank you.
Hi, can someone tell me how to wire an ON OFF ON toggle switch. I only need to use one on state/side.
Thank you.
Do you want to use it to control the state of an Arduino pin or to switch power to something ?
Do you have a multimeter to check resistance/conductivity?
If there are 3 terminals it's a SPDT switch. To use as a basic SPST on/off switch you only need to use two terminals.
The center is common and the other terminals are usually physically-opposite of the switch position... If the toggle is up, the center and bottom terminals are usually connected.
Since it's a center-off switch you'll have two off positions. (Or you can wire the other two terminals together so it's only off in the center position.)
DPDT switches have 6 terminals and they are basically 2 SPDT switches that work together from the same toggle. Again, you can use it as an SPST switch if you only use 2 terminals.
Does the switch stop in 2 positions (on one side/on the other side) or 3 positions (on one side/off/on the other side) ?
Yes I want to use in a controller.
The switch has 3 positions
It's probably similar to this one. Center terminal is common to each of the other terminals, just not at the same time. Wire ground (presumably) to the center terminal and whatever your switching to either of the other terminals.
I tried it initially with a led but couldn't get it work. Using the basic tutorial set with a 10k resistor on the negative pin??
Nice to see such a basic question.
Takes me back to first getting a SES filament lamp bulb to light with two bit of fuse wire and an Eveready battery.
The centre OFF type is a bit unusual domestically, but mastering the SPDT switch is fundamental to millions of homes and premises with two-way light switching.
It still baffles electricians.
Of course there are many variations including the spring (retractive) return which I use to control the opening and closing of a remote window.
Yes it is that type. so according to your picture. For example, when the switch is over to the left side, its the right pin which is connect/active?
Thanks
correct.
Instead of what's shown in the picture above, I recommend connecting GROUND to the center pin and the left or right terminal to your Arduino GPIO pin. (that leaves the possibility to connect the other terminal to another GPIO pin for a future function)
Inside the code, make sure you set the GPIO pin's mode to INPUT_PULLUP.
When you read the state of the pin, HIGH will mean "not active" and LOW will mean "active" -- it may seem backwards, but there is a logical reason for this. Let us know if you need an explanation.
Hmm ... in a dark room you might see a faint glow from the LED, however you might want to try a lower value series resistance, like 220Ω to 1K.
A separate10K resistor is OK if its used as a pullup resistor for the switch contact.
Or this approach might be of interest ...
Could you provide a sketch of how you'd like to connect everything?
I recall seeing a link to the switch earlier, but don't see it now... maybe the op removed it? or maybe I'm just getting old...
Can you provide a link to the switch you are using? Is it a simple SPDT switch or does it also have an embedded LED?
Pat.
If you're trying to illuminate an LED from an Arduino pin, use a 150ohm resistor inline with the LED, not a 10K one.
No. Modern LEDs don't need that kind of drive current. 1k is typical.
sure. almost anything greater than 150, but waaay less than the 10K the OP was using. Maybe my point wasn't very clear.
Thanks.
You provided the right answer in reply #11. I don't know why this topic is dragging on like this... I think you're right about some posts disappearing... it baffled me too..
Actually the OP never mentioned any LEDs. Edit - oh, it was reply #8. Okay...
Looks like you've wired it correctly. EDIT: (electrically safe)
Run IoT and embedded projects in your browser: ESP32, Arduino, Pi Pico, and more. No installation required!
EDIT: simulation updated.
Not quite. That only reads two positions.