Description:
For this homework I thought to attach the DC Motor to a small plant and have the pot adjusted so that it moves very slowly. When plants grow, they tend to grow crooked since they grow where there's more sun. The purpose of this plant rotator would so that the plant will grow evenly and straight so that all sides of the plant have equal sun exposure.
Components:
1x Arduino
1x DC Motor
1x Resistor
1x diode
1x Transistor
1x Plant (I have a dead leaf in the picture)
1x Plantform (platform for a plant!)
Code:
int potPin = 0; // select the input pin for the potentiometer
int plantPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(plantPin, val/4); // analogWrite can be between 0-255
}
- Login to post comments