Toward improving water pipe leakage detection, we use an ESP32 board, sensors, and Internet of Things (IoT) technology to achieve the flow rate detection and throttling of water. We use a Message Queuing Telemetry Transport server as a broker to receive and transmit the flow data and leakage alarm, respectively. The leakage detection and LINE notification are realized using a Python program. For the information security of IoT, we use Galois/Counter Mode block encryption for packaging IoT messages. The transmission speed of the encrypted message has no notable difference from that of the unencrypted one when the content exceeds 1000 bytes.