# First Arduino Project Switch Question

**URL:** <https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151>\
**Category:** Starter Kit\
**Created:** [November 22, 2023, 10:35am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151 "2023-11-22T10:35:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![valkyr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/valkyr/32/983374_2.png) [@valkyr](https://forum.arduino.cc/u/valkyr)\
**Post date:** [November 22, 2023, 10:35am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/1 "2023-11-22T10:35:22Z")

</div>

Hey guys

Just purchased my first Arduino after a long time sitting on the fence, am enjoying it so far but have run into an issue that has me scratching my head (well not actually an issue just not sure what's going on).

The first project is to connect an LED in line with a switch and 220 ohm resistor and have the LED activate using the switch.

I am an ex car mechanic so my day to day used to include a lot of auto electrical work. I'm not completely new to the concept of how a circuit works (although I'm by no means an electrical engineer).

After some research I found that Arduino push buttons are diagonally connected with their opposite ends, the project instructions were to have the switch so that two pins were on one side of the board, and the other two pins were on the other side of the not-connected bread board.

I used my multimetre and confirmed that the two pins directly opposite each other were always connected, but the two diagonally opposite were only connected once the button was pushed. The book and diagram had it configured as such:

I'm at a loss for why this works correctly? If the pin directly opposite is connected, shouldn't the circuit bypass the need to use the button when connected like this?

 ![370273995_1329850861229900_3651692656634954785_n](https://europe1.discourse-cdn.com/arduino/original/4X/4/7/5/4757ae5d72feca7ca9062ece92f7400e7e9d4971.jpeg)  
 ![403364851_561830429460254_6185897959904103798_n](https://europe1.discourse-cdn.com/arduino/original/4X/0/9/a/09a2cf811dcb4d8da58428b5d9226e4c6e6d1067.jpeg)

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [November 22, 2023, 10:47am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/2 "2023-11-22T10:47:24Z")

</div>

Welcome to the forum

It seems that the Arduino has no part to play in what you are doing except to provide 5V. Is that intentional ?

As to the switch, the way to connect it to ensure that the 2 pins that you use are across the switch and not connected together is, as you say, to use diagonally opposite pins

It is possible to use 2 switch pins on the same side of the switch but there is a 50/50 chance that they will be connected together rather than switched

If the 2 switch pins that you are using are, in fact, connected together in the switch, then the LED should be on at all times regardless of whether you press the switch. Which pairs of "same side" pins did you measure ? Test the ones that you are using

---

<div class="post-metadata">

**Author:** ![barshatriplee](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@barshatriplee](https://forum.arduino.cc/u/barshatriplee)\
**Post date:** [November 22, 2023, 10:53am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/3 "2023-11-22T10:53:48Z")

</div>

If needed, you can see the official arduino code and schematic for push buttons.

> **[How to Wire and Program a Button | Arduino Documentation](https://docs.arduino.cc/built-in-examples/digital/Button)**
>
> Learn how to wire and program a pushbutton to control an LED.

---

<div class="post-metadata">

**Author:** ![valkyr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/valkyr/32/983374_2.png) [@valkyr](https://forum.arduino.cc/u/valkyr)\
**Post date:** [November 22, 2023, 11:02am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/4 "2023-11-22T11:02:34Z")

</div>

Thank you for the welcome.

I hope the photo below is not confusing. The two red circles which are the only pins touching the circuit have continuity when tested off the board.

The green circles are the pins that are continuous only when the button is pushed. In this configuration, the circuit should be connected 100% of the time and the LED should always be on, however it is working correctly.

My confusion is why this is working correctly (when the button is pushed only) when the two opposite pins in red are connected all the time.

![Untitled](https://europe1.discourse-cdn.com/arduino/original/4X/d/0/b/d0b83043c7ac02510116f995f5814e97cc69969b.png)

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [November 22, 2023, 11:06am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/5 "2023-11-22T11:06:18Z")

</div>

This may help

> **[Arduino - Button | Arduino Tutorial](https://arduinogetstarted.com/tutorials/arduino-button)**
>
> Learn: how button works, how to use button with Arduino, how to connect button to Arduino, how to program for button step by step. The detail instruction, code, wiring diagram, video tutorial, line-by-line code explanation are provided to help you...

---

<div class="post-metadata">

**Author:** ![valkyr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/valkyr/32/983374_2.png) [@valkyr](https://forum.arduino.cc/u/valkyr)\
**Post date:** [November 22, 2023, 11:13am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/6 "2023-11-22T11:13:38Z")

</div>

This has answered my question thank you very much.

Bookmarked this page.

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [November 22, 2023, 11:16am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/7 "2023-11-22T11:16:52Z")

</div>

Happy to help. Enjoy learning Arduino.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [November 22, 2023, 11:29am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/8 "2023-11-22T11:29:16Z")

</div>

What exactly on that page answered your question ?

If the 2 button pins that you are using are permanently connected to each other, which you say they are, then pressing the button should have no effect

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [November 22, 2023, 11:57am UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/9 "2023-11-22T11:57:34Z")

</div>

He stated

> [@valkyr](#):
>
> the circuit should be connected 100% of the time and the LED should always be on, however it is working correctly.

This led me to believe he mis-interpreted his meter measurements. That page elaborates on the switches internal mechanism and orientation.  
These switches can be confusing to newbies.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [November 22, 2023, 12:17pm UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/10 "2023-11-22T12:17:03Z")

</div>

> [@2112](#):
>
> This led me to believe he mis-interpreted his meter measurements

That is what I am trying to get to the bottom of

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 20, 2024, 12:17pm UTC](https://forum.arduino.cc/t/first-arduino-project-switch-question/1192151/11 "2024-05-20T12:17:19Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
