You are previewing Raspberry Pi Home Automation with Arduino.

Raspberry Pi Home Automation with Arduino

Cover of Raspberry Pi Home Automation with Arduino by Andrew K. Dennis Published by Packt Publishing
  1. Raspberry Pi Home Automation with Arduino
    1. Table of Contents
    2. Raspberry Pi Home Automation with Arduino
    3. Credits
    4. About the Author
    5. Acknowledgement
    6. About the Reviewer
      1. Support files, eBooks, discount offers and more
      2. Why Subscribe?
      3. Free Access for Packt account holders
    8. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
    9. 1. An Introduction to the Raspberry Pi, Arduino, and Home Automation
      1. What we will explore in this book
      2. History and background of the Raspberry Pi
      3. History and background of Arduino
      4. What home automation is
      5. Summary
    10. 2. Getting Started Part 1 – Setting up Your Raspberry Pi
      1. The SD card – our Raspberry Pi's storage device
      2. Pre-installed SD card versus a blank one
      3. Setting up the SD card
      4. BerryBoot – our tool for installing an operating system
      5. Summary
    11. 3. Getting Started Part 2 – Setting up Your Raspberry Pi to Arduino Bridge Shield
      1. Raspberry Pi to Arduino bridge shield
      2. Summary
    12. 4. Our First Project – A Basic Thermometer
      1. Building a thermometer
      2. Software for our thermometer
      3. Summary
    13. 5. From Thermometer to Thermostat – Building upon Our First Project
      1. Safety first
      2. Introducing the thermostat
      3. Setting up our hardware
      4. Setting up our software
      5. Testing our thermostat and fan
      6. Summary
    14. 6. Temperature Storage – Setting up a Database to Store Your Results
      1. SQLite
      2. Apache web server
      3. HTSQL
      4. Testing our Arduino shield with our database
      5. Summary
    15. 7. Curtain Automation – Open and Close the Curtains Based on the Ambient Light
      1. Photoresistors
      2. Motor shield and motors
      3. Setting up the photoresistor
      4. Curtain control application
      5. Summary
    16. 8. Wrapping up
      1. A brief review of what we have learned
      2. Next steps
      3. Ideas for next step projects
      4. The future of home automation
      5. Summary
    17. A. References
      1. Raspberry Pi
      2. Raspberry Pi to Arduino bridge shield
      3. Linux
      4. Python
      5. C/C++
      6. Arduino
      7. SQL
      8. HTSQL
      9. Apache
      10. Electronics
      11. Packt Publishing titles
      12. Home automation technology
      13. 3D printing
      14. EEG headsets
      15. Miscellaneous resources
    18. Index

Curtain control application

We will now write an application that leverages the photoresistor and uses this to control the motor. There are a few concepts we will cover quickly before we write the application, in order to provide you with a better understanding of how our software works.

Pulse Width Modulation

Pulse Width Modulation (PWM) is a method that leverages the digital pins to create an analog result. If a digital pin is switched on, it has a value of 5 V and if switched off, it has a value of 0 V; PWM allows us to simulate a value between these two ends.

Using our software, we can create what is known as a square wave . This method involves switching a pin on and off to create a steady signal to the device connected to the digital pin. ...

The best content for your career. Discover unlimited learning on demand for around $1/day.