GMU:Bioelectronics, aesthetics and other interesting things/Philipp Schmalfuß: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 36: | Line 36: | ||
The received data is stable enough to set thresholds for simple if-else conditions in the arduino code, but with the disadvantage that it has to be adjusted form time to time. | The received data is stable enough to set thresholds for simple if-else conditions in the arduino code, but with the disadvantage that it has to be adjusted form time to time. | ||
void setup() { | void setup() { | ||
pinMode(13, OUTPUT); | |||
pinMode(13, OUTPUT); | |||
Serial.begin(9600); | |||
} | Serial.begin(9600); | ||
} | |||
void loop() { | |||
void loop() { | |||
int plant = analogRead(A0); | int plant = analogRead(A0); | ||
Latest revision as of 10:37, 15 July 2016
Self-defence system for plants
Self defence system for plants
The goal of this project was to use a houseplant as a touch sensor via meassuring resistance changes inside the plant. When it gets touched by any other living organism an attached motor will rock the plantpot. This sudden reaction is likely to shake off any potential predator.
Materials
plant and plantpot, sponges, motor (DC Motor Johnson - NF), cupper plate, cables and wires, 220 Ohm resistor, transistor BDX 53 C, Arduino
Project details
I started experimenting with Martin Howse's circuit for microvoltage resistance measurement and displaying the outcome with the help of a simple Pure Data patch.
The "arduino" object used in this patch is part of the pduino project.
Martin Howse's circuit:
Although there was a certain reaction to the enviroment the received data was so chaotic and unpredictable that it was not possible for me to logicaly seperate the meassured reactions to touch from the rest.
After some further experiments i ended up with a rather simple circut, ignoring all i've learned about voltage dividers.
An cupper plate electrode is plunged in the soil beneath the plant and a needle, sticked in a branch of the plant is connected to one of arduinos analog inputs. The received data is stable enough to set thresholds for simple if-else conditions in the arduino code, but with the disadvantage that it has to be adjusted form time to time.
void setup() { pinMode(13, OUTPUT); Serial.begin(9600); } void loop() { int plant = analogRead(A0); Serial.println(plant); if(plant < 900 && plant > 850) { digitalWrite(13, HIGH); delay(10); digitalWrite(13, LOW); } else { digitalWrite(13, LOW); } }
Pin 13 is switching the motor on when the plant gets touched. The motor is out of balance and attached to the plantpot (a motor directly attached to the plant would eventually break it).
A sponge underneath the plant pot will let the whole thing slightly move around.