ProtoPalette

Soil Sentry

ProtoPalette Soil Sentry kit

What’s in the tube?

  • Arduino Nano
  • 4 5mm LEDs
  • ProtoPalette Kit Base
  • ProtoPalette MultiStalk
  • Jumper Wires
  • 9 Volt Battery Connector
  • Project Box
  • Mini USB Cable
  • Moisture Sensor
  • 3D-printed mounting base

 

 

Understand the Arduino Code

/*
ProtoPalette.com
Soil Moisture Sensor

Connect Analog Pin A0 from Arduino to the Soil Moisture Sensor Pin "AO" or sometimes "AC"
Connect 5V from Arduino to Soil Sensor Pin "VCC"
Connect Ground from Arduino to Soil Sensor Pin "GND"

Connect Arduino Pins D2 through D6 to the Anode (+) side of LEDS 1,2,3,4,5
Using a 10,000 Ohm Resistor, connect Arduino Ground to Shared Rail on Breadboard
Connect the Cathode (-) side of LEDs to the shared Ground Rail on the Breadboard

Pick any colors you like, we used:
LED1 - Yellow (too dry)
LED2 - Green (comfort zone)
LED3 - Green (comfort zone)
LED4 - YELLOW (a bit too moist)
LED5 - RED (yikes! too wet!)

Connect the Soil Mosture Sensor to anolog input pin 0,
and your 5 led to digital out 2-6
*/

int led5 = 2;
int led4 = 3;
int led3 = 4;
int led2 = 5;
int led1 = 6;

int mostureSensor = 0;

void setup() {
// Serial Begin sends the moisture sensor data to the Serial Monitor. We can see that information and do things with it if we like.
Serial.begin(9600);
// Here is where we tell Arduino that these digital pins are going to be outputs.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}

// This loop routine repeats forever, or until you turn the thing off:
void loop() {
// Hey Arduino! Please read the input on analog pin 0:
int sensorValue = analogRead(mostureSensor);
// Now, print out the value you just read. That way, we can do things with that information:

Serial.println(sensorValue);

if (sensorValue >= 820)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(25);
digitalWrite(led1, LOW);
delay(22);
digitalWrite(led1, HIGH);
delay(35);
digitalWrite(led1, LOW);
delay(44);
digitalWrite(led1, HIGH);
delay(21);
digitalWrite(led1, LOW);
}
else if (sensorValue >= 615 && sensorValue < 820) { digitalWrite(led1, HIGH); digitalWrite(led2, HIGH); digitalWrite(led3, LOW); digitalWrite(led4, LOW); digitalWrite(led5, LOW); } else if (sensorValue >= 410 && sensorValue < 550) { digitalWrite(led1, HIGH); digitalWrite(led2, HIGH); digitalWrite(led3, HIGH); digitalWrite(led4, LOW); digitalWrite(led5, LOW); } else if (sensorValue >= 350 && sensorValue < 550) { digitalWrite(led1, HIGH); digitalWrite(led2, HIGH); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, LOW); } else if (sensorValue >= 0 && sensorValue < 350) { digitalWrite(led1, HIGH); digitalWrite(led2, HIGH); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); } delay(1000); // Wait one second, then start the whole thing over again, please. }

 

 

Assemble the Components

Soil sentry assembly instructions

1 Responses on Soil Sentry"

  1. Profile photo of Ben Pawsey Ben Pawsey says:

    If you’re stuck or have any questions about the Soil Sentry kit leave a message here and we’ll troubleshoot together!

Leave a Message

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Copyright © ProtoPalette EdTech, Inc. All Rights Reserved