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.
Tip
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.
- Click on the Download ZIP link and unzip the file to...