Smart Garden System using Arduino Create + ROHM Sensor Evaluation Kit

smart garden

Today we’ll be making a smart garden system using the ROHM Sensor Evaluation Kit. In this project, we’ll be combining the proximity/ambient light sensor (ALS) with other sensors to operate the plant growing device!

Please check out our ROHM Sensor Evaluation Kit Overview for more information about ROHM sensors!

In addition, we’ll be using Arduino Create to program the system.

Arduino Create is an all-in-one online platform that enables you to write code, configure boards, share projects, and it was officially released on August 18, 2016.

smart garden

Arduino Create features the following services:

Arduino Web Editor

Arduino Web Editor is an online editor that users can use to write code and upload sketches to any Arduino board from your web browser.

  • Writing or importing code to Arduino
  • Upload/share sketches
  • Using the Arduino library
  • Connecting to the service by the cloud

Arduino Project Hub

Arduino Project Hub is a tutorial platform provided by hackstar.io. The Hub features a vast array of projects of varying degrees of difficulty and popularity.

Arduino Cloud

By using Arduino Cloud, users can manage projects from the cloud via the Internet. The Cloud implements Amazon’s cloud computing service to provide users with a secure development environment.

  • Connect Arduino directly to the Internet
  • Intercommunication among Arduino by MQTT
  • Adoption of AWS IoT and AWS Lambda

 

Today’s Electronic Recipe

Estimated time to completion: 120 minutes

Parts needed:

※ Rohm sensor evaluation kit can be purchased from the following site!

Chip One Stop

Mouser Electronics

 

Consider power up specification of plant growth device

The first step to making a smart garden system is deciding what to incorporate. How would you use sensors to create a useful device for growing plants? Let’s look at the detailed roles and usage of various sensors and their potential use in this project.

The Sensor Evaluation Kit offers 8 different sensors. Which sensors should we incorporate to the plant growing system? Let’s go over each sensor’s functionalities and see what kind of sensors we can use for the system.

smart garden

Figure 1. Sensors from the Sensor Evaluation Kit

  • Accelerometer: Detects inclination, movement, vibration, etc. → We probably won’t measure acceleration with this device
  • Barometric Pressure Sensor: Detects atmospheric pressure → Relationship between pressure and weather seems to have little to no relation to indoor plants
  • Geomagnetic Sensor: Detects direction → Could possibly change the direction of the plant according to the direction of the sun(?)
  • Proximity illuminance sensor: Detects an approaching object; detects brightness → It could be useful when we want to only operate the system during the day (or when it’s bright) and not when it’s dark.
  • Color sensor: Detects color → If the leaf withers, etc… Maybe we can look into this later…
  • Hall sensor: Detects objects with magnet → I don’t think we’ll be doing proximity switching or positioning this time…
  • Temperature sensor: Detects temperature → We can use temperature data to control watering (e.g. water more when the temperature is high, etc).
  • Ultraviolet sensor: Detects ultraviolet light → It can be used to notify the user if the sunlight is too strong/weak.

 

Based on the rundown of the sensors above, it looks like we can combine several sensors for added functionality. So which sensors should we incorporate?

smart garden

Figure 2. General plant growth considerations

As briefly described in Figure 2, some conditions must be met to grow healthy plants. In general, plants grow the best in well-ventilated areas with lots of sunlight and warm temperatures. And, of course, they need water.

Based on this information, we can narrow down our choices of the sensors:

  • Daylight Condition → We can use the ultraviolet sensor and temperature sensor to check whether the temperature is too high/the ultraviolet rays are too strong and take necessary measures to reduce the sunlight.
  • Rule of Watering → Using the soil sensor, we can determine the soil moisture level and water the plant according to the size of the pot.
  • About Temperature → We can check the plant content and trigger alert if the temperature is too high or too low.
  • Ventilation → We can measure indoor air velocity, and in case there’s not much wind inside, we can create the wind with the fan blowing.

Now let’s build the device!

Devices like this…

Speaking of plant growing devices… There are people who have already made large-scale plant growing systems. For example, there’s FarmBot. It looks like a huge laser cutter or 3D printer by its appearance. As you can see in the video below, the machine can also help by planting seeds, and it looks like you can control the planting on the PC or via a mobile app. It’d be harder to manage and control these devices outside for a long time, especially during severe weather conditions. Regardless, these are some really cool devices that have great potential to improve sustainable agriculture.

FARMBOT GENESIS – https://farmbot.io/

 

Arduino Create × Rohm Sensor Evaluation Kit!

We’re going to start off by writing some programs using Arduino Create.

smart garden

Figure 3. Arduino Create

Arduino Create website

Getting started with Arduino Create

We’re going to walk step-by-step through how to use Arduino Create. The beauty of Arduino Create is that you can straight out write codes online in your browser and share them online (e.g. on social media, etc.). Normally, if you were to use Arduino you would have had downloaded and installed Arduino IDE on your PC, but that’s not the case for Arduino Create.

 

  1. Open a browser and go to Arduino Create website.
  2. If you’re a first time Arduino user, you’ll have to create a user account. Proceed to User registration page to create your account. (Otherwise, you can log in to your existing Arduino account.)
  3. (Only for the first time user) When we’re done with the signup, you’ll receive an email with an URL to complete the registration.
  4. (Only for the first time user) Install “Arduino Web Editor Plugin” (or “ArduinoCreateAgent”) to connect the browser to the Arduino main unit.
  5. Open up Arduino Web Editor.

 

What’s the main difference between the PC version and the web version?

  • As long as the Internet is connected, you can view/edit your sketches virtually anywhere
  • Web version also supports libraries so you don’t have to reinstall the same libraries even if the PC changes

Arduino Create is extremely useful. The only downside is that you have to be connected to the Internet to use the Web Editor. Otherwise, you won’t be able to use it. That’s pretty much it. In this case, you can simply use the existing Arduino software on your PC.

Try running Arduino Create main screen and Sensor Evaluation Kit Library

Start by opening the Arduino Web Editor.

smart garden

Figure 4. Arduino Create Web Editor

You can see that the editor opens in the browser. One thing I noticed was that the menus are much easier to see and locate, compared to Arduino Software IDE. Sometimes when you use the IDE on your PC and you open up too many windows with lots of sketches, it gets really cluttered and somewhat disorganized, but with the editor, you can stay organized and easily locate files.

Menu bar is located on the left-hand side of the editor.

smart garden

Figure 5. Arduino Create Web Editor – basic functions

Let’s check some frequently used functions. Let’s start with “Blink.ino” (from Examples → BUILT IN →  01.BASICS → Blink). Select Arduino board & port you’re trying to connect using the drop down menu on the upper center of the screen. Then, click “Verify” → “Upload” (as you’d normally do in Arduino Software).

 

 

 

Adding Sensor Evaluation Kit Library

Next, we’re going to add Sensor Evaluation Kit library. To add the library, you can upload the zip file by selecting it from “Libraries” on the left menu and clicking on “ADD ZIP LIBRARY.” You can then complete by selecting the zip file of the library you want to add. You can download the Sensor Evaluation Kit library (zip file) from here for each sensor.

smart garden

Figure 6. Arduino Create Web Editor – Add Library

 

The Sensor Evaluation Kit has been successfully connected. Now let’s do some wiring and programming!

I want to make the specification of the device as follows:

  • Daylight Condition → We can use ultraviolet sensor and temperature sensor to check whether the temperature is too high/the ultraviolet rays are too strong and take necessary measures to reduce the sunlight.

Make shade using servo motor!

  • Rule of Watering → Using the soil sensor, we can determine the soil moisture level and water the plant according to the size of the pot.

Use soil sensor and water spray!

  • About Temperature → We can check the plant content and trigger alert if the temperature is too high or too low.

Use LED to trigger alert! (Maybe we can implement over the network notifier in the future!)

  • Ventilation → We can measure indoor air velocity, and in case there’s not much wind inside, create the wind with the fan blowing

Use servo motor to operate the fan

smart garden

Figure 7. Circuit diagram (It is assumed that the Sensor Evaluation Kit is already connected to Arduino)

As for the program, after acquiring values of each sensor in the first half of loop, we’ll activate servos and LEDs according to the value of each sensor. Since the threshold at which each sensor activates differs depending on the size of the plant, please adjust the values to your preference.

 

Program – Plant Growth Device

Assembling the Plant Growing System!

Now that wiring and programming is done, let’s put the system together.

smart garden

Figure 8. Mini potted plant

First, you need a plant (of course)!

smart garden

Figure 9. Assembling the shade part

When the ultraviolet light becomes too strong, the shade panel attached to the servo motor will rotate 90 degrees so that it blocks the sunlight from the window.

smart garden

Figure 10. Water spray attached to a servomotor

Depending on the moisture level, the water spray will be activated by pulling the spray with a servomotor.

We’re using an oriental folding fan for wind blowing!

smart garden

Figure 11. Complete assembly of the plant growing system

There’s still plenty of room for improvement. If you want to make it more high-tech, it may be a good idea to use a small water pump, PC fan, etc. Also, if there are no windows in the room, it could be possible to combine the LEDs with the illuminance sensor and turn off the LEDs for plants as the room gets dark.

Summary

In this project, we combined the Sensor Evaluation Kit to power the smart garden system. There are some cool plant growing devices out there (as briefly introduced in the tutorial) and I believe this tutorial could serve as a stepping stone toward developing more advanced plant growing devices.

In the next tutorial, we’ll cover Arduino Create in a little more detail and also try the accelerometer from the Sensor Evaluation Kit.