Thanks for the comments.
outofoptions:
Would it simply be good enough to have the water turned off when you are not there or when you go to bed at night? The less times you activate the valve the less chance of valve failure. Also, I'd hate to be in the shower all soaped up and have it go off.
That's what I'm trying. If the "PIR" doesn't detect a presence, the valve will stay closed.
wildbill:
You could implement a cap on flow time too: close the valve if there is continuous flow for more than a specified time. In my house that limit would probably be 15 minutes when someone takes a long shower. In that circumstance it would be nice if the arduino provided an alarm, whether that be a warning light or a text message/email.
The problem with a cap on flow time is that the dishwasher and the washing machine will use the water for around 1-2 hours. I'm thinking more about a delayed closing (1-2 mins) to let the tank on the WC be filled once you are out of the bathroom.
Alarms, lights or SMS/call are nice, but they are "useless" if you are far from home. The damage the water will do in just 15mins is just unbelievable.
Robin2:
The problem with any system like this is that a burst pipe can do enormous damage in 5 minutes - especially if there is high water pressure. And a system that interfered with the normal water usage every 2 minutes would be very tedious.
A "slam shut" valve might provide protection. It's the sort of valve that only stays open if there is pressurized water on both sides of it. If there is a burst pipe and no restriction on the outflow the valve will slam shut automatically. It needs no external power or control. However I don't know if they are available for domestic systems.
I think I would be reluctant to install a computer controlled system and then rely on it. A power outage is more likely than a burst pipe. In my experience water systems are very reliable once they are installed properly. I suspect if you analyzed the risks thoroughly you would convince yourself that the protection (if any) provided by the computer system would not justify the cost. Turning of the water supply before you go away for a few days costs nothing.
If it were possible to design a computer detection system that could sound an alarm if there was water where it should not be you may have some additional protection. Perhaps it could detect a wet carpet?
If the burst was due to frost then a computer controlled anti-frost heater may be a better bet.
...R
The "slam shut valves" are nice options with a great quantity of flow, but in domestic use they are not an option, since you can have a flexible pipe from the water tap in the kitchen broken leaking water and that will not exceed from the "normal" use pressure and the slam shut valve will not go off. I'm sorry about the poor explanation but I don't really know how to explain this better in english. I'm a plumber and I know they will not work for this matter.
Close the water supply when you are away is the idea, but let the people do it manually... I'm human I will forget. Any way, the problem is not just go away for a few days. I work for +12 hours and in just a little portion of that time it will be a mess. This accident that happened to me the last month was only because of the water flowing from a broken pipe inside home while I was working.
There are commercial systems that will notice if there is any water on the floor and close a valve somewhere, but they are over 1500 euros and they need a heavy installation. Plus, they will NOT notice if the broken pipe is into the wall or under the floor.
An Arduino, 3-5 PIRs, motorized valve and a power source will not exceed 500 euros. It's more than affordable if I can make it work. And since all these work with 12v and a low current, it wouldn't be hard to use a backup battery system... I suppose.
By the way, since I'm thinking of this for some weeks now I appreciate the ideas given (I mean that I thought many other "solutions" that I dismissed) , but if you could guide me with the equipment I will need it will be awesome. I checked the PIRs that "Arduino" is offering and they only have a 40cm max range. Is there any with more range?
Thanks again.