In Chapter 7, Setting Up a Raspberry Pi Web Server, we used the GPIO Zero library to turn on servos and light up LEDs. In this chapter, we will use GPIO Zero to read inputs from the GPIO port. First, we will start with a simple button, before moving on to Passive Infrared (PIR) motion sensors and buzzers.
Having the ability to read sensory data from the GPIO will allow us to build our IoT home security dashboard. By the end of this chapter, we should become very familiar with programming the Raspberry Pi with components connected to the GPIO.
The following topics will be covered in this chapter:
- Reading the state of a button
- Reading the state from an infrared motion sensor
- Modifying Hello LED using an infrared sensor