Please note: Although this question involves a Raspberry Pi, I believe it an electronics/wiring question at its heart.
I'm new to electricity & electronics and I'm trying to get this simple on-off-on-off switch to work as a pushbutton to my Raspberry Pi 1 Model A.
By default, this switch works as follows:
- You press the switch, its "closed" and is considered on, but is routing power through the left pin
- You press it again and that makes it open/off
- You press it again and that makes it closed/on, but now its routing power to the right pin
- You press it again and its off; if you press it again we rinse and repeat this cycle
However I would like to wire the left/right pins together to effectively transform this into a typical on/off switch whereby the behavior is:
- You press the button and its closed/on, routing power to the line joining the left and right pins together
- You press it again and its open/off; if you press it again we rinse and repeat this cycle
I believe the wiring diagram for this type of setup is:
So to begin with, if that wiring diagram is incorrect, please begin by correcting me!
Assuming its correct, then this is my best attempt to wire it to my pi:
So:
- Attach left & right pins on the pushbutton together and then route them to the GPIO input pin
- Route the middle pin on the pushbutton the GND on the RPi
Can anyone take a look at this and help nudge me along? Have I joined the left & right pins correctly? Do I need a resistor anywhere (if so how strong and where does it need to go)? Am I wiring the joined left/right pins to the pi correctly? Am I wiring the switch to power & ground correctly? Thanks for any-and-all help!