A pipe connection includes a main body, an inner sleeve, a water inlet connector, a water outlet connector, a circuit board, a control panel, at least one battery, a magnetically activated detector, an impeller, and a magnetic member. In operation, when the water flows through the impeller, the impeller is rotated, and the magnetic member is moved to pass by the detector intermittently so that the detector can transmit a detected signal to the circuit board which can calculate the rotation speed of the magnetic member so as to obtain the water flow rate. Thus, the pipe connection can calculate and indicate the water flow rate in the pipe so that when the flow rate of the output water from the pipe reaches a preset value, the user can shut the water flow to regulate and save the water flow.