Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building a Home Security System with Raspberry Pi

You're reading from  Building a Home Security System with Raspberry Pi

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781782175278
Pages 190 pages
Edition 1st Edition
Languages
Author (1):
Matthew Poole Matthew Poole
Profile icon Matthew Poole

Table of Contents (16) Chapters

Building a Home Security System with Raspberry Pi
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Setting Up Your Raspberry Pi Connecting Things to Your Pi with GPIO Extending Your Pi to Connect More Things Adding a Magnetic Contact Sensor Adding a Passive Infrared Motion Sensor Adding Cameras to Our Security System Building a Web-Based Control Panel A Miscellany of Things Putting It All Together Index

Setting up the I2C port expander


Now that we have built our port expander, we need to get it ready to connect our sensors to. First, we need to install the tools on the Raspberry Pi to allow us to use the I2C bus and program devices connected to it, including the MCP23017 chip that makes up our port expander.

Note

Don't connect your port expander to the Raspberry Pi until after you've set up the I2C bus on your system.

Enabling the I2C Bus

It's highly likely that the module for using the I2C bus hasn't been loaded by default. Fortunately, doing this is fairly straightforward and can be done using the Raspberry Pi configuration tool. Perform the following steps:

  1. Launch the Raspberry Pi configuration tool with the following command:

    $ sudo raspi-config
    
  2. Select option 8: Advanced Options.

  3. Select Option A7: I2C.

  4. Select <Yes>.

  5. Reboot your Raspberry Pi for the setting to take effect.

Now that the I2C bus has been enabled, we need to set up the operating system so that the required modules are loaded...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}