In this chapter, we looked at ways to detect movement and estimate distance with our Raspberry Pi. We learned how to use a PIR sensor to detect broad movements, and how a switch-type Hall-effect sensor can be used to detect the movement of a magnetic field. We also discovered how to use an ultrasonic range sensor to estimate absolute distance on a larger scale, and how to use a ratiometric-type Hall-effect sensor to measure relative distances on a small scale.
All our circuits and examples in this chapter have been input focused – telling our Raspberry Pi that some event has occurred, such as the detection of a person moving or that a distance is being measured.
You are in a great position now to combine input circuits such as those covered in this chapter (and also in Chapter 9, Measuring Temperature, Humidity, and Light Levels), with output-based circuits and examples from Chapter 7, Turning Things On and Off, Chapter 8, Lights...