Tutorial:Water gate
A water gate, or flood gate, is used to stop a flow of water. Water gates are adjustable gates used to control water flow by either shrinking the stream, or by stopping it altogether. They can be made quite easily with redstone and pistons.
There are three parts to a water gate: The water source, the water channel, and the gate. The water source provides the water. The water source can be a lake, ocean, pond, or even just a water bucket dumped at the beginning of the channel. The channel is a small trench that guides the water where you want it to go. The gate itself is a device made of pistons that blocks the water flow.
To create a water gate, the first thing to do is to create the channel. This can be done by digging it out of the ground or by placing walls on the ground. The gate is simply two pistons facing into the channel that, when extended, occupy the channel and prevent water from flowing. Sticky pistons with an additional block stuck to them can be used for wider channels. Also, for a channel only 1-block wide, just one piston works well. The pistons are then wired to a redstone signal that controls when they are on or off. The signal is commonly a lever, so that when it is on the pistons extend, and when it is off they retract.
Complete article available
This cached Wiki page is unusually large, so it is loaded on demand to keep the initial page fast.