Water pilly is an assistive outdoor ornament for people suffering from allergic asthma caused by environmental fungi ‘Altenaria’. 

It constitutes a mechanical flower, opening and closing in response to the degree of humidity in the atmosphere, notifying the patients when they have to  take antihistamine and how much.

The project applied for me a creative platform to experiment with new things such as organic design, construction and engineering concepts for organic design, 3d printing, improvising with new electronics and libraries, as also combining them with components we had already learned in class such as ‘maintained’ switches, potentiometers as threshold, and LCD screens.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

petals_construction details_digital model

petals_construction details_physical model

stepper motor_axis rotation_back and forth

axis_bidirectional rotation_strings wrapping_ pull & push petals

1) humidity sensor__humidity & temperature index, 2) ‘maintained switch’__on/off according to being/not being sick__ pill increase/decrease, 3) analog potentiometer__patient’s tolerance to humidity__increases/decreases according to sickness mode, 4) LED on/off__open/close, 5) A4988 chip__stepper motor

 humidity>tolerance_petals open_1 pill

 humidity>tolerance_sickness mode is on_petals open_2 pill (double dose)

fast speed_emergent distortion_petals overlap

total view

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

 

Soon I discovered that the most valuable lessons for me were the followings:

  • The exploration and learning process of new components (humidity sensor, stepper motor). I had to figure out how each of them functions, gets wired and which library is the most appropriate for the current use.
  • Another point of great importance, was learning how to deconstruct a difficult concept (flower’s operation) into simpler steps (read of humidity, read of switch, read of potentiometer, write on LCD screen etc.). This strategy was really helpful and allows to compose any concept out of the co-ordination among smaller units.
  • However, I found quite challenging to make all the different components co-ordinate with each other in order for the flower to open and close according to the original concept. After accomplishing that,
  • I also realized that the uneven length of the strings wrapping around, made it difficult to absolutely estimate how many turns the motor needed to rotate in order for the petals to close and reopen. Therefore, I experienced a difficulty in debugging the petal’s opening and closing activity.
  • Eventually, the project offered me the opportunity to learn how to examine emerged ‘bugs’ caused either by wrong wiring connections, ‘cooked’ components or ‘heavy workloads’. I also experienced when I have to integrate an unpredictable, emergent behavior into my concept. For instance, LCD screen seriously delayed the motor’s velocity. However, without this delay and due to the uncontrollable wrapping of the strings, the flower’s form was feasible to get distorted, even break. This ‘wrong behavior’ of the motor, offered a safety degree to the whole construction.
  • I found other pupils’ critic a very good method to understand how I could improve my device. I cite here the following examples:
    • The physical design of the pill mechanism is gorgeous, the other electronics a bit less so, it might be better to incorporate all the electronics somewhere into your case.The opening is a bit slow, but I really like watching it anyways.”

 I really liked the idea to perceive the electronics as an integral part of the flower’s physical design. That was a good motivation for me to start soldering the components on thin boards and attach them onto the parts of the final construction. I separated the components into two categories, those that should be directly exposed because they cause physical interaction (humidity sensor, switch) and those which needed more protection (Arduino, LED, LCD etc.). On these grounds, I placed them either on the upper levels of the construction or deeper in that.

    • The flower design is very appealing and original. Its function could be tweaked to be more reliable, and the device is rather big, but the idea is great.

I totally agree that the mechanism needs some slight modifications in order to become more reliable. I should reconsider the starting position (close or open) of the flower, the degree and the velocity of the rotation, as well as the length of the strings and their even wrapping. However, I disagree with the part about the device’s size. For the petals to be 3d printed properly, without breaking and with preserving harmonic proportions between length and thickness, I firmly believe that this is a sufficient size.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

 Self critic:

During this project, I realized 1) my affinity for exploring new components, figuring out how to make them work and interact with each other, exchanging values. 2) I also experienced a confusion whenever a ‘bug’ appeared. That made me consider to create a better strategy for ‘debugging’. I should create a list of checks for inspecting bugs and excluding potential reasons for errors.

In general lines, I am quite satisfied with the project’s outcome. However, next time I will spend more time in organizing a detailed engineering strategy, to decrease the amount of possible ‘motion errors’ arising in kinetic devices like this. Furthermore, I will experiment more with the mechanical motion in situ in order to calibrate it better and adjust it to the given circumstances. Finally, in my next projects I will try to integrate the electronics into the physical model from the early beginning, either fully designating them or hiding them.

Next steps:

In the future, I would like to iterate the same concept, but instead of creating mechanical motion for opening and closing the flower’s petals, I will produce shape transformation using morphing materials. On the grounds, humidity will be turned into energy (heat) and energy into physical transformation (motion).  Finally, this time the design would constitute an indoor ornament, that wirelessly receives the humidity and temperature information from the outdoor environment.

 

 

 

 

 

 

 

 

 

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

 

schematic diagram_circuits

/*
  Project title: Water pilly
  Intro to Physical Computing @ Carnegie Mellon University

  Made by Maria Vlachostergiou

  Inputs:
  Arduino pin | Input
     2         Humidity sensor (DHT22)
     A0        Potentiometer
     13        Switch

  Outputs:
  Arduino pin | Output
     7         LED
     4         Motor step
     3         Motor direction

  Step1: We measure humidity degree, the state of potentiometer and switch.
  Step 2: According to four different conditions, the stepper motor rotates in two different directions, back and forth.
  Step 3: The LCD screen shows how many pills the patient has to take.
*/

// humidity sensor
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
float humidity;
float temperature;
float fahrenheit;

// Stepper motor
#include <AccelStepper.h>
#define STEP_PIN 4
#define DIRECTION_PIN 3
AccelStepper flowerActivity(1, STEP_PIN, DIRECTION_PIN); // it conducts 200 steps per revolution
float turns = 1.1;
int initialPos = 200 * turns; // the motor starts at 0

// maintained button for illness
#define SWITCH_PIN 13
int switchMode;
int isSick = false;
int amountOfPills = 0;

// potentiometer that evaluates the tolerance toward humidity
/* when being sick, a lower degree of humidity might cause
  // more regular and intenser asthma episodes*/
#define POT_PIN A0
int tolerance;

// LED, it turns on when himidity is higher than patient's tolerance
#define LED_PIN 7

// I²C LCD, prints out the amount of pills the patient has to take
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C myLCD(0x27, 20, 4);

/*********************************************************************************/

void setup() {
  // pinModes
  pinMode(SWITCH_PIN, INPUT);
  pinMode(POT_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);

  // initialize humidity sensor
  dht.begin();

  // Serial.begin(9600);

  // initialize stepper motor
  flowerActivity.setMaxSpeed(400);
  flowerActivity.setAcceleration(50);
  flowerActivity.moveTo(initialPos);

  //initialize LCD
  myLCD.init();

} // void setup

/********************************************************************************/

void loop() {
  // delay the reading of sensors
  //delay(500);

  // motor starts
  flowerActivity.run();

  // Read potentiometer and fix a tolerance
  int t = analogRead(POT_PIN);
  tolerance = map(t, 0, 1023, 0, 100);

  // Read humidity sensor, compute heatindex and serially print the necessary data
  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  fahrenheit = dht.readTemperature(true);
  // in case that the humidity sensor fails to read
  if (isnan(humidity) || isnan(temperature) || isnan(fahrenheit)) {
    Serial.println("Sorry, something is wrong! Failed to read from sensor!");
    return;
  }
  float hif = dht.computeHeatIndex(fahrenheit, humidity);
  float hic = dht.computeHeatIndex(temperature, humidity, false);

  Serial.print("Humidity is: ");
  Serial.print(humidity);
  Serial.print(" %,\t");
  Serial.print("Temperature is: ");
  Serial.print(temperature);
  Serial.print(" *C\t");
  //Serial.print(fahrenheit);
  //Serial.print(" *F\t");
  //Serial.print("Heat index: ");
  //Serial.print(hic);
  //Serial.print(" *C or ");
  //Serial.print(hif);
  //Serial.print(" *F,\t");

  // Read the switch
  switchMode = digitalRead(SWITCH_PIN);
  if (switchMode == 1) {
    isSick = true;
  } else {
    isSick = false;
  }

  // Compute and print the amount of Pills, open and close the flower, adjust the LCD
  Serial.print("Tolerance to humidity: ");
  Serial.print(tolerance);

  myLCD.home();
  myLCD.print(humidity);
  myLCD.setCursor(4, 0);
  myLCD.print("% Humidity!");
  myLCD.setCursor(0, 1);
  myLCD.print(tolerance);
  myLCD.setCursor(2, 1);
  myLCD.print("%: Your tolerance");

  if ((humidity < tolerance) && (isSick == false)) // condition 1
  {
    flowerActivity.moveTo(initialPos);
    amountOfPills = 0;
    digitalWrite(LED_PIN, LOW);

    myLCD.noBacklight();
    myLCD.setCursor(0, 3);
    myLCD.print("Not being sick");
  } // condition 1

  else if ((humidity < tolerance) && (isSick == true)) // condition 2
  {
    flowerActivity.moveTo(0);
    amountOfPills = 1;
    Serial.println("\tYou are sick. Take 1 pill!");
    digitalWrite(LED_PIN, LOW);

    myLCD.backlight();
    myLCD.setCursor(0, 2);
    myLCD.print("You are sick");
    myLCD.setCursor(0, 3);
    myLCD.print("Take 1 pill!");
  } // condition 2

  else if ((humidity >= tolerance) && (isSick == false)) // condition 3
  {
    flowerActivity.moveTo(0);
    amountOfPills = 1;
    Serial.println("\tHumidity is over your tolerance. Take 1 pill!");
    digitalWrite(LED_PIN, HIGH);

    myLCD.backlight();
    myLCD.setCursor(0, 2);
    myLCD.print("High humidity");
    myLCD.setCursor(0, 3);
    myLCD.print("Take 1 pill!");
  } // condition 3

  else if ((humidity >= tolerance) && (isSick == true)) // condition 4
  {
    flowerActivity.moveTo(0);
    amountOfPills = 2;
    Serial.println("\tBoth sick & Humidity over tolerance. Take 2 pills!");
    digitalWrite(LED_PIN, HIGH);

    myLCD.backlight();
    myLCD.setCursor(0, 2);
    myLCD.print("High humidity & sick");
    myLCD.setCursor(0, 3);
    myLCD.print("Take 2 pill!");
  } // condition 4

  if (flowerActivity.currentPosition() == initialPos)
  {
    Serial.println("\tFlower closed");
  } else {
    Serial.println("\tFlower opened");
  }

} // void loop

/********************************************************************************/