The project consists of the application of IoT in industry 4.0 implementing control and supervision from a mobile application which will be communicated to a rainwater collection system that has a rain gauge to detect rain, the mobile application will have access to data such as status of the tank, as well as control over opening and closing of the main valve through the MQTT protocol. The rainfall intensity data was stored in a database which sends the values to the web page and it graphs them in real time. Finally, the concepts of instrumentation, automation as well as the regulations for the total construction of the prototype were taken into account.