About:

This project helps you build a speech-assisted smart plant that responds to your voice commands.
It updates you with its moisture levels, and also to tell you if it needs to be watered or not.

What you’ll need:

• Cloudio - Raspberry Pi setup
• Moisture sensor (You can use any 3-pin moisture sensor of your choice)
• Speaker

Optional:
(This project uses a bulb (connected to Cloudio through a relay) that lights up when Cloudio provides an update about the plant’s current state. This is entirely optional)
• Relay
• Light bulb

Set-up:

Connect the moisture sensor to Port S2 of Cloudio as shown below.
moisture_sensor.png

Then, place the moisture sensor inside the pot such that the probes are buried into the soil.

Connect a relay to port X3 of Cloudio. Further, connect a bulb to it as shown.
relay_bulb.png

How-to Video:

Steps:

Step 1: Setting the Voice Trigger

Use the Voice block from the Advanced section to do this.
In the block's parameter area, press and hold the Record icon to set the voice trigger.
voice.png

Step 2: Setting Cloudio's response to the voice trigger.

A bulb is turned on in response to the voice trigger.

This is done by using the Digital block to set a port to High.
(This port is connected to the bulb through a relay)
digi.png

Next, the moisture levels are checked, and different actions performed based on whether the current level is above or below the desired threshold/trigger value.
An If block with a Moisture sensor is used to do this.
if_start.png

Be sure to set the right port in the Moisture block's parameter panel (depending on the port the sensor is connected to on Cloudio).

Part 1: Setting the threshold level/trigger for moisture levels.

You can do this in the Value section of the Moisture block.
Use the Read function as a calibrating tool to set the ideal moisture threshold/trigger for the plant.
In this example, the trigger moisture level is set to 20%
if_1.png

Part 2: Setting the True (Low moisture value) and False (High moisture value)

This section takes care of Cloudio's behaviour when the moisture value is low.
Set the blocks and their parameters as below
if_with_blocks.png

Use the

  • LED block - Set to red
    (Turns the on-board LED red)
  • OLED block - Set the type to Sensor, Sensor to Moisture, Port to the port to which Moisture sensor is connected
    (Displays the current value of the sensor connected to the port selected)
  • Speak block - Set the type to Sensor, Sensor to Moisture, Port to the port to which Moisture sensor is connected
    (Speaks the current value of the sensor connected to the port selected)
  • Speak block - Set an audio message that informs the user to water the plant as the moisture value is low

The 'True' section and its contents are shown below.
plantupdate_true.png

To build the code for when the moisture level is high, enable the Else section of the If block in its parameter panel.
else.png

You can copy and paste the blocks from the True section and modify their parameters as below.
else_with_blocks.png

Use the

  • LED block - Set to green
    (Turns the on-board LED green)
  • OLED block - Set the type to Sensor, Sensor to Moisture, Port to the port to which Moisture sensor is connected
    (Displays the current value of the sensor connected to the port selected)
  • Speak block - Set the type to Sensor, Sensor to Moisture, Port to the port to which Moisture sensor is connected
    (Speaks the current value of the sensor connected to the port selected)
  • Speak block - Set an audio message that informs the user that there is no need to water the plant as the moisture value is high

Upload the project

Step 3 : Running the project

For this, once the project has been uploaded, press and hold the Record button to use the voice trigger set in Step 1 to query Cloudio for an update from the Smart Plant.
command.png