DIY Plantduino

Basic essence of this project was to let me know when I need to water my plants and to ensure I don’t over water them. I’ll put the code up in a bit. This early version is a very ugly prototype with lots of wires running around for sake of quick development (so please don’t judge).

Made with Femtoduino. Connections are uber simple. Moisture sensor is available on eBay for really cheap. All you do is run your normal VCC and GND lines. Add analog read input on microcontroller A0 to sensor and you’re off and away. Entire project cost about $35 and took about 2 hours to completely assemble. LEDs are running through D5 and D9. You can skip the LEDs if you want and just use serial monitor as feedback but then it’s not very portable.

Next version would be to add WIFI and have each plant in my home tweet me when it needs water. I’m waiting for my Spark Cores to arrive (which have been delayed due to manufacturing issue) so I’ll have to be patient.

20140324-064350.jpg     20140324-064401.jpg

20140325-182732.jpg

Quick disclaimer on the code below: it is messy. I was looking to make it graphical like a dashboard which is why there’s value repetition. The sensor gives you a reading like 983 (for example) and rather than deal with massive ranges, I was going to have it display as just 9. Anyways, I’ll fix it later, I just didn’t want any confusion.

/*
  # Example code for the moisture sensor
  # Connect the sensor to the A0(Analog 0) pin on the Arduino board

  # the sensor value description
  # 0  ~300     wet soil
  # 300~800     humid soil
  # 800~1000    dry water
  # D5 Red LED for water
  # D9 Green LED for no water
*/

int nowaterPin = 9; //initializes green LED
int waterPin = 5; //initializes red LED
int analogPin = A0; //initializes sensor analog input

void setup(){
  pinMode(waterPin, OUTPUT);
  pinMode(nowaterPin, OUTPUT);
  Serial.begin(57600); //make sure your serial monitor is set to this baud rate. 

}

void loop(){

  digitalWrite(waterPin, LOW);
  digitalWrite(nowaterPin, LOW);
  int analogValue1 = analogRead(analogPin);
  int analogValue = analogValue1; // putting this here for future value manipulation
  Serial.print("Water Priority: ");
  Serial.println(analogValue);  

  //if sensor reading is greater than 700, time to water, turn on redPin as water needed
  if (analogValue > 700){
    digitalWrite(waterPin, HIGH);
    digitalWrite(nowaterPin, LOW);
    Serial.println("Water Immediately");
    Serial.println("");
  }
  //if sensor reading is less than 700, it is moist enough, turn on greenPin as ok
  else {
      digitalWrite(nowaterPin,HIGH);
      digitalWrite(waterPin, LOW);
      Serial.println("No Water Needed");
      Serial.println("");

  }

  //1000 milliseconds is 1 second, modify as needed. 60000 ms is 1 minute
  delay(1000);

}
Tagged , ,

7 thoughts on “DIY Plantduino

  1. sven says:

    Seriously? I love this! Keep posting, man!

  2. sven says:

    Where did you buy the femtoduino?
    They seem to be out of stock. Is there any shop in Europe to get one?

    Oh, I’d really appreciate it if you’d upload bigger pictures. Thank you!

    • ohmyfarads says:

      I bought it directly from Femtoduino.com – they’re worth the wait and I’m sure they’ll ship to Europe. If not, bummer. Spark.io is another alternative and it has WIFI built in.

  3. Fardon Heli says:

    I do wish people would stop putting that stupid ‘duino ending on these devices. It is really quite too much these days and shows the lack of imagination rampant in this little area of electronics.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: