Book Image

Raspberry Pi Embedded Projects Hotshot

Book Image

Raspberry Pi Embedded Projects Hotshot

Overview of this book

Table of Contents (20 chapters)
Raspberry Pi Mechatronics Projects HOTSHOT
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up sensors for the key alert system


In this task, we will try to build a module that tries to alert the user if the things that we use daily (such as the keys to our apartment door or the car key) are not found in the right place. It helps us save a lot of time frantically searching for misplaced items. We will use a reed switch and a magnet for this module.

The uniqueness about this task is that we try to improve our lives with simple items that are easy to purchase and simple to build. A magnet and a reed switch are available from all hobby stores. You can also use a reed switch in door security systems. The following is a diagram of a reed switch interfaced to a Raspberry Pi:

Reed switch setup with the Raspberry Pi GPIO

Prepare for lift off

We will interface the reed switch as shown in the preceding diagram. Let's test it on a breadboard before setting it up in an enclosure:

Reed switch interfaced to Raspberry Pi

Engage thrusters

  1. We will be tracking whether the key is in the right place...