Wednesday, February 4, 2009

Interactive Toilet (ITOI) by Tarek & Ivan

Hi guys, 

Here is all the information about our project. If you need any more information or diagram just let me know. 
First, the video:



Abstract:

According to Erica Goode in The New York Times in January 12, 1999 parents face a big struggle when they try to help their kids to learn how to use the toilet and control their bladder. Thus, parents need a new inexpensive technique able to help them to overcome this dilemma. Finding a new tool to facilitate this issue becomes urgent. The ITOI (Interactive TOIlet), is a new device that has the basic interactive components to help kids learning and feeling happy when using the toilet. ITOI is a reduced version of the toilet lid that can detect the presence of a kid sitting on it, reacting to his actions. The interaction is composed of four stages: (1) LEDs that show the status of the ITOI; (2) Action sensors that detect any deposit from the kid; (3) Musical response as a reaction to the success after using the ITOI; and (4) the hand-shaking and paper-dispensing arms as the final stage of success. That’s simply the ITOI2009, a reinvention of the traditional toilet! 

ITOI Scenario: Miranda and her 2 year-old daughter Linda

 

  1. Linda sits down on the ITOI.
  2. The red LED goes on, and then the ITOI is waiting.
  3. When Linda uses the ITOI and she deposits something in the toilet, the yellow LED goes on to give Miranda an indication that her daughter is using the toilet now.
  4. Then the music starts "If you are happy and you know it clap your hands….."
  5. The Hand-Shaking Arm rotates to shake Linda’s hand.
  6. Then the Paper-Dispensing Arm appears providing Linda with a piece of paper.
  7. Both the HSA and PDA will return back to their original positions.
  8. Finally the green LED goes on indicating Miranda that Linda has finished.

 If Linda is just sitting down and she doesn't deposit anything then the red LED will remain on (telling Miranda that her daughter hasn’t used the toilet yet)!

 Now Miranda is feeling better about her daughter, who likes the ITOI and is starting to use the toilet by herself!


What are the 'ITOI' Hardware components?

  1-      Kid Toilet Lid

2-      Presence sensor: a distance measuring sensor unit from Sharp (Part no. GP2Y0D810Z0F).

3-      “Action” sensors: in order to be able to detect the passing of objects through the lid, several pairs of Infrared Emitting Diodes and Photo-sensors.

4-      Action signals: This arrangement of color LEDs acts as a traffic light, indicating the status of the ITOI.

5-      The Hand-Shaking Arm (HSA): the arm that controls the HSA is attached to a servomotor that changes its position depending on the actions of the kid.

6-      Paper-Dispensing Arm (PDA): this device is controlled in a similar way to the HSA.

7-      Control Box: This box will contain the control box (Arduino+Motor Shield) and all the additional electronics required to make the rest of the components work. Furthermore, a music box and the built-in speakers are placed in this Control Box.

All these elements are controlled by an Arduino board and a C++ code written for this purpose (described below).

Code:

//////////////////////////////////////////////////////////////////////////
//   //
// ITOI: The Interactive TOIlet for kids //
// //
// Tarek Mokhtar and Ivan Siles //
// //
// Project #1 - Architectural Robotics (Arch879/ECE893)  //
// //
// Spring 2009 //
// Clemson University, Clemson, SC //
// //
//////////////////////////////////////////////////////////////////////////

// Declare all the IN/OUT pin variables

int Action1 = 2; // Action sensors (Digital Inputs 2-4)
int Action2 = 3;
int Action3 = 4;

int Presence = 6; // Presence sensor (Digital Input 6)

int Music = 7; // Music box (Digital Output 7)

int Red = 11; // Red LEDs (Digital Output 11)
int Yellow = 12; // Yellow LEDs (Digital Output 12)
int Green = 13; // Green LEDs (Digital Output 13)

int Paper = 9; // Paper-Dispensing Arm Servo
int Shake = 10; // Hand-Shaking Arm Servo

// Declare own variables
int Pres = 0;

int Action = 0;

int     presence = 0;

int A1 = 0;
int A2 = 0;
int A3 = 0;

int Time_Paper = 0;
int Time_Shake = 0;


//**********************************************************************//
// //
// VOID SETUP: Configure board pins //
// //
//**********************************************************************//

void setup() {

pinMode(Presence,INPUT); // Presence Sensor: INPUT

pinMode(Action1,INPUT); // Action sensors: INPUT
pinMode(Action2,INPUT);
pinMode(Action3,INPUT);

pinMode(Music,OUTPUT); // Music box: OUTPUT

pinMode(Red,OUTPUT); // Action Signals (LEDs): OUTPUT
pinMode(Yellow,OUTPUT);
pinMode(Green,OUTPUT);

pinMode(Paper,OUTPUT); // Servomotors (Motor Shield)
pinMode(Shake,OUTPUT);

} // Close void setup

//**********************************************************************//
// //
// VOID LOOP: Main program   //
// //
//**********************************************************************//

void loop() {

digitalWrite(Red,LOW); // Make sure all LEDs are OFF
digitalWrite(Yellow,LOW);
digitalWrite(Green,LOW);

while (presence == 0) { // If no kid, keep updating sensor
                Pres = digitalRead(Presence); // Read from presence sensor

                  if (Pres==LOW){
                        presence=1;
                }
                else {
                 presence=0;
                }
} // Close while

digitalWrite(Red,HIGH); // If kid detected, Red light ON

while (Action == 0) { // If no action from kid, update sensors
A1 = digitalRead(Action1);
A2 = digitalRead(Action2);
A3 = digitalRead(Action3);

if (A1==HIGH || A2==HIGH || A3==HIGH) {
Action = 1; // If action detected
} // Close if
         else {
Action = 0;
} // Close else

} // Close while

digitalWrite(Red,LOW); // Red light OFF
digitalWrite(Yellow,HIGH); // Yellow light ON

        digitalWrite(Music,LOW);
        delay(100);
digitalWrite(Music,HIGH); // Music ON
        delay(100);
        digitalWrite(Music,LOW); // Only pulse is required


// Activate Hand-Shaking Arm (HSA)
        
        for (Time_Shake = 0; Time_Shake <= 15; Time_Shake++) { // 90 degrees approx.

digitalWrite(Shake,HIGH);
delayMicroseconds(1400); // 1.4ms CLOCKWISE
digitalWrite(Shake,LOW);
delay(20); // 20ms
}

delay(12000); // Wait 12 seconds (song)

// Activate Paper-Dispensing Arm (PDA)

for (Time_Paper = 0; Time_Paper <= 17; Time_Paper++) { // 90 degrees approx.

digitalWrite(Paper,HIGH);
delayMicroseconds(1600); // 1.6ms COUNTER-CLOCKWISE
digitalWrite(Paper,LOW);
delay(20); // 20ms
}
delay(5000); // Wait 5 seconds

digitalWrite(Yellow,LOW); // Yellow light OFF
digitalWrite(Green,HIGH); // Red light ON

// Deactivate both arms

for (Time_Paper = 0; Time_Paper <= 7; Time_Paper++) {

digitalWrite(Paper,HIGH);
delayMicroseconds(1400); // 1.4ms CLOCKWISE
digitalWrite(Paper,LOW);
delay(20); // 20ms
}

for (Time_Shake = 0; Time_Shake <= 7; Time_Shake++) {

digitalWrite(Shake,HIGH);
delayMicroseconds(1600); // 1.6ms COUNTER-CLOCKWISE
digitalWrite(Shake,LOW);
delay(20); // 20ms
}

while (1) { // Infinite loop

} // Close while

} // Close void loop


Electric Diagrams:

1 - Action sensors: 
R1-R3 100-Ohm resistors
D1-D3 IR LEDs
R4-R6 10-kOhm resistors
Q1-Q3 Photo transistors 


2 - Action lights: 
R7-R12 150-Ohm resistors
D4-D5  Red LEDs
D6-D7  Yellow LEDs
  D8-D9  Green LEDs

3 - Music-activating circuit: 
R13 10-kOhm resistor
Q4  2N2222 General Purpose Transistor
A-B Terminals to the music box


4 - Presence sensor: 
R14 10-Ohm resistor
C1  22 nF electrolytic capacitor




No comments:

Post a Comment