DigitalReadSerial Tutorial Wiring


I just started Arduino and am working through the tutorials. I am a bit confused about the DigitalReadSerial tutorial (

  1. I do not understand the circuit diagram where the 5V and ground wires on the far right of the image cross over to the other +/- side of the breadboard. Why is this done? It doesn't seem to connect to anything on the other side. Is it only in case I want to power something else over there?
  2. I have duplicated the circuit diagram on my breadboard (and checked multiple times to verify). However, when I compile and watch the Serial Monitor, I will spontaneously get 1's for high even if the button is not pushed. If I do not push the button at all, it eventually only outputs 1's. Why is that? I have tried removing and replacing the button but it's the same result each time..

Thank you!

1.... I guess they re-purposed a diagram from another example and left those extra wires in.

2.... Can you post your circuit please? ie, your actual one not theirs...

Also if you use those square 4-pin switches it's possible you have it incorrectly oriented and need to swing it 90 degrees because of the internal connections.

Internally those switches are wired as shown attached: note opposite pins are always connected. It's easy to get these suckers the wrong way round.

square switch.JPG

It is quite normal to wire the power rails like that, leaving them connected from project to project.
Replace the switch with a piece of wire, what happens with the wire in the circuit and then with the wire taken away?

Thank you for the quick replies! I tried to attach a picture but I kept getting an error.

I just tried rotating it 180 degrees and it seems to have solved the problem. I also pushed down a lot harder to put the switch back on so it might have also been a seating problem...the legs are kind of hard to stick in!

Is it done this way to supply the other side of the board with 5V and ground wiring? Out of curiosity, your suggestion to replace the switch with a wire that connects the two white wires on my breadboard (, correct?

Thanks again, jimboZA and LarryD! This was incredibly frustrating earlier when I was trying to do this project!

I guess it was a seating problem since rotating it 180 degrees doesn't affect the orientation based on the diagram you posted.

Yep those "zig-zag" legs are not exactly breadboard friendly. I bend mine with pliers to get a better angle. Worst comes to the worst, solder some hook-up wire onto the legs and stick the wires into the board.

Anyway, glad you're sorted....

Is it done this way to supply the other side of the board with 5V and ground wiring?

This allows you to use short jumpers on both sides of the center of the proto board to the power rails.

I used pliers earlier to straighten the legs but I guess it still wasn't enough.

The rails would be great to have but my modification of the project with an LED (so I wouldn't have to start the Serial Monitor each time) needed a different connection to an I/O pin :. At least I saved a wire for grounding.

Hint on using those square switches: if you need to simply connect two wires, put them on diagonally opposite corners. The diagonal corners are only ever connected when the button is pressed so the physical orientation of the switch doesn't matter.

On some, the red and blue lines on the common "power" rails do not continue from one half to the other half. This means that the rails are themselves not continuous, but break at that point so you need to jumper the gap in each rail.

Precisely why they produce such boards is an interesting conundrum.