Automated Garden


Automated Garden


This project is an example of Ethernet shield.
User can manage his garden easily by using Arduino platform through Web.
This project would be included in IoT category of WIZnet Museum.

Hardware components:

-. Arduino UNO & Genuino UNO

-. Arduino Ethernet Shield2

-. Raspberry Pi

-. Sensors

Software apps and online services:

-. Arduino IDE

-. Raspberry Pi Raspbian

-. Cayenne







#include "DHT.h"//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include </p><p>#define DHTPIN 8     // what digital pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321</p><p>#define VIRT_TEMP V1
#define VIRT_HUM V2</p><p>// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "your toker";</p><p>DHT dht(DHTPIN, DHTTYPE);
unsigned long prev_DHT_refresh, interval_DHT_refresh = 1000;</p><p>void setup()
  Cayenne.begin(token);</p><p>  dht.begin();
}void loop()
{;</p><p>  getDhtValues();</p><p>}</p><p>void getDhtValues() {
    unsigned long now = millis();
  if (now - prev_DHT_refresh > interval_DHT_refresh) {
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    float h = dht.readHumidity();
    // Read temperature as Celsius (the default)
    float t = dht.readTemperature();   // Check if any reads failed
    if (!isnan(h) && !isnan(t)) {
      Cayenne.virtualWrite(VIRT_HUM, h);
      Cayenne.celsiusWrite(VIRT_TEMP, t);
    prev_DHT_refresh = now;


Setup the Raspberry Pi

Let’s do a time lapse of the plant growing.

3 Software:

  • Putty to connect in remote to the Raspberry WIn32 disk imager:

After downloading, install it. Open it:

1. You will see “device”. In general, the default is good (if you only have the SD card connected)

2. Click on the blue icon folder and select the Raspbian Jessie image you have downloaded

3. Click write and it’s done. You can now insert the card to the Raspberry.

Putty: It allows us to connect via SSH, open Putty (no need to install).

  • Connect internet cable to the Raspberry
  • You need to find the IP of the Raspberry 2 the easy way:
  • Connect to your box interface you will be able to see the device with the IP
  • Connect the touchscreen and keyboard go to terminal then ifconfig.Now in Putty enter the IP address. It will be something like then enter.
  • It will ask to trust, click yes


If you want to know more in detail, refer to



Collected by Jim:


Please Login to comment
Notify of