Go Down

Topic: Automatic Toilet Flusher (Read 3 times) previous topic - next topic

Big Oil

Sep 25, 2010, 05:50 am Last Edit: Sep 25, 2010, 05:52 am by Big_Oil Reason: 1
A distance sensor senses if someone is present.  Once they leave, a servo pulls a fishing line which flushes the toilet.  



This is a proof of concept version 1.0, it could be made to look prettier.  
Ingredients:
1 servo
30 lb test fishing line
IR distance sensor http://www.sparkfun.com/commerce/product_info.php?products_id=242

Here's a different version that inspired me, it was made with legos: http://www.dexterindustries.com/Project-eFlush.html#

Tips if you make your own:
I made the end of the lever towards the handle a bit shorter so that the force would be spread out over a greater distance, resulting in less strain on the servo.
The mechanism has to be secured, because it wants to push upwards and to the side.  I put a piece of wood underneath the lip of the lid to keep it from moving upwards.  I also have a piece going down in the back to keep it stable.  Maybe you could use a strap from front to back to hold it in place.  

Code: [Select]
#include <ServoTimer1.h>
ServoTimer1 servo1;

int sensor=0;
int sensorPin=5; //distance sensor on analog pin 5

int PreparingToFlush=0;

void setup() {
 Serial.begin(9600);          
 servo1.attach(10); //servo data line on pin 10
 servo1.write(3);
}


void loop() {
sensor=analogRead(sensorPin);



if (sensor > 100){ //if distance sensor detects someone
 delay(2000);  // wait
 sensor=analogRead(sensorPin);
 if (sensor > 100){ // check again to make sure someone is actually there
 PreparingToFlush=1;
 }
}

if (PreparingToFlush==1){ //if a person has been detected
 if (sensor < 100){ // if the person has now left
 
 servo1.write(175); //FLUSH
 delay(5000);
 servo1.write(3);
 delay(1000);
 
 PreparingToFlush=0;  //reset the trigger
}
}  
 
 delay(10);
}


Jeremy1998

Someone ALWAYS beats me to it!!! I was going to do this, but never got around to it... Good work!

kas

Probably needs some refining; but you did it  ;)

The place of Aduino is definitly ... anywhere  ;D ;D ;D

CharlezDarwin

Looking good, sir.  Where will the ass wiping mechanism be attached?

Korman

#4
Sep 26, 2010, 08:45 pm Last Edit: Sep 26, 2010, 08:46 pm by Korman Reason: 1
Quote
Where will the ass wiping mechanism be attached?

That's stage 2. Here's a demo version being tuned in the lab:



Korman

Big Oil


Si

Nice.

We definitely need to see a video of this working - with suitable editing of course.
--
My New Arduino Book: http://www.arduinobook.com

wediggers

for version 2 you should just have the servo string pull sideways/up on the middle/bottom of the chain that hangs down inside the toilet off the handle arm so you can't see it and can still use the handle as normal but the servo could also flush it

T86157

#8
Oct 07, 2010, 10:25 pm Last Edit: Oct 07, 2010, 10:26 pm by T86157 Reason: 1
make sure your board is rust proof and the wood is water proof just in case of any splash diarrhea explosion damage. it would suck to have poo marks everywhere :(

Other than that, looks good

Big Oil

Good thinking wediggers.  I saw that someone did something like that: http://toolex.blogspot.com/2008/05/arduino-flush-o-matic.html

I was concerned that the moisture might disable the servo.  I'll try it anyway and put my servo on the line for the sake of progress.  I think I'll replace their wire mounting setup because it lifts the lid up a bit, some strong fishing line would lay flat and keep the lid tight.  

Big Oil

#10
Oct 16, 2010, 03:39 am Last Edit: Oct 16, 2010, 03:42 am by Big_Oil Reason: 1
I think I've made this project as simple as possible.  There is no apparatus needed to flush it.  I mounted the servo inside the toilet tank by just tying a knot in the servo wire.  



The knot is outside the porcelain lid so that the servo does not fall into the tank.
The fishing line is connected to a hook, which you can use to hook onto the chain inside the toilet tank.  If you need the line to be tighter you can just hook lower down on the chain.  
I wrapped the servo wire around the servo and taped it so that the wire wouldn't pull out or damage something internally, but maybe that part is not even necessary.
I have had the servo inside the tank for about a week now and so far it is still working fine, despite the moisture.  
Here it is hanging in the tank:



I have also made some adjustments to the code:
Code: [Select]
#include <ServoTimer1.h>
ServoTimer1 servo1;

int sensor=0;
int sensorPin=5; //distance sensor on pin 5

int PreparingToFlush=0;

void setup() {
 Serial.begin(9600);          
 servo1.attach(10); //servo data line on pin 10
 servo1.write(3);
 
// digitalWrite(3,HIGH);
}


void loop() {
sensor=analogRead(sensorPin);

Serial.println(sensor);


 
if (sensor > 90){ //if distance sensor detects someone
 delay(2000);  // wait
 sensor=analogRead(sensorPin);
 Serial.println("Sensing");
 if (sensor > 90){ // check again to make sure someone is actually there
 PreparingToFlush=1;
 digitalWrite(13, HIGH);
 
 Serial.println(sensor);
 }
}

if (PreparingToFlush==1){ //if a person has been detected
 if (sensor < 60){ // if the person has now left
 delay(1000);
 sensor=analogRead(sensorPin);
 if (sensor < 60){
 
 servo1.write(175); //FLUSH
 digitalWrite(13, LOW);
 delay(9000);
 servo1.write(3);
 delay(1000);
 
 PreparingToFlush=0;  //reset the trigger
}
}  
}  
 
 
 delay(10);
}


wortelsoft

#11
Oct 16, 2010, 05:11 pm Last Edit: Oct 16, 2010, 06:20 pm by wortelsoft Reason: 1
What does the misses say?


Looks cool by the way!

Andy R

I know my wife will like it. She is quite tired of the children forgetting to flush. They are very lazy.

But seriously, has anyone ever had trouble with an overflowing toilet? The float shut-off value in the tank failed and the water overflowed from the top of the tank. It was clean water, but the flood caused over $10k in damage. I was thinking about building some kind of moisture alarm.

wortelsoft

The toilets I now (here in the Netherlands) have a hollow tube which is pulled up by lever to flush.
But when the water level rises to much, the water will go over the top of the tube and into toilet.
So you can not get an overflowing toilet.

Korman

This concept with the hole at the top to prevent overflows seems to be too modern for our brothers in the United States of America. After all, it has been invented and pretty standard in continental Europe for only the past 70 years.

Korman

Go Up