Hardware Reference
In-Depth Information
FIGURE.5-15 Circuit diagram of a button connected to the Arduino
2. You need a resistor to pull up the button input to 3.3 volts. If you don't fit a resis-
tor, your button will generate spurious presses and your detonator will keep going
off all the time! (Read Digging Into The Circuit to find out more about why this
resistor is necessary.) Fit the 10K pull-up resistor (with the coloured bands: brown,
black, orange) so that one leg is connected to the left pin of the button, and the
other leg is connected to the 3.3 volt power rail at the top of the breadboard.
3. Run a wire from the junction between the resistor leg and the button, and con-
nect the other end of the wire to GPIO number 4.
4. Run a wire from the bottom right pin of the button, and connect the other end
of the wire to the 0-volt power rail at the bottom of the breadboard. You can read
Digging Into The Circuit to understand more abut how this wiring works, but all
buttons are normally wired up to computers in this way. FigureĀ  5-16 shows a
button wired to a GPIO pin.
There are many different types of push button. If you use the same sort of button
as I did for this project, you will notice that the four pins are slightly bent so that
the button fits nicely into a printed circuit board, ready for soldering. Be very
careful when you push the button into the breadboard so that the pins don't
break off. Push very evenly and firmly all over the button and it should it. If you
have a small pair of pliers, you could use them to squash the pins so that they are
completely flat, and they will then fit into the breadboard more easily.
Search WWH ::




Custom Search