Thomas sxt
Published © GPL3+

Automated Garden

Gardening is a very long term project taking a little time every day. Why not automate it?

BeginnerFull instructions provided4 hours38,451
Automated Garden

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Raspberry Pi 2 Model B
Raspberry Pi 2 Model B
Any should work
×1
Camera Module
Raspberry Pi Camera Module
×1
Arduino Ethernet Shield 2
Arduino Ethernet Shield 2
×1
Relay (generic)
×1
Wire Cable - By the Foot
OpenBuilds Wire Cable - By the Foot
×1
Photo resistor
Photo resistor
×1
Water pump (generic)
×1
fan (generic)
I used the one from an old computer.
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1
MicroSD Card (Generic)
16 Gb for time lapse
×1

Software apps and online services

Arduino IDE
Arduino IDE
Raspbian
Raspberry Pi Raspbian
win32diskimager
putty
Cayenne
myDevices Cayenne

Story

Read more

Code

Code snippet #1

Arduino
<p>#include "DHT.h"<br>//#define CAYENNE_DEBUG         // Uncomment to show debug messages<br>#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()
{
  Serial.begin(9600);
  Cayenne.begin(token);</p><p>  dht.begin();
}</p><p>void loop()
{
  Cayenne.run();</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();</p><p>    // Check if any reads failed
    if (!isnan(h) && !isnan(t)) {
      Cayenne.virtualWrite(VIRT_HUM, h);
      Cayenne.celsiusWrite(VIRT_TEMP, t);
    }
    prev_DHT_refresh = now;
  }
}</p>

Code snippet #9

SH
SAVEDIR=/home/pi/Desktop/timelapse/

while [ true ]; 

do filename=-$(date -u +"%d%m%Y_%H%M-%S").jpg
/opt/vc/bin/raspistill -o $SAVEDIR/$filename
sleep 3600;
done;

Credits

Thomas sxt

Thomas sxt

7 projects • 24 followers
🔩Maker Arduino Rasp. 🖨️3DPrint/design creation ! My STL:https://cults3d.com/fr/utilisateurs/diyfunproject 📲WEBSITE:diyfp.fr/thomassxt

Comments