O'Reilly logo

Raspberry Pi Home Automation with Arduino by Andrew K. Dennis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we learned about relays and how they work. We modified our existing code to expand its functionality. This enabled it to switch the relay on and off based upon our temperature readings. We also set our program up ready to write the temperature data to a database. We launched this program in a screen session so that we can log out of our Raspberry Pi without terminating it.

Finally, we connected the fan and used the relay to switch it on and off. Now that you have a thermostat device, you can try out other projects with it. For example, you could use it to switch on a small heater when the temperature drops.

With our hardware and software complete, we will move onto our next project. This will involve creating a database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required