Plant Arm

Made by Jen Liu

The plant arm is a housing device for small household plants that allows for controlled watering on rainy days. A microphone sensor detects when rain hits a roof or rain gutter and triggers the arm to swing out.

Created: September 15th, 2015

0
0

This project is a housing device for household plants to allow for controlled watering on rainy days.  Instead of having a to remember to water your plants, a microphone sensor will detect the sound of rain hitting against a roof.  When the threshold is reached, the arm will move out and allow the plant to receive a certain amount of water before retracting.  

Future iterations of this project can include different parameters such as how much water a plant receives, shutting the device off after the plant is watered a certain amount of times, and prevent the device from operating if it is raining too hard.  Constructing the device out of different materials such as acrylic plastic could be another potential change as well. 

Materials:  Plywood, microphone, wires, Arduino, servo motor 

0
#include <Servo.h>

const int numReadings = 10;

int readings[numReadings];      // the readings from the analog input
int index = 0;                  // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average
int inputPin = A2;              //mic input pin
int ledPin = 6;
int angle = 0;                      //initial position of servo
int threshold= 40;           
Servo myservo;

void setup()
{
  // initialize serial communication with computer:
  Serial.begin(9600);     
  pinMode(ledPin, OUTPUT);   
  pinMode(A2, INPUT);           
  myservo.attach(9); 
  myservo.write(0) ;

  for (int thisReading = 0; thisReading < numReadings; thisReading++)
    readings[thisReading] = 0;          
}

void loop() {
 
  total= total - readings[index];         
  readings[index] = analogRead(A2); 
  total= total + readings[index];        
  index = index + 1;                    

  if (index >= numReadings){           

    index = 0;}                           
    
  average = total / numReadings;         
  
  int newAvg = map(average, 0 , 1023, 0, 255);
  
    
  Serial.println(newAvg);   
  delay(15);  
  
if (newAvg>threshold){
    myservo.write(180);
    delay(10000);
    myservo.write(0);
    delay(100000);
    newAvg = 0;
  }
    

  analogWrite(ledPin, newAvg);
  
            
}
Click to Expand
x
Share this Project

Found In
Courses

48-739 Making Things Interactive

· 0 members

Making Things Interactive (MTI) is a studio course based on physical prototyping and computing. You will develop novel sensing, interaction and display techniques through projects and short assignm...more


About

The plant arm is a housing device for small household plants that allows for controlled watering on rainy days. A microphone sensor detects when rain hits a roof or rain gutter and triggers the arm to swing out.