diff --git a/content/hardware/08.kits/family.md b/content/hardware/08.kits/family.md index 4281eca665..7edd35b30e 100644 --- a/content/hardware/08.kits/family.md +++ b/content/hardware/08.kits/family.md @@ -1,5 +1,5 @@ ---- -title: Kits -description: Pre-packaged kits with components, creative projects & dedicated content. - +--- +title: Kits +description: Pre-packaged kits with components, creative projects & dedicated content. + --- \ No newline at end of file diff --git a/content/hardware/08.kits/maker/category.md b/content/hardware/08.kits/maker/category.md index a21506780d..e9312a3598 100644 --- a/content/hardware/08.kits/maker/category.md +++ b/content/hardware/08.kits/maker/category.md @@ -1,3 +1,3 @@ ---- -title: Maker +--- +title: Maker --- \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/compatibility.yml b/content/hardware/08.kits/maker/plant-watering-kit/compatibility.yml new file mode 100644 index 0000000000..68fc831f20 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/compatibility.yml @@ -0,0 +1,8 @@ +software: + - arduino-ide + - arduino-cli + - web-editor +hardware: + shields: ~ + carriers: ~ + boards: ~ \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/features.md b/content/hardware/08.kits/maker/plant-watering-kit/features.md new file mode 100644 index 0000000000..21dc891cb0 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/features.md @@ -0,0 +1,34 @@ + + +The Arduino Plant Watering Kit makes watering your plants easier than before and the setup can be scaled up to fit as many plants as you want. Check the main features below: + + + + + + + + + Submerse the pump into water to pump fresh water straight into your plant. + + + + + + Check your plant and get updates about the moisture straight to your dashboard. + + + + + + Use the Screw Terminal Adapter to easily connect wires without the need to solder. + + + + + + Check the integrated LED button so see if your plant needs water and if so simply press it. + + + + diff --git a/content/hardware/08.kits/maker/plant-watering-kit/image.svg b/content/hardware/08.kits/maker/plant-watering-kit/image.svg new file mode 100644 index 0000000000..4f8ca4abe9 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/image.svg @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/hardware/08.kits/maker/plant-watering-kit/product.md b/content/hardware/08.kits/maker/plant-watering-kit/product.md new file mode 100644 index 0000000000..8832fc9c82 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/product.md @@ -0,0 +1,7 @@ +--- +title: Plant Watering Kit +url_shop: https://store.arduino.cc/plant-watering-kit +url_guide: /tutorials/plant-watering-kit/iot-smart-garden-setup-with-nanorp2040 +--- + +Decorating your home with plants is an easy way to bring some life into your day-to-day. The only problem is - those plants need water to survive, and if you forget to pay attention to them for a while you may need to start over. So instead of staying ever vigilant, why not spend an afternoon creating a setup that will let you both monitor the amount of moisture in your plants soil, and water your plants from afar using the [Arduino IoT Cloud](https://docs.arduino.cc/cloud/iot-cloud)? \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.md b/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.md new file mode 100644 index 0000000000..a09801b2a9 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.md @@ -0,0 +1 @@ +Here you will find the technical specifications for the Arduino® Plant Watering Kit. \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.yml b/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.yml new file mode 100644 index 0000000000..9d1a67c85e --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/tech-specs.yml @@ -0,0 +1,15 @@ +Kit: + Name: Arduino® Plant Watering Kit + SKU: AKX00041 +Components: + Arduino Nano RP2040 Connect: 1x + Arduino Nano Screw Terminal Adapter: 1x + Open-ended USB cable: 1x + 5V submersible pump: 1x + 1 meter of plastic hose: 1x + Grove moisture sensor: 1x + Grove relay module with cable: 1x + Grove LED button module with cable: 1x + Grove cables 50 cm: 1x + Jumper wires (15 cm): 10x + Screw connectors: 12x \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Dashboard.gif b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Dashboard.gif new file mode 100644 index 0000000000..7b0240af31 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Dashboard.gif differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Things.jpg b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Things.jpg new file mode 100644 index 0000000000..b737cbaa37 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/Things.jpg differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/cabletwisting.gif b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/cabletwisting.gif new file mode 100644 index 0000000000..d8c54427b8 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/cabletwisting.gif differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/completesetup.jpg b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/completesetup.jpg new file mode 100644 index 0000000000..ccc9edfe9c Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/completesetup.jpg differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/coverpage.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/coverpage.png new file mode 100644 index 0000000000..50b31b22a5 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/coverpage.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/dashboard-overview.jpg b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/dashboard-overview.jpg new file mode 100644 index 0000000000..45f0e9dd92 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/dashboard-overview.jpg differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step1.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step1.png new file mode 100644 index 0000000000..aad316bb54 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step1.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step2.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step2.png new file mode 100644 index 0000000000..a2190876ce Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step2.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step3.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step3.png new file mode 100644 index 0000000000..8d8b97262a Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step3.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step4.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step4.png new file mode 100644 index 0000000000..987e031cd6 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step4.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step5.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step5.png new file mode 100644 index 0000000000..278a9ce730 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step5.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step6.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step6.png new file mode 100644 index 0000000000..29a091ccfe Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step6.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step7.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step7.png new file mode 100644 index 0000000000..0477bc0fd8 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/step7.png differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/ziptie.gif b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/ziptie.gif new file mode 100644 index 0000000000..acd62ddcd2 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/assets/ziptie.gif differ diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/content.md b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/content.md new file mode 100644 index 0000000000..7f04619d05 --- /dev/null +++ b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/content.md @@ -0,0 +1,343 @@ +--- +title: "IoT Smart Garden Setup with Nano RP2040 Connect" +description: "Build a smart garden setup with the Nano RP2040 Connect, a pump, and a moisture sensor." +coverImage: "assets/coverpage.png" +tags: [IoT Cloud, Water Pump, Moisture Sensor] +author: "Jacob Hylén, Hannes Siebeneicher, Karl Söderby" +hardware: + - hardware/03.nano/boards/nano-rp2040-connect + - hardware/08.kits/maker/plant-watering-kit +difficulty: beginner +--- + +## Components and Supplies + +- [Arduino Plant Watering Kit](https://store.arduino.cc/plant-watering-kit) +- [3D-printed enclosure](https://www.printables.com/model/379111-plant-watering-kit-parts) (optional). + +## Apps and Online Services + +- [Arduino IoT Cloud](https://cloud.arduino.cc) + +## About This Project + +**Water your plants from anywhere using the Arduino IoT Cloud** + +Decorating your home with plants is an easy way to bring some life into your day-to-day. The only problem is - those plants need water to survive, and if you forget to pay attention to them for a while you may need to start over. So instead of staying ever vigilant, why not spend an afternoon creating a setup that will let you both monitor the amount of moisture in your plants soil, and water your plants from afar using the [Arduino IoT Cloud](https://docs.arduino.cc/cloud/iot-cloud)? + +### In a Nutshell + +Attaching an external relay to the Arduino Nano Screw Terminal Adapter lets you control circuits that are powered separately. In this tutorial we will be using a relay module attached to the Arduino Nano Screw Terminal Adapter to control a pump, providing water for one of our plants from the Arduino IoT Cloud thanks to the functionality of the Arduino Nano RP2040 Connect. + +### Components +* [Arduino Plant Watering Kit](https://store.arduino.cc/plant-watering-kit) +* [3D-printed enclosure](https://www.printables.com/model/379111-plant-watering-kit-parts) (optional) +* USB - wall adapter (not included in the kit) + +OR + +* [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect) +* [Arduino Nano Screw Terminal Adapter](https://store.arduino.cc/products/nano-screw-terminal) +* 5V submersible pump. +* 1 meter watering pipe. +* USB wall adapter +* Water container. +* Micro-USB cable. +* Open ended USB Cable. +* Soil moisture sensor. +* Grove LED button. +* [3D-printed enclosure](https://www.printables.com/model/379111-plant-watering-kit-parts) (optional). +* Short Grove cable (20cm). +* Long Grove cable (50cm). +* Long 3-pronged Grove cable (50cm). +* A few spare jumper cables just in case you need them. + + +### Learning Goals + +* Introducing the Arduino IoT Cloud +* Introducing the Arduino IoT Remote app +* Managing sensors with the Arduino IoT Cloud +* Creating an Arduino IoT Cloud Dashboard + +### Hardware & Circuit Assembly + +There are cases were multiple wires are going into the same screw terminal, you may find it easier to get them in at the same time if you twist them together before trying to insert them. + +![Twisting cables together](assets/cabletwisting.gif) + +In case you want to place your plant further away from the electronics, we've included a loose set of extra screw terminals, that you can use to add more length to your cables. Just use wire cutters to clip off as many as you need and screw down the cables you want to connect together. These can also be used to join cables instead of twisting, if you find that easier. + +Now on to the circuit assembly! Begin by grabbing the Arduino Nano RP2040 Connect board, and pushing it into place on the Nano Screw Terminal Adapter. + +![Nano mounted on the adapter](./assets/step1.png) + +Then find the relay module, and a grove cable. You will need to cut the grove cable in half to expose the copper cable inside so you can connect it to the Screw terminal adapter. Connect the wires from the grove cable to the Nano Screw Terminal Adapter as follows: + +- Black wire (-) to GND pin. +- Red wire (+) to 3.3V pin. +- Yellow wire to D6 pin. + +![Relay and split open Grove cable](./assets/step2.png) + + +Now let's wire up the submersible pump. This pump runs on 5V, and draws more current than an Arduino board can provide, so it needs to be powered by the USB wall adapter. This is why we need a relay acting as a power switch that we control with software. Connect the black wire from the pump to GND, and the red wire to one of the screw terminal connectors on the relay. + +![Pump connected](./assets/step3.png) + +Now find the LED Grove button and a Grove cable. This cable also needs to be cut to expose the copper wire inside. The wires from the grove cable should be connected as follows: + +- Black wire (-) to GND pin. +- Red wire (+) to 3.3V pin. +- Yellow wire to D5 pin. +- White wire to D4 pin. + +![LED Grove Button connected](./assets/step4.png) + +Find the open ended USB cable, this will be used both to power the board through it's Vin pin, and the pump through the relay. Connect the black wire to GND, and connect the red wire, together with a separate jumper cable, to Vin. The other jumper wire that you just connected should be wired to the other screw terminal connector on the Relay module. + +If you find this step hard, you can also use one of the loose screw terminals provided in the kit to connect the red wire from the USB cable to two jumper cables. + +![USB wall adapter powering the project](./assets/step5.png) + +The USB-cable can then be plugged into any USB port, on a laptop, or in a wall-adapter, as long as it can provide at least 500 mA at 5V. Most wall-adapters meet these requirements, so don't worry too much about finding the right one. + +Lastly, find the moisture sensor and a grove cable. Connect it to the Nano Screw Terminal Adapter as follows: + +- Black wire (-) to GND pin. + +- Red wire (+) to Vin pin. + +- Yellow wire to A0 pin. + +![Moisture sensor](./assets/step6.png) + +***Note: The moisture sensor needs to be powered with 5V, and therefore you will need to power it with the same wall adapter that powers the board. This also means that if you're using a different power supply solution than we are suggesting, you should be careful not to exceed 5V or you may damage the sensor, your board, or both.*** + +The complete circuit should look something like this: + +![Circuit for this project.](assets/step7.png) + +If you are using the 3D-printed enclosure we provide a 3D-model for, now is a good time to fit the components inside if you haven't already. Use the standoffs to click the components into place. + +In the top-cover of the enclosure you will find a hole that will fit the LED-Button. Simply push the button into place, it might take a little force but it will firmly click into place. + +We recommend gathering the cables that will leave through the opening, and zip-tying them to the bottom of the enclosure using the two slits in the bottom-plate, this way it stays organised and is a little bit easier to close. + +![GIF of zip-tying the cables](assets/ziptie.gif) + +### IoT Cloud Setup + +If you are new to the Arduino IoT Cloud, check out our [Getting Started Guide](https://docs.arduino.cc/arduino-cloud/getting-started/iot-cloud-getting-started). + +***Note: We also provide a template which you can use to get started without the need to configure the entire IoT Cloud setup manually. Click [here](https://create.arduino.cc/iot/templates/plant-watering-kit) to check out the IoT Cloud Template for an automated setup process.*** + +Begin by navigating to the [Arduino IoT Cloud](https://create.arduino.cc/iot/things). You will need to have a registered account with Arduino to use it. Follow the steps below to set up the Arduino IoT Cloud. + +**1.** Create a new Thing, and select/configure the Nano RP2040 board. Note that the board needs to be connected to your computer during this setup. + +**2.** Create variables according to the table below: + +| Name | Data Type | Function | Permission | +| ----------- | --------- | -------------------------------------- | ------------ | +| watering | boolean | Activate / de-activate pump | Read & Write | +| waterTime | int | How long the pump should run (seconds) | Read & Write | +| moisture | int | Read moisture | Read Only | + +**3.** Enter the credentials to your Wi-Fi network in the network section. + +**4.** Your Thing overview should now look like the following: + +![Thing overview complete.](assets/Things.jpg) + +**5.** Go to the sketch tab, and use the following code: + +***Note: If you copy the code, it is important to make sure the capitalisation and read/write permissions of the variables created in the previous step matches perfectly. Otherwise the sketch will not compile.*** + +```arduino +/* + Arduino Watering Plant Kit + + A setup that allows for remote/local control of a pump, as well as reading sensors. + + Built using the Arduino IoT Cloud service + + Components used: +- Arduino Nano RP2040 Connect +- Arduino Nano Screw terminal Adapter +- 5V submersible pump. +- 1 meter watering pipe. +- USB wall adapter +- Water container. +- Micro-USB cable. +- Open ended USB Cable. +- Soil moisture sensor. +- Grove LED button +- 3D-printed enclosure (optional) +- Short Grove cable (20cm) +- Long Grove cable (50cm) +- Long 3-pronged Grove cable (50cm) +*/ + +/* ------------- START CONFIG ------------- */ +constexpr int BUTTON_PIN = 4; +constexpr int LED_PIN = 5; +constexpr int RELAY_PIN = 6; +constexpr int MOIST_PIN = A0; + + +int raw_moisture = 0; +/* ------------- END CONFIG ------------- */ + +#include "thingProperties.h" +#include + +Bounce b; +unsigned long startedWatering; + +void setup() { + Serial.begin(9600); + delay(1500); + + b.attach(BUTTON_PIN,INPUT_PULLUP); + b.interval(25); + pinMode(LED_PIN, OUTPUT); + pinMode(RELAY_PIN, OUTPUT); + + // Make sure the pump is not running + stopWatering(); + + // Connect to Arduino IoT Cloud + initProperties(); + ArduinoCloud.begin(ArduinoIoTPreferredConnection); + setDebugMessageLevel(4); + ArduinoCloud.printDebugInfo(); + + // Blink LED to confirm we're up and running + for (int i = 0; i<=4; i++) { + digitalWrite(LED_PIN, HIGH); + delay(200); + digitalWrite(LED_PIN, LOW); + delay(200); + } + +} + +void loop() { + ArduinoCloud.update(); + + // Read the sensor and convert its value to a percentage + // (0% = dry; 100% = wet) + raw_moisture = analogRead(MOIST_PIN); + moisture = map(raw_moisture, 610, 90, 0, 100); + Serial.println(moisture); + + // Set the LED behavior according to the moisture percentage or watering status + if (watering) { + digitalWrite(LED_PIN, HIGH); + } else if (moisture > 40) { + // good, LED is turned off + digitalWrite(LED_PIN, LOW); + } else if (moisture > 10) { + // warning, slow blink + digitalWrite(LED_PIN, (millis()%1000)<500); + } else { + // need water, fast blink + digitalWrite(LED_PIN, (millis()%500)<250); + } + + // Stop watering after the configured duration + if (watering && (millis() - startedWatering) >= waterTime*1000) { + stopWatering(); + } + + // Read button status + b.update(); + if (b.changed() && b.read() == false) { // button pressed + if (watering) { + stopWatering(); + } else { + startWatering(); + } + } +} + +// This function is triggered whenever the server sends a change event, +// which means that someone changed a value remotely and we need to do +// something. +void onWateringChange() { + if (watering) { + startWatering(); + } else { + stopWatering(); + } +} + + +void startWatering () { + watering = true; + startedWatering = millis(); + digitalWrite(RELAY_PIN, HIGH); +} + +void stopWatering () { + watering = false; + digitalWrite(RELAY_PIN, LOW); +} + +void onWaterTimeChange() { + // Add your code here to act upon WaterTime change +} + +``` + +**6.** Upload the code. When successful, you can navigate over to the **"Dashboards"** section. Create a new dashboard. + +**7.** Inside the dashboard view, click on **"Add"** then **"Things"** and select your Thing. This will generate a list of widgets and you can click on **"Create Widget"** to complete it. You should now see something similar to this dashboard: + +![Dashboard overview.](assets/dashboard-overview.jpg) + +Once you see the values changing, we know that the connection is successful, and we can monitor and interact with our device. + +Depending on what type of plant you decide to use this device with, you may need to calibrate the threshold values in the code to what is appropriate for your plant. Don't worry, it's not difficult, on line 79 and 82 in the code, numbers are compared to the moisture levels in your plants soil, you can just change those numbers and try different values until you find what is right for you. + +***In this dashboard, we replaced some of the widgets with nicer representations, like percentage.*** + +## Final Setup + +We have now assembled the hardware + configured the Arduino IoT Cloud, and we are ready to start using our setup. Now, let's start using it. + +**1.** If you have confirmed that the connection works, we can unplug the setup from the computer, and move it to the plant we want to monitor. + +**2.** Place the moisture sensor into the soil of the plant. + +**3.** Place the pump inside a water container. Attach the plastic pipe to the pump, and place the other end into the plant pot. Place the enclosure with your electronics next to the plant. Your setup could now look like this: ![Plant setup.](assets/completesetup.jpg) + +**4.** Finally, plug in a USB adapter into the wall. This will now power the entire setup, which should now connect to the IoT Cloud, via your Wi-Fi network. And that is it, you now have a Smart Garden setup! + +## Usage + +Let's take a look at what our Smart Garden can do. To control it, we can either use the dashboard in the Arduino IoT Cloud, or the Arduino Remote app ([Playstore](https://play.google.com/store/apps/details?id=cc.arduino.cloudiot&hl=en&gl=US) / [Appstore](https://apps.apple.com/us/app/arduino-iot-cloud-remote/id1514358431)). + +![Control and monitor your Smart Garden!](assets/Dashboard.gif) + +***In this dashboard, we have also added a chart widget to monitor the soil moisture over time.*** + +**Watering:** to activate the pump, do the following: +- Select number of seconds that you want the pump to run for. +- Click on the switch widget. The pump will now run for `x` amount of seconds, and then it will turn off. +- You can also activate the pump locally with the Grove button. + +**Moisture:** monitor the moisture of your plant: if it is low, turn on the pump, and watch the moisture levels rise. The moisture of your plant can be viewed in the cloud dashboard. + +**Button:** you can activate the pump from without a connection by pressing the button. + + +## Conclusion + +With a smart garden setup, you can easily monitor the environment of your plant, and water it remotely. In this tutorial, we have gone through the basic elements needed for achieving just that: but there are more things you can do. Below is a list of some fun ideas that you can do with your plant: + +- **Automatic watering** - instead of watering your plant remotely, you can also activate the pump automatically whenever moisture drops too low. We do however think it is more fun to control it from a phone, but the choice is yours. +- **Cooling/heating fan** - With some more work, you can connect a cooling/heating fan. This can help you bring the temperature to a perfect level (some plants like it cold, some hot). +- **Humidifier** - a humidifier is an awesome component that increases the humidity (a perfect combo if you also add a humidity sensor). +- **UV lights** - a UV light allows you to grow plants even when there's no natural sun light \ No newline at end of file diff --git a/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/hero-banner.png b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/hero-banner.png new file mode 100644 index 0000000000..50b31b22a5 Binary files /dev/null and b/content/hardware/08.kits/maker/plant-watering-kit/tutorials/iot-smart-garden-setup-with-nanorp2040/hero-banner.png differ