Plantduino Greenhouse

Step 5: Moisture Sensors

I first soldered a wire to each of two galvanized nails. This took a couple of tries but the secret is to scrape off some of the galvanized coating from where you want to solder with a knife. This helps the solder stick to the nail.

Next, hook the nails up to the breadboard and the breadboard to the arduino. Check out the pictures for a diagram. We connected the nails to analogue input 0 and used the pin 13 LED as an output.

Then be joyful and celebrate.

int moistureSensor = 0;
int moisture_val;

void setup() {
Serial.begin(9600); //open serial port
pinMode (13, OUTPUT);

void loop() {
moisture_val = analogRead(moistureSensor); // read the value from the moisture-sensing probes
Serial.print("moisture sensor reads ");
Serial.println( moisture_val );

if (moisture_val < 600){
  digitalWrite (13, HIGH); //soil is too dry- turn on LED
  digitalWrite (13, LOW); // soil is saturated- turn off LED


Test the nails using dry, perfect, and water saturated soils. You will want to calibrate your soils to your own watering habits and garden needs. These numbers are completely dependent on your own nail specs though.

Hook it all up:

We had to buy a nozzle that connected the solenoid valve to the hose. The irrigation drip tubing we bought at home depot attached perfectly to the other end of the valve. You can make your own irrigation tubing by buying some plastic or rubber hose and poking holes into it. Plug the 12V wall wart into the relay box. Make sure you use the socket that is connected to the right arduino ports. For our relay box the top outlet goes to the bottom set of wires and the bottom outlet goes to the top set of wires.



Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s