Saturday, June 15, 2013

ArduGarden (Gardening assited by arduino) Vol I

Simple idea to assist gardening projects using arduino: get moisture, temperature and other measurements and get alarms, display even use them via networking.

This first step attempted and succeded in getting moisture readings of the soil.

Parts needed:

  • 2 galvenized nails.
  • Wires
  • Arduino 1
  • 1 10k ohm resistor
  • 1 100 ohm resistor
  • Usual tools: clipper, soldering iron.

Step 1 Prepare the nails.

You will need 2 nails that will act as soil moisture probes. You can use any kind of conductive nail that you have lying around, but we recommend using galvanized, hot dipped nails, which are more resistant to corrosion.


-Wrap the wire around the nail and be sure to take the time to heat up the nail as opposed to just heating up with wire and spreading the solder on the wire alone.  This prevents the wire from fusing with the nail and provides an opportunity for the wire to slip off of the nail.
-You'll know that the wire is hot once you touch the solder to the nail and it begins to flow. 
-Work your way around the entire nail connecting the wire.

Note: We are still looking for a better metal that doesn't degrade because of electrolysis.  If you have any suggestions please shoot them our way.

Step 2 Circuits

I based my idea on this:
Thanks ROB, check his blog for more info.
The 2222N transistor pinout goes like this:

Step 3 Software

//Coded by Alejandro Zanotti
//Based on the ideas Shown on this post,37975.0.html and this tutorial
//Version 1.0 
//Date 15 Jun 2013

const int sensorpin=0;
int moisture=0;
int lastWaterVal=0;

#define MOIST 450 // minimum level of satisfactory moisture
#define DRY 350  // maximum level of tolerable dryness
#define SOAKED 600 // minimum desired level after watering
#define WATERING_CRITERIA 100 // minimum change in value that indicates watering

void setup (){
  Serial.println("Soil Moisture Module v1: Loaded");

void loop (){
      if (moisture >= SOAKED  &&  lastWaterVal < MOIST) {
        Serial.println("Thank you for watering me!");  
      else if  (moisture >= SOAKED  &&  lastWaterVal >= MOIST ) {
        Serial.println("You over watered me");
      else if  (moisture < SOAKED  &&  lastWaterVal < MOIST ) {
        Serial.println("You didn't water me enough");   
    lastWaterVal = moisture; // record the watering reading for comparison next time this function is called

  delay (5000);

Actual pictures of it working:

Serial monitor:

No comments:

Post a Comment