Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

The resistor solution

If we add an external resistor to the circuit, as shown in the following diagram, then we'll introduce what is called a pull-up resistor, which serves the purpose of pulling (meaning connecting) GPIO pin 21 up (meaning connected to a positive voltage) to 3.3 volts:

Figure 6.6 – Push button circuit with a pull-up resistor

Here are the steps to create this circuit on your breadboard. The step numbers here match the numbered black circles shown in the preceding diagram:

  1. Place the push button on your breadboard.
  2. Place the resistor (with a value between 50kΩ to 65kΩ ) on your breadboard. One end of the resistor shares the same row (shown at hole B5as the upper positioned leg of the push button. The other end of the resistor is placed on an empty row.
  3. Connect the other end of the resistor to a 3.3-volt pin on your Raspberry Pi.
  4. Connect the lower leg of the push button to a GND...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461