Chapter 4. Adding a Magnetic Contact Sensor