The purpose of this research is to design and build an Internet of Things (IoT) based system that can be used to provide early warning when smoke or fire is detected in the building. The system is also expected to be able to provide notifications via mobile devices to technicians and the head of the laboratory when detecting the height of the rainwater overflow that exceeds a certain limit. The urgency of this research is the need for a system by utilizing the latest technology as an effort to improve safety and security for someone who is in the building when there is a fire hazard or for the safety of equipment in the laboratory. The methodology used in this research is to use a product development approach consisting of software and hardware in a project. Broadly speaking, the stages carried out are: (1) Defining project goals; (2) Define project requirements based on project goals; (3) Designing the system architecture; (4) Define User Experience (UX) flow; (5) Identify the parts/stages of development; (6) Assembling hardware and creating program code for each part/stage; (7) Integrating each part/stage; and (8) testing and troubleshooting. The hardware that will be used is the ESP32 microprocessor which is integrated with the IoT Thingsboard platform. The ESP32 microcontroller has been successfully used as an IoT node that is connected to several sensors including environmental sensors (temperature, humidity) DHT22, light intensity sensors (LDR), motion sensors (motion PIR sensors), magnetic switch reed sensors, MQ2 smoke detector sensors, and sensors. water level. On the server side, the Thingsboard platform has been successfully used as an MQTT broker, presenting data in the form of an interactive dashboard, and triggering alarms.