As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Wednesday, June 11, 2014

Anjelica & Albert: Posh Plant Video

After initially not knowing the direction of our project, Albert and I decided to create a planter that would alert users of its water needs. When comparing our end product to our initial diagram, the concept changed very little, if at all. Essentially, the Posh Pot (named because our current version is British and snarky) detects the moisture levels in the potted plant's soil. Albert and I crafted our own moisture sensor by using spare copper wire,two nails, and some electrical tape. If the soil is acceptably damp, the planter turns on 3 blue LEDs. However, if the soil is too dry or too wet, the plant will comment on its state when someone walks by. This is detected through the motion sensor located in the front of the housing. The Arduino and wires are all housed in the base of the planter.















http://youtu.be/PK-YXzXmMmo


1 comment:

  1. Here's our code for the planter. We could spend hours, days even, staring at our code wondering why something wouldn't work - - - only to find out that it was a hardware problem causing the malfunction. Such frustration, such a good learning experience :).

    // Albert & Angelica, DESIGN 387 (Muren)
    // 'Posh Pot'
    // Code for a "smart" planter pot. Planter will say different phrases depending on the soil's moisture level.
    // Planter lights up blue when the ideal moisture range is reached.

    #include // SPI library
    #include // SDFat Library
    #include // SDFat Util Library
    #include // Mp3 Shield Library

    SdFat sd; // Create object to handle SD functions.
    SFEMP3Shield MP3player; // Create Mp3 library object.

    // These variables are used in the MP3 initialization to set up some stereo options:
    const uint8_t volume = 0; // MP3 Player volume 0=max, 255=lowest (off).
    const uint16_t monoMode = 1; // Mono setting 0=off, 3=max.

    int ledPin = 10; // Choose the pin for the LED.
    int inputPin = 5; // Choose the input pin (for PIR sensor).
    int moisturePin = 5; // Choose the analog input pin for moisture sensor.

    int val = 0; // Variable for reading the pin status.
    int moisture = 0; // Moisture level readings from sensor.
    int waitTime = 4000; // The amount of time the program will wait after 1 loop. Decrease this to increase file playback frequency.

    // Initializes SD Card, MP3 Player Shield, pins, and Serial Port.
    void setup() {
    initSD();
    initMP3Player();
    pinMode(inputPin, INPUT);
    pinMode(ledPin, OUTPUT);
    Serial.begin(9600);
    }

    // Chooses and plays a sound file depending on the moisture level of the soil.
    // Turns on blue LEDs if the ideal moisture level is achieved.
    void loop() {
    val = digitalRead(inputPin);
    moisture = analogRead(moisturePin);

    // Shows the detected moisture level in the Serial Monitor. Used for debugging purposes.
    // Serial.println(moisture);

    if (val == HIGH) {
    if (MP3player.isPlaying())
    MP3player.stopTrack();

    if (moisture < 5) {
    uint8_t result = MP3player.playTrack(1);
    } else if (moisture >= 5 && moisture < 75) {
    uint8_t result = MP3player.playTrack(2);
    } else if (moisture >= 75 && moisture < 150) {
    uint8_t result = MP3player.playTrack(3);
    } else if (moisture >= 150 && moisture < 225) {
    uint8_t result = MP3player.playTrack(4);
    } else if (moisture >= 225 && moisture < 400) {
    uint8_t result = MP3player.playTrack(5);
    } else {
    if (moisture >= 400) {
    int ran = random(6, 9);
    uint8_t result = MP3player.playTrack(ran);
    }
    }
    } else {
    MP3player.stopTrack();
    }

    // Turns on LEDs if the soil moisture level is within the ideal range.
    if (moisture >= 225 && moisture < 400) {
    digitalWrite(ledPin, HIGH);
    } else {
    digitalWrite(ledPin, LOW);
    }
    delay(waitTime);
    }

    // Initializes the SD card and checks for errors.
    void initSD()
    {
    //Initialize the SdCard.
    if(!sd.begin(SD_SEL, SPI_HALF_SPEED))
    sd.initErrorHalt();
    if(!sd.chdir("/"))
    sd.errorHalt("sd.chdir");
    }

    // Sets up all of the initialization for the
    // MP3 Player Shield. It runs the begin() function, checks
    // for errors, applies a patch if found, and sets the volume/
    // stero mode.
    void initMP3Player()
    {
    uint8_t result = MP3player.begin(); // init the mp3 player shield
    if(result != 0) // check result, see readme for error codes.
    {
    Serial.println("Error with MP3 player initializion. See readme.");
    }
    MP3player.setVolume(volume, volume);
    MP3player.setMonoMode(monoMode);
    }

    ReplyDelete