HOw to detect the flow of water through a pipe

Using a 10k pulldown resistor to ground along with the blue wire and red (connected directly to 5 volts) worked like a champ with the code provided previously by pantonvich :)

that's great!