A fire is a large fire that spreads causing significant damage. It is considered one of the disasters that affects public infrastructure. In fact, the MLDK market in the municipality of Masina has experienced cases of fire of unidentified origin that have caused huge losses to small traders and even, caused huge expenses of rehabilitation work for the state and some pavilions have remained unrehabilitated to this day. The objective of this article is to set up a fire detection and extinguishing system equipped with networks, thermal sensors and sprinklers to prevent fires in order to protect people and their property. In addition to the literature review, which is upstream of all the methods used, this approach was based on direct observation and experimental methods supported by a field survey. The results obtained show the interest of this project on fire detection, especially in non-working hours. Automatic fire detection and extinguishing is a very complex and delicate process, which requires appropriate and efficient equipment.