Protection resistors

In addition to the switch, the circuit includes a resistor in series with the switch to protect the GPIO pin, as shown in the following diagram:

A GPIO protective current-limiting resistor

The purpose of the protection resistor is to protect the GPIO pin if it is accidentally set as an output rather than an input. Imagine, for instance, that we have our switch connected between the GPIO and ground. Now the GPIO pin is set as an output and switched on (driving it to 3V3) as soon as we press the switch, without a resistor present, the GPIO pin will be directly connected to 0V. The GPIO will still try to drive it to 3V3; this will cause the GPIO pin to burn out (since it will use too much current to drive the pin to the high state). If we use a 1K ohm resistor here, the pin is able to be driven high using an acceptable amount of current (I = V/R = 3.3/1K = 3.3 mA).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.84.169