Book Image

Raspberry Pi Home Automation with Arduino - Second Edition

By : Andrew K. Dennis
Book Image

Raspberry Pi Home Automation with Arduino - Second Edition

By: Andrew K. Dennis

Overview of this book

Table of Contents (16 chapters)
Raspberry Pi Home Automation with Arduino Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
4
Temperature Storage – Setting Up a Database to Store Your Results
Index

Setting up our software


We now need to write an application in the Arduino IDE to control our new thermostat device. Our software will contain the following:

  • The code responsible for collecting the temperature data

  • Methods to switch relays on and off based on this data

  • Code to handle accepting incoming HTTP requests so that we can view our thermostat's current temperature reading and change the setpoint

  • A method to send our temperature readings to the Raspberry Pi

The next step is to hook up our Arduino thermostat with the USB port of the device we installed the IDE on.

Note

You may need to temporarily disconnect your relay from the Arduino. This will prevent your thermostat device from drawing too much power from your computer's USB port, which may result in the port being disabled.

We now need to download the DHT library that interacts with our AM2303.

Note

This can be found on GitHub, at https://github.com/adafruit/DHT-sensor-library.

  1. Click on the Download ZIP link and unzip the file to a location...