Reader small image

You're reading from  Raspberry Pi 3 Home Automation Projects

Product typeBook
Published inNov 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781783283873
Edition1st Edition
Languages
Right arrow
Authors (2):
Shantanu Bhadoria
Shantanu Bhadoria
author image
Shantanu Bhadoria

Shantanu Bhadoria is an avid traveler and the author of several popular open source projects in Perl, Python, Golang, and Node.js, including many IoT projects. When in Singapore, he works on paging and building control systems for skyscrapers and large campuses in Singapore, Hong Kong, and Macau. He has authored and contributed to public projects dealing with control over gyroscopes, accelerometers, magnetometers, altimeters, PWM generators, and other sensors and controllers, as well as sensor fusion algorithms such as Kalman filters. Shantanu's work in IoT and other fields can be accessed on his GitHub account with the name shantanubhadoria. He is also the author of Device::SMBus, a popular Perl library used to control devices over the I2C bus.
Read more about Shantanu Bhadoria

Ruben Oliva Ramos
Ruben Oliva Ramos
author image
Ruben Oliva Ramos

Ruben Oliva Ramos is a computer systems engineer from Tecnologico de Leon Institute, with a master's degree in computer and electronic systems engineering and a specialization in teleinformatics and networking from the University of Salle Bajio in Leon, Guanajuato, Mexico. He has more than 5 years of experience of developing web applications to control and monitor devices connected with Arduino and Raspberry Pi, using web frameworks and cloud services to build the Internet of Things applications. He is a mechatronics teacher at the University of Salle Bajio and teaches students of the master's degree in design and engineering of mechatronics systems. Ruben also works at Centro de Bachillerato Tecnologico Industrial 225 teaching subjects such as electronics, robotics and control, automation, and microcontrollers. He is a consultant and developer for projects in areas such as monitoring systems and datalogger data using technologies (such as Android, iOS, HTML5, and ASP.NET), databases (such as SQlite, MongoDB, and MySQL), web servers, hardware programming, and control and monitor systems for data acquisition and programming.
Read more about Ruben Oliva Ramos

View More author details
Right arrow

Automated Gardening System

We all love having a nice garden in our house, whether it's a tiny herb garden in a pot, a kitchen garden in your backyard, or a bed of flowers to welcome guests at the entrance. However, plants are living things and they require constant care and if you forget about them long enough they wither away. If you are like me in any way, you might have the same problem of killing your plants when you missed watering them due to forgetfulness or when you left home for a vacation.

In this chapter, we will create an automated gardening system that keeps an eye on your plant health by monitoring the soil humidity levels and watering your plants whenever the soil humidity level goes too low. This system will avoid the pitfall of a schedule-based gardening system which might end up killing your plants by over-watering them on rainy days.

We will discuss the...

Items required for the project

The gardening system has three parts: the control system, the humidity sensor that measures the humidity content of the soil, and a separate irrigation mechanism that irrigates the plants as required. We will use low-power components for our system (other than the irrigation pump) so that we can run them 24/7 without worrying about energy costs and they will also give us the flexibility of powering our system with batteries.

Waterproof junction box

You probably have a garden outdoors. You might want to keep your outdoor electronics near your garden as well; it will help to have a junction box that protects your electronics from rain and similar acts of nature. You can use hot-melt glue or quick...

Setting up gardening system code (reading humidity)

In this section, we will set up the Arduino IDE and read humidity from the humidity sensor and print it at the Arduino serial port.

Setting up the Arduino IDE

The Arduino IDE is a free IDE provided by https://www.arduino.cc/ that makes it easy to write and deploy code on Arduino and Arduino-based boards like the Arduino Pro Mini. Before we start, you must install the Arduino IDE from the following link. You might have to select the correct version for your OS:

https://www.arduino.cc/en/main/software

If you already have the Arduino IDE, make sure its version is higher than 1.6.4.

You will have to switch the Arduino IDE to your board type. These instructions are for the Arduino...

Connecting it all together

Now all that is left is for you is to put your connected electronics (5V power supply, the Arduino Pro mini, and the relay) in the junction box and stick them using a hot-melt glue gun.

You may also use the hot-melt glue to waterproof any other parts that may need waterproofing:

After placing the Arduino, relay, and the 5V power supply safely in the junction box, connect your drip irrigation system to the submersible pump and submerge the connected pump in your water reservoir. Place your drip irrigation system to directly water the roots of your plants and finally switch on the pump power supply.

Summary

This is it! You now have a fully automated gardening system. You can experiment with a few more things; for example, you may try connecting potentiometer knobs to seasonally adjust the desired soil moisture settings for your plants as needed!

For a more advanced gardening system, you may also try to hook up a soil acidity level sensor and have an additional setup to balance the soil pH levels as per your plant's requirements. Don't let your lack of a green thumb hold you back from getting a garden that your neighbor would be envious of!

In the next chapter, we will look at how to create a snazzy IoT blinky lights festival display using an open source project that lets the world collaborate to color your lights!

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Raspberry Pi 3 Home Automation Projects
Published in: Nov 2017Publisher: PacktISBN-13: 9781783283873
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.
undefined
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

Authors (2)

author image
Shantanu Bhadoria

Shantanu Bhadoria is an avid traveler and the author of several popular open source projects in Perl, Python, Golang, and Node.js, including many IoT projects. When in Singapore, he works on paging and building control systems for skyscrapers and large campuses in Singapore, Hong Kong, and Macau. He has authored and contributed to public projects dealing with control over gyroscopes, accelerometers, magnetometers, altimeters, PWM generators, and other sensors and controllers, as well as sensor fusion algorithms such as Kalman filters. Shantanu's work in IoT and other fields can be accessed on his GitHub account with the name shantanubhadoria. He is also the author of Device::SMBus, a popular Perl library used to control devices over the I2C bus.
Read more about Shantanu Bhadoria

author image
Ruben Oliva Ramos

Ruben Oliva Ramos is a computer systems engineer from Tecnologico de Leon Institute, with a master's degree in computer and electronic systems engineering and a specialization in teleinformatics and networking from the University of Salle Bajio in Leon, Guanajuato, Mexico. He has more than 5 years of experience of developing web applications to control and monitor devices connected with Arduino and Raspberry Pi, using web frameworks and cloud services to build the Internet of Things applications. He is a mechatronics teacher at the University of Salle Bajio and teaches students of the master's degree in design and engineering of mechatronics systems. Ruben also works at Centro de Bachillerato Tecnologico Industrial 225 teaching subjects such as electronics, robotics and control, automation, and microcontrollers. He is a consultant and developer for projects in areas such as monitoring systems and datalogger data using technologies (such as Android, iOS, HTML5, and ASP.NET), databases (such as SQlite, MongoDB, and MySQL), web servers, hardware programming, and control and monitor systems for data acquisition and programming.
Read more about Ruben Oliva Ramos