Outdoor Conductivity Fun!


Originally Posted: APRIL 22, 2010

This quarter’s Physical Computing class is focusing on making interactive music.  The first topic is resistance.  We’ve gone over what a regular circuit resistor is and now we’re testing the resistance/conductivity of everything else.  Today we a simple circuit to test the conductivity of plants outside.  It was amazingly successful and fun.

Students hypothesized that tree bark would work as a good conductor.  They felt that the leaves might not be good conductors because they are meant to fall off each year so they’re probably not connected as well.  We headed outside and ran a lot of fun tests and found that the leaves not only conducted electricity very well, but students we could form a long student chain and touch the grass 20 feet away and still complete the circuit with little resistance.

More experiments to come and posts with code and videos.

int buzz = 3;
int sensor = 0;
int threshold = 20;
 
void setup(){
 Serial.begin(9600);
}
 
void loop(){
 int sVal = analogRead(sensor);
 int sVal2 = 0;
 
 for(int x=0; x < 20; x++){
 int sVal = analogRead(sensor);
 sVal2 = sVal2 + sVal;
 delay(1);
 }
 
 sVal2 = sVal2/21;
 
 Serial.print("sval = ");
 Serial.print(sVal);
 Serial.print("\t");
 Serial.print("sval2 = ");
 Serial.println(sVal2);
 
 if(sVal2 > threshold){
 tone(buzz, sVal2);
 } else {
 noTone(buzz);
 }
}